Migrate FocusFinder and WindowCache tests
Bug: 170331260
Test: atest CarRotaryControllerUnitTests
Change-Id: Iee2931dab5ae982f230f32863a822e64954ec4b1
diff --git a/tests/robotests/src/com/android/car/rotary/FocusFinderTest.java b/tests/unit/src/com/android/car/rotary/FocusFinderTest.java
similarity index 98%
rename from tests/robotests/src/com/android/car/rotary/FocusFinderTest.java
rename to tests/unit/src/com/android/car/rotary/FocusFinderTest.java
index 86c74a8..f17d9c3 100755
--- a/tests/robotests/src/com/android/car/rotary/FocusFinderTest.java
+++ b/tests/unit/src/com/android/car/rotary/FocusFinderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,17 +16,22 @@
package com.android.car.rotary;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
import android.graphics.Rect;
-import android.test.AndroidTestCase;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
/** Most of the tests are copied from {@link android.view.FocusFinderTest}. */
-@RunWith(RobolectricTestRunner.class)
-public class FocusFinderTest extends AndroidTestCase {
+@RunWith(AndroidJUnit4.class)
+public class FocusFinderTest {
@Test
public void testPartiallyInDirection() {
diff --git a/tests/robotests/src/com/android/car/rotary/WindowCacheTest.java b/tests/unit/src/com/android/car/rotary/WindowCacheTest.java
similarity index 92%
rename from tests/robotests/src/com/android/car/rotary/WindowCacheTest.java
rename to tests/unit/src/com/android/car/rotary/WindowCacheTest.java
index d33e7ba..1067230 100644
--- a/tests/robotests/src/com/android/car/rotary/WindowCacheTest.java
+++ b/tests/unit/src/com/android/car/rotary/WindowCacheTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,12 +20,13 @@
import static com.google.common.truth.Truth.assertThat;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-@RunWith(RobolectricTestRunner.class)
+@RunWith(AndroidJUnit4.class)
public class WindowCacheTest {
private static final int WINDOW_ID_1 = 11;