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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content_shell_apk; 5 package org.chromium.content_shell_apk;
6 6
7 import android.annotation.TargetApi;
7 import android.content.Context; 8 import android.content.Context;
9 import android.os.Build;
8 import android.os.PowerManager; 10 import android.os.PowerManager;
9 import android.test.suitebuilder.annotation.Smoke; 11 import android.test.suitebuilder.annotation.Smoke;
10 12
11 import org.chromium.base.test.util.Feature; 13 import org.chromium.base.test.util.Feature;
12 14
13 /** 15 /**
14 * Test that verifies preconditions for tests to run. 16 * Test that verifies preconditions for tests to run.
15 */ 17 */
16 public class ContentShellPreconditionsTest extends ContentShellTestBase { 18 public class ContentShellPreconditionsTest extends ContentShellTestBase {
19 @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
20 @SuppressWarnings("deprecation")
17 @Smoke 21 @Smoke
18 @Feature({"TestInfrastructure"}) 22 @Feature({"TestInfrastructure"})
19 public void testScreenIsOn() throws Exception { 23 public void testScreenIsOn() throws Exception {
20 PowerManager pm = (PowerManager) getInstrumentation().getContext().getSy stemService( 24 PowerManager pm = (PowerManager) getInstrumentation().getContext().getSy stemService(
21 Context.POWER_SERVICE); 25 Context.POWER_SERVICE);
22 26
23 assertTrue("Many tests will fail if the screen is not on.", pm.isScreenO n()); 27 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
28 assertTrue("Many tests will fail if the screen is not on.", pm.isInt eractive());
29 } else {
30 assertTrue("Many tests will fail if the screen is not on.", pm.isScr eenOn());
31 }
24 } 32 }
25 } 33 }
OLDNEW
« 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