Index: content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java |
diff --git a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java |
index 9164413ba737d858c0f4b249c65b23c178a9c889..bc95f1cbe83fe9223dfe025aee6b8e8747b7d581 100644 |
--- a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java |
+++ b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java |
@@ -7,9 +7,10 @@ package org.chromium.content_browsertests_apk; |
import android.app.Activity; |
import android.content.Context; |
import android.os.Bundle; |
+import android.os.Handler; |
import android.util.Log; |
-import android.view.LayoutInflater; |
-import android.view.View; |
+import android.view.Window; |
+import android.view.WindowManager; |
import org.chromium.base.JNINamespace; |
import org.chromium.base.annotations.SuppressFBWarnings; |
@@ -45,17 +46,25 @@ public class ContentBrowserTestsActivity extends Activity { |
BrowserStartupController.get(getApplicationContext(), LibraryProcessType.PROCESS_BROWSER) |
.initChromiumBrowserProcessForTests(); |
- LayoutInflater inflater = |
- (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
- View view = inflater.inflate(R.layout.test_activity, null); |
- mShellManager = (ShellManager) view.findViewById(R.id.shell_container); |
+ setContentView(R.layout.test_activity); |
+ mShellManager = (ShellManager) findViewById(R.id.shell_container); |
mWindowAndroid = new ActivityWindowAndroid(this); |
- mShellManager.setWindow(mWindowAndroid); |
+ mShellManager.setWindow(mWindowAndroid, false); |
- Log.i(TAG, "Running tests"); |
- runTests(); |
- Log.i(TAG, "Tests finished."); |
- finish(); |
+ Window wind = this.getWindow(); |
+ wind.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); |
+ wind.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); |
+ wind.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); |
+ |
+ new Handler().post(new Runnable() { |
+ @Override |
+ public void run() { |
+ Log.i(TAG, "Running tests"); |
+ runTests(); |
+ Log.i(TAG, "Tests finished."); |
+ finish(); |
+ } |
+ }); |
} |
private void runTests() { |