Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b4036cf authored by Mady Mellor's avatar Mady Mellor
Browse files

Enable kotlin tests in shell & fix some bubbles ones

Test: these
Bug: 173408780
Change-Id: Iadbc436748e6421f7b1f9544d06f574a7cf1602e
parent d1833c1b
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.animation

import android.os.Looper
import android.util.ArrayMap
import android.util.Log
import android.view.View
@@ -847,7 +846,7 @@ class PhysicsAnimator<T> private constructor (target: T) {
     * pass to [spring].
     */
    data class SpringConfig internal constructor(
        internal var stiffness: Float,
        var stiffness: Float,
        internal var dampingRatio: Float,
        internal var startVelocity: Float = 0f,
        internal var finalPosition: Float = UNSET
@@ -879,8 +878,8 @@ class PhysicsAnimator<T> private constructor (target: T) {
     */
    data class FlingConfig internal constructor(
        internal var friction: Float,
        internal var min: Float,
        internal var max: Float,
        var min: Float,
        var max: Float,
        internal var startVelocity: Float
    ) {

+4 −1
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@
android_test {
    name: "WMShellUnitTests",

    srcs: ["**/*.java"],
    srcs: [
        "**/*.java",
        "**/*.kt",
    ],

    static_libs: [
        "WindowManager-Shell",
+2 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import androidx.dynamicanimation.animation.DynamicAnimation
import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.dynamicanimation.animation.SpringForce
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.wm.shell.ShellTestCase
import com.android.wm.shell.animation.PhysicsAnimator.EndListener
import com.android.wm.shell.animation.PhysicsAnimator.UpdateListener
import com.android.wm.shell.animation.PhysicsAnimatorTestUtils.clearAnimationUpdateFrames
@@ -54,8 +54,7 @@ import org.mockito.MockitoAnnotations
@TestableLooper.RunWithLooper
@RunWith(AndroidTestingRunner::class)
@SmallTest
@Ignore("Blocking presubmits - investigating in b/158697054")
class PhysicsAnimatorTest : SysuiTestCase() {
class PhysicsAnimatorTest : ShellTestCase() {
    private lateinit var viewGroup: ViewGroup
    private lateinit var testView: View
    private lateinit var testView2: View
+1 −1
Original line number Diff line number Diff line
@@ -20,12 +20,12 @@ import android.content.pm.LauncherApps
import android.os.UserHandle
import android.testing.AndroidTestingRunner
import androidx.test.filters.SmallTest
import com.android.systemui.util.mockito.eq
import com.android.wm.shell.ShellTestCase
import junit.framework.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.eq
import org.mockito.Mockito.mock
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
+3 −3
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ import android.view.MotionEvent
import android.view.View
import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.animation.PhysicsAnimatorTestUtils
import com.android.wm.shell.ShellTestCase
import com.android.wm.shell.animation.PhysicsAnimatorTestUtils
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
@@ -43,7 +43,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions
@TestableLooper.RunWithLooper
@RunWith(AndroidTestingRunner::class)
@SmallTest
class MagnetizedObjectTest : SysuiTestCase() {
class MagnetizedObjectTest : ShellTestCase() {
    /** Incrementing value for fake MotionEvent timestamps. */
    private var time = 0L