Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.content_shell; | |
| 6 | |
| 7 import android.content.Context; | |
| 8 import android.os.PowerManager; | |
| 9 import android.test.suitebuilder.annotation.Smoke; | |
| 10 | |
| 11 import org.chromium.base.test.util.Feature; | |
| 12 | |
| 13 /** | |
| 14 * Test that verifies preconditions for tests to run. | |
| 15 */ | |
| 16 public class ContentShellPreconditionsTest extends ContentShellTestBase { | |
| 17 // URL used for base tests. | |
| 18 private static final String URL = "data:text"; | |
| 19 | |
| 20 @Smoke | |
| 21 @Feature({"TestInfrastructure"}) | |
| 22 public void testScreenIsOn() throws Exception { | |
| 23 ContentShellActivity activity = launchContentShellWithUrl(URL); | |
|
Isaac (away)
2012/12/20 21:31:39
Why launch content shell for this test?
| |
| 24 | |
| 25 // Make sure the activity was created as expected. | |
| 26 assertNotNull(activity); | |
| 27 | |
| 28 PowerManager pm = (PowerManager) activity.getSystemService(Context.POWER _SERVICE); | |
| 29 | |
| 30 assertTrue("Many tests will fail if the screen is not on.", pm.isScreenO n()); | |
| 31 } | |
| 32 } | |
| OLD | NEW |