Skip to content

Commit ad23424

Browse files
Treehugger RobotGerrit Code Review
Treehugger Robot
authored and
Gerrit Code Review
committed
Merge "Clear parameterlessEngine in tests" into androidx-main
2 parents d4e4007 + 403abad commit ad23424

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/WatchFaceServiceAndroidTest.kt

+7
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,23 @@ import android.graphics.drawable.Icon
2121
import androidx.test.core.app.ApplicationProvider
2222
import androidx.test.ext.junit.runners.AndroidJUnit4
2323
import androidx.test.filters.MediumTest
24+
import androidx.wear.watchface.control.InteractiveInstanceManager
2425
import androidx.wear.watchface.style.UserStyleSchema
2526
import androidx.wear.watchface.style.UserStyleSetting
2627
import androidx.wear.watchface.style.WatchFaceLayer
2728
import androidx.wear.watchface.test.SimpleWatchFaceTestService
29+
import org.junit.After
2830
import org.junit.Test
2931
import org.junit.runner.RunWith
3032

3133
@RunWith(AndroidJUnit4::class)
3234
@MediumTest
3335
class WatchFaceServiceAndroidTest {
36+
@After
37+
public fun tearDown() {
38+
InteractiveInstanceManager.setParameterlessEngine(null)
39+
}
40+
3441
@Test
3542
fun measuresWatchFaceIconsFromCustomContext() {
3643
val context: Context = ApplicationProvider.getApplicationContext()

wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import androidx.wear.watchface.complications.data.ShortTextComplicationData
5050
import androidx.wear.watchface.complications.data.WeightedElementsComplicationData
5151
import androidx.wear.watchface.control.IHeadlessWatchFace
5252
import androidx.wear.watchface.control.IWatchFaceControlService
53+
import androidx.wear.watchface.control.InteractiveInstanceManager
5354
import androidx.wear.watchface.control.WatchFaceControlService
5455
import androidx.wear.watchface.control.data.ComplicationRenderParams
5556
import androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams
@@ -142,6 +143,7 @@ public class WatchFaceControlServiceTest {
142143
if (this::instance.isInitialized) {
143144
instance.release()
144145
}
146+
InteractiveInstanceManager.setParameterlessEngine(null)
145147
}
146148

147149
private fun createInstance(width: Int, height: Int) {

wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ import org.junit.After
8686
import org.junit.Assert.fail
8787
import org.junit.Assume
8888
import org.junit.Before
89-
import org.junit.Ignore
9089
import org.junit.Rule
9190
import org.junit.Test
9291
import org.junit.runner.RunWith
@@ -215,6 +214,7 @@ public class WatchFaceServiceImageTest {
215214
}
216215
assertThat(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)).isTrue()
217216
pretendBinderThread.quitSafely()
217+
InteractiveInstanceManager.setParameterlessEngine(null)
218218
}
219219

220220
private fun initCanvasWatchFace(onInvalidateCountDownLatch: CountDownLatch? = null) {
@@ -546,7 +546,6 @@ public class WatchFaceServiceImageTest {
546546
bitmap!!.assertAgainstGolden(screenshotRule, "placeholderComplications")
547547
}
548548

549-
@Ignore("b/274813981")
550549
@SuppressLint("NewApi")
551550
@Test
552551
public fun testSmallImageComplications() {
@@ -694,7 +693,6 @@ public class WatchFaceServiceImageTest {
694693
bitmap!!.assertAgainstGolden(screenshotRule, "left_complication_pressed")
695694
}
696695

697-
@Ignore("b/274981990")
698696
@SuppressLint("NewApi")
699697
@Test
700698
public fun testHighlightRightComplicationInScreenshot() {

wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/XmlDefinedUserStyleSchemaAndComplicationSlotsTest.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import org.junit.After
6767
import org.junit.Assert
6868
import org.junit.Assume
6969
import org.junit.Before
70-
import org.junit.Ignore
7170
import org.junit.Test
7271
import org.junit.runner.RunWith
7372
import org.mockito.Mock
@@ -176,6 +175,7 @@ public class XmlDefinedUserStyleSchemaAndComplicationSlotsTest {
176175

177176
@After
178177
public fun tearDown() {
178+
InteractiveInstanceManager.setParameterlessEngine(null)
179179
if (this::interactiveWatchFaceInstance.isInitialized) {
180180
interactiveWatchFaceInstance.release()
181181
}
@@ -216,7 +216,6 @@ public class XmlDefinedUserStyleSchemaAndComplicationSlotsTest {
216216
assertThat(existingInstance).isNull()
217217
}
218218

219-
@Ignore // b/275354644
220219
@Test
221220
@Suppress("Deprecation", "NewApi") // userStyleSettings
222221
public fun staticSchemaAndComplicationsRead() {

0 commit comments

Comments
 (0)