| 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 5472c30d8fc5fe13d5c5ea9253c6f4f1566ae394..936150e64ffcf4dc0017262f81c1ca679b2927bc 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;
|
| @@ -43,17 +44,25 @@ public class ContentBrowserTestsActivity extends Activity {
|
| }
|
| BrowserStartupController.get(getApplicationContext()).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() {
|
|
|