| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 })); | 168 })); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void replaceContainerView() throws Throwable { | 171 void replaceContainerView() throws Throwable { |
| 172 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 172 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 173 @Override | 173 @Override |
| 174 public void run() { | 174 public void run() { |
| 175 ContentView cv = ContentView.createContentView( | 175 ContentView cv = ContentView.createContentView( |
| 176 mCallback.getActivityForTestCommon(), getContentViewCore
()); | 176 mCallback.getActivityForTestCommon(), getContentViewCore
()); |
| 177 ((ViewGroup) getContentViewCore().getContainerView().getParent()
).addView(cv); | 177 ((ViewGroup) getContentViewCore().getContainerView().getParent()
).addView(cv); |
| 178 getContentViewCore().setContainerView(cv); | 178 getContentViewCore().replaceContainerView(cv); |
| 179 getContentViewCore().setContainerViewInternals(cv); | 179 getContentViewCore().setContainerViewInternals(cv); |
| 180 cv.requestFocus(); | 180 cv.requestFocus(); |
| 181 } | 181 } |
| 182 }); | 182 }); |
| 183 } | 183 } |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * Interface used by TestRule and TestBase class to implement methods for Te
stCommonCallback | 186 * Interface used by TestRule and TestBase class to implement methods for Te
stCommonCallback |
| 187 * class to use. | 187 * class to use. |
| 188 */ | 188 */ |
| 189 public static interface TestCommonCallback<T extends Activity> { | 189 public static interface TestCommonCallback<T extends Activity> { |
| 190 Instrumentation getInstrumentationForTestCommon(); | 190 Instrumentation getInstrumentationForTestCommon(); |
| 191 T launchActivityWithIntentForTestCommon(Intent t); | 191 T launchActivityWithIntentForTestCommon(Intent t); |
| 192 T getActivityForTestCommon(); | 192 T getActivityForTestCommon(); |
| 193 void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable; | 193 void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable; |
| 194 ContentViewCore getContentViewCoreForTestCommon(); | 194 ContentViewCore getContentViewCoreForTestCommon(); |
| 195 ContentShellActivity launchContentShellWithUrlForTestCommon(String url); | 195 ContentShellActivity launchContentShellWithUrlForTestCommon(String url); |
| 196 WebContents getWebContentsForTestCommon(); | 196 WebContents getWebContentsForTestCommon(); |
| 197 void waitForActiveShellToBeDoneLoadingForTestCommon(); | 197 void waitForActiveShellToBeDoneLoadingForTestCommon(); |
| 198 } | 198 } |
| 199 } | 199 } |
| OLD | NEW |