OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_apk; | 5 package org.chromium.content_shell_apk; |
6 | 6 |
7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
8 | 8 |
9 import android.annotation.TargetApi; | 9 import android.annotation.TargetApi; |
10 import android.app.Activity; | 10 import android.app.Activity; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 } | 109 } |
110 if (TextUtils.isEmpty(shell.getContentViewCore().getWebContents( ).getUrl())) { | 110 if (TextUtils.isEmpty(shell.getContentViewCore().getWebContents( ).getUrl())) { |
111 updateFailureReason("Shell's URL is empty or null."); | 111 updateFailureReason("Shell's URL is empty or null."); |
112 return false; | 112 return false; |
113 } | 113 } |
114 return true; | 114 return true; |
115 } | 115 } |
116 }, WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT, CriteriaHelper.DEFAULT_POLLING _INTERVAL); | 116 }, WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT, CriteriaHelper.DEFAULT_POLLING _INTERVAL); |
117 } | 117 } |
118 | 118 |
119 void setCursorUpdateCallback(Runnable callback) { | |
120 mCallback.getActivityForTestCommon() | |
121 .getActiveShell() | |
boliu
2017/05/31 16:30:03
activity accessors should happen on ui thread. use
jaebaek
2017/06/01 06:20:56
Ok, I will update it in that way, but have a quest
boliu
2017/06/01 16:14:50
they are probably also unsafe, in theory
| |
122 .getViewAndroidDelegate() | |
123 .setOnCursorUpdate(callback); | |
124 } | |
125 | |
119 ContentViewCore getContentViewCore() { | 126 ContentViewCore getContentViewCore() { |
120 return mCallback.getActivityForTestCommon().getActiveShell().getContentV iewCore(); | 127 return mCallback.getActivityForTestCommon().getActiveShell().getContentV iewCore(); |
121 } | 128 } |
122 | 129 |
123 WebContents getWebContents() { | 130 WebContents getWebContents() { |
124 return mCallback.getActivityForTestCommon().getActiveShell().getWebConte nts(); | 131 return mCallback.getActivityForTestCommon().getActiveShell().getWebConte nts(); |
125 } | 132 } |
126 | 133 |
127 void loadUrl(final NavigationController navigationController, | 134 void loadUrl(final NavigationController navigationController, |
128 TestCallbackHelperContainer callbackHelperContainer, final LoadUrlPa rams params) | 135 TestCallbackHelperContainer callbackHelperContainer, final LoadUrlPa rams params) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 Instrumentation getInstrumentationForTestCommon(); | 198 Instrumentation getInstrumentationForTestCommon(); |
192 T launchActivityWithIntentForTestCommon(Intent t); | 199 T launchActivityWithIntentForTestCommon(Intent t); |
193 T getActivityForTestCommon(); | 200 T getActivityForTestCommon(); |
194 void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable; | 201 void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable; |
195 ContentViewCore getContentViewCoreForTestCommon(); | 202 ContentViewCore getContentViewCoreForTestCommon(); |
196 ContentShellActivity launchContentShellWithUrlForTestCommon(String url); | 203 ContentShellActivity launchContentShellWithUrlForTestCommon(String url); |
197 WebContents getWebContentsForTestCommon(); | 204 WebContents getWebContentsForTestCommon(); |
198 void waitForActiveShellToBeDoneLoadingForTestCommon(); | 205 void waitForActiveShellToBeDoneLoadingForTestCommon(); |
199 } | 206 } |
200 } | 207 } |
OLD | NEW |