Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2180)

Unified Diff: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java

Issue 460453002: Fixed Compilation issues related to API Level of Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added call to quit() for OS version less than JELLY_BEAN_MR2 Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+ }
}
}
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698