OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.testshell; | 5 package org.chromium.chrome.testshell; |
6 | 6 |
7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.net.Uri; | 10 import android.net.Uri; |
11 import android.test.ActivityInstrumentationTestCase2; | 11 import android.test.ActivityInstrumentationTestCase2; |
12 import android.text.TextUtils; | 12 import android.text.TextUtils; |
13 | 13 |
| 14 import org.chromium.base.CommandLine; |
14 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
15 import org.chromium.chrome.test.util.ApplicationData; | 16 import org.chromium.chrome.test.util.ApplicationData; |
16 import org.chromium.content.browser.BrowserStartupController; | 17 import org.chromium.content.browser.BrowserStartupController; |
17 import org.chromium.content.browser.test.util.Criteria; | 18 import org.chromium.content.browser.test.util.Criteria; |
18 import org.chromium.content.browser.test.util.CriteriaHelper; | 19 import org.chromium.content.browser.test.util.CriteriaHelper; |
19 import org.chromium.content.common.CommandLine; | |
20 | 20 |
21 import java.util.concurrent.atomic.AtomicBoolean; | 21 import java.util.concurrent.atomic.AtomicBoolean; |
22 | 22 |
23 /** | 23 /** |
24 * Base test class for all ChromiumTestShell based tests. | 24 * Base test class for all ChromiumTestShell based tests. |
25 */ | 25 */ |
26 public class ChromiumTestShellTestBase extends | 26 public class ChromiumTestShellTestBase extends |
27 ActivityInstrumentationTestCase2<ChromiumTestShellActivity> { | 27 ActivityInstrumentationTestCase2<ChromiumTestShellActivity> { |
28 /** The maximum time the waitForActiveShellToBeDoneLoading method will wait.
*/ | 28 /** The maximum time the waitForActiveShellToBeDoneLoading method will wait.
*/ |
29 private static final long WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT = 10000; | 29 private static final long WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT = 10000; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 public void loadUrlWithSanitization(final String url) throws InterruptedExce
ption { | 120 public void loadUrlWithSanitization(final String url) throws InterruptedExce
ption { |
121 getInstrumentation().runOnMainSync(new Runnable() { | 121 getInstrumentation().runOnMainSync(new Runnable() { |
122 @Override | 122 @Override |
123 public void run() { | 123 public void run() { |
124 getActivity().getActiveTab().loadUrlWithSanitization(url); | 124 getActivity().getActiveTab().loadUrlWithSanitization(url); |
125 } | 125 } |
126 }); | 126 }); |
127 waitForActiveShellToBeDoneLoading(); | 127 waitForActiveShellToBeDoneLoading(); |
128 } | 128 } |
129 } | 129 } |
OLD | NEW |