Index: content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java |
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 0000000000000000000000000000000000000000..c0fa2161eced7819cd7c77f4462e1278accb0245 |
--- /dev/null |
+++ b/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellPreconditionsTest.java |
@@ -0,0 +1,32 @@ |
+// 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 { |
+ // URL used for base tests. |
+ private static final String URL = "data:text"; |
+ |
+ @Smoke |
+ @Feature({"TestInfrastructure"}) |
+ public void testScreenIsOn() throws Exception { |
+ ContentShellActivity activity = launchContentShellWithUrl(URL); |
Isaac (away)
2012/12/20 21:31:39
Why launch content shell for this test?
|
+ |
+ // Make sure the activity was created as expected. |
+ assertNotNull(activity); |
+ |
+ PowerManager pm = (PowerManager) activity.getSystemService(Context.POWER_SERVICE); |
+ |
+ assertTrue("Many tests will fail if the screen is not on.", pm.isScreenOn()); |
+ } |
+} |