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.content_shell; | 5 package org.chromium.content_shell; |
6 | 6 |
7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.net.Uri; | 9 import android.net.Uri; |
10 import android.test.ActivityInstrumentationTestCase2; | 10 import android.test.ActivityInstrumentationTestCase2; |
11 import android.text.TextUtils; | 11 import android.text.TextUtils; |
12 | 12 |
13 import org.chromium.base.test.util.UrlUtils; | 13 import org.chromium.base.test.util.UrlUtils; |
14 import org.chromium.content.browser.ContentView; | 14 import org.chromium.content.browser.ContentView; |
15 import org.chromium.content.browser.ContentViewCore; | 15 import org.chromium.content.browser.ContentViewCore; |
16 import org.chromium.content.browser.LoadUrlParams; | 16 import org.chromium.content.browser.LoadUrlParams; |
17 import org.chromium.content.browser.test.util.CallbackHelper; | 17 import org.chromium.content.browser.test.util.CallbackHelper; |
18 import org.chromium.content.browser.test.util.Criteria; | 18 import org.chromium.content.browser.test.util.Criteria; |
19 import org.chromium.content.browser.test.util.CriteriaHelper; | 19 import org.chromium.content.browser.test.util.CriteriaHelper; |
20 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 20 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
| 21 import org.chromium.content_shell_apk.ContentShellActivity; |
21 | 22 |
22 import java.util.concurrent.TimeUnit; | 23 import java.util.concurrent.TimeUnit; |
23 import java.util.concurrent.atomic.AtomicBoolean; | 24 import java.util.concurrent.atomic.AtomicBoolean; |
24 | 25 |
25 /** | 26 /** |
26 * Base test class for all ContentShell based tests. | 27 * Base test class for all ContentShell based tests. |
27 */ | 28 */ |
28 public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte
ntShellActivity> { | 29 public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte
ntShellActivity> { |
29 | 30 |
30 /** The maximum time the waitForActiveShellToBeDoneLoading method will wait.
*/ | 31 /** The maximum time the waitForActiveShellToBeDoneLoading method will wait.
*/ |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 * @param action The action to be performed on the UI thread. | 179 * @param action The action to be performed on the UI thread. |
179 */ | 180 */ |
180 protected void handleBlockingCallbackAction( | 181 protected void handleBlockingCallbackAction( |
181 CallbackHelper callbackHelper, Runnable action) throws Throwable { | 182 CallbackHelper callbackHelper, Runnable action) throws Throwable { |
182 int currentCallCount = callbackHelper.getCallCount(); | 183 int currentCallCount = callbackHelper.getCallCount(); |
183 runTestOnUiThread(action); | 184 runTestOnUiThread(action); |
184 callbackHelper.waitForCallback( | 185 callbackHelper.waitForCallback( |
185 currentCallCount, 1, WAIT_PAGE_LOADING_TIMEOUT_SECONDS, TimeUnit
.SECONDS); | 186 currentCallCount, 1, WAIT_PAGE_LOADING_TIMEOUT_SECONDS, TimeUnit
.SECONDS); |
186 } | 187 } |
187 } | 188 } |
OLD | NEW |