diff options
author | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 16:46:58 +0000 |
---|---|---|
committer | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 16:46:58 +0000 |
commit | 49da07b4e0625ba3228309148a607b587e58f3c8 (patch) | |
tree | 6a882945d1805f859b092097bf78927e17c7dc5a /content/shell | |
parent | d789ea44363af00d4195833f04ab52e3615ad081 (diff) | |
download | chromium_src-49da07b4e0625ba3228309148a607b587e58f3c8.zip chromium_src-49da07b4e0625ba3228309148a607b587e58f3c8.tar.gz chromium_src-49da07b4e0625ba3228309148a607b587e58f3c8.tar.bz2 |
[Android] Add test that asserts screen is on.
Lots of tests fail with seemingly random failures if the screen turns off. Add an explicit test for this so it's obvious why tests are failing.
BUG=167141
Review URL: https://chromiumcodereview.appspot.com/11642050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java b/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java new file mode 100644 index 0000000..54b3203 --- /dev/null +++ b/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java @@ -0,0 +1,25 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.content_shell; + +import android.content.Context; +import android.os.PowerManager; +import android.test.suitebuilder.annotation.Smoke; + +import org.chromium.base.test.util.Feature; + +/** + * Test that verifies preconditions for tests to run. + */ +public class ContentShellPreconditionsTest extends ContentShellTestBase { + @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()); + } +} |