Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2162)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java

Issue 971433002: Revert of Test PostMessage to popup window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
index 619979c9ae93a8fd1cdf29eb2af3e09d0faef2ab..ef65bfe2899d66e337a1eb9fe93ad05539c2bcea 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
@@ -21,9 +21,7 @@
import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
-import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageFinishedHelper;
import org.chromium.content_public.browser.LoadUrlParams;
-import org.chromium.net.test.util.TestWebServer;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -511,59 +509,4 @@
});
}
- /**
- * Loads the main html then triggers the popup window.
- */
- public void triggerPopup(final AwContents parentAwContents,
- TestAwContentsClient parentAwContentsClient, TestWebServer testWebServer,
- String mainHtml, String popupHtml, String popupPath, String triggerScript)
- throws Exception {
- enableJavaScriptOnUiThread(parentAwContents);
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- parentAwContents.getSettings().setSupportMultipleWindows(true);
- parentAwContents.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
- }
- });
-
- final String parentUrl = testWebServer.setResponse("/popupParent.html", mainHtml, null);
- testWebServer.setResponse(popupPath, popupHtml, null);
-
- parentAwContentsClient.getOnCreateWindowHelper().setReturnValue(true);
- loadUrlSync(parentAwContents, parentAwContentsClient.getOnPageFinishedHelper(), parentUrl);
-
- TestAwContentsClient.OnCreateWindowHelper onCreateWindowHelper =
- parentAwContentsClient.getOnCreateWindowHelper();
- int currentCallCount = onCreateWindowHelper.getCallCount();
- parentAwContents.evaluateJavaScript(triggerScript, null);
- onCreateWindowHelper.waitForCallback(
- currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- }
-
- /**
- * Supplies the popup window with AwContents then waits for the popup window to finish loading.
- */
- public AwContents connectPendingPopup(final AwContents parentAwContents) throws Exception {
- TestAwContentsClient popupContentsClient;
- AwTestContainerView popupContainerView;
- final AwContents popupContents;
- popupContentsClient = new TestAwContentsClient();
- popupContainerView = createAwTestContainerViewOnMainSync(popupContentsClient);
- popupContents = popupContainerView.getAwContents();
- enableJavaScriptOnUiThread(popupContents);
-
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- parentAwContents.supplyContentsForPopup(popupContents);
- }
- });
-
- OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPageFinishedHelper();
- int callCount = onPageFinishedHelper.getCallCount();
- onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
-
- return popupContents;
- }
}
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698