OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.annotation.TargetApi; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.os.Build; | 9 import android.os.Build; |
10 import android.os.PowerManager; | 10 import android.os.PowerManager; |
11 import android.support.test.InstrumentationRegistry; | 11 import android.support.test.InstrumentationRegistry; |
(...skipping 20 matching lines...) Expand all Loading... |
32 PowerManager pm = (PowerManager) InstrumentationRegistry.getContext().ge
tSystemService( | 32 PowerManager pm = (PowerManager) InstrumentationRegistry.getContext().ge
tSystemService( |
33 Context.POWER_SERVICE); | 33 Context.POWER_SERVICE); |
34 | 34 |
35 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { | 35 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { |
36 Assert.assertTrue("Many tests will fail if the screen is not on.", p
m.isInteractive()); | 36 Assert.assertTrue("Many tests will fail if the screen is not on.", p
m.isInteractive()); |
37 } else { | 37 } else { |
38 Assert.assertTrue("Many tests will fail if the screen is not on.", p
m.isScreenOn()); | 38 Assert.assertTrue("Many tests will fail if the screen is not on.", p
m.isScreenOn()); |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
OLD | NEW |