Index: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java |
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java |
index 0fa41b6fea2ed581d79cee5527c61582d1a07130..b1e0e654766d23449dfea5f97fb905f0b1f9605e 100644 |
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java |
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java |
@@ -4,7 +4,9 @@ |
package org.chromium.content_shell_apk; |
+import android.annotation.TargetApi; |
import android.content.Context; |
+import android.os.Build; |
import android.os.PowerManager; |
import android.test.suitebuilder.annotation.Smoke; |
@@ -14,12 +16,18 @@ import org.chromium.base.test.util.Feature; |
* Test that verifies preconditions for tests to run. |
*/ |
public class ContentShellPreconditionsTest extends ContentShellTestBase { |
+ @TargetApi(Build.VERSION_CODES.KITKAT_WATCH) |
+ @SuppressWarnings("deprecation") |
@Smoke |
@Feature({"TestInfrastructure"}) |
public void testScreenIsOn() throws Exception { |
PowerManager pm = (PowerManager) getInstrumentation().getContext().getSystemService( |
Context.POWER_SERVICE); |
- assertTrue("Many tests will fail if the screen is not on.", pm.isScreenOn()); |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { |
+ assertTrue("Many tests will fail if the screen is not on.", pm.isInteractive()); |
+ } else { |
+ assertTrue("Many tests will fail if the screen is not on.", pm.isScreenOn()); |
+ } |
} |
} |