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

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

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.android_webview.test; 5 package org.chromium.android_webview.test;
6 6
7 import android.app.Instrumentation; 7 import android.app.Instrumentation;
8 import android.content.Context; 8 import android.content.Context;
9 import android.graphics.Bitmap; 9 import android.graphics.Bitmap;
10 import android.test.ActivityInstrumentationTestCase2; 10 import android.test.ActivityInstrumentationTestCase2;
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 } else { 581 } else {
582 testWebServer.setResponseWithNoContentStatus(popupPath); 582 testWebServer.setResponseWithNoContentStatus(popupPath);
583 } 583 }
584 584
585 parentAwContentsClient.getOnCreateWindowHelper().setReturnValue(true); 585 parentAwContentsClient.getOnCreateWindowHelper().setReturnValue(true);
586 loadUrlSync(parentAwContents, parentAwContentsClient.getOnPageFinishedHe lper(), parentUrl); 586 loadUrlSync(parentAwContents, parentAwContentsClient.getOnPageFinishedHe lper(), parentUrl);
587 587
588 TestAwContentsClient.OnCreateWindowHelper onCreateWindowHelper = 588 TestAwContentsClient.OnCreateWindowHelper onCreateWindowHelper =
589 parentAwContentsClient.getOnCreateWindowHelper(); 589 parentAwContentsClient.getOnCreateWindowHelper();
590 int currentCallCount = onCreateWindowHelper.getCallCount(); 590 int currentCallCount = onCreateWindowHelper.getCallCount();
591 parentAwContents.evaluateJavaScriptForTests(triggerScript, null); 591 parentAwContents.evaluateJavaScript(triggerScript, null);
592 onCreateWindowHelper.waitForCallback( 592 onCreateWindowHelper.waitForCallback(
593 currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); 593 currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
594 } 594 }
595 595
596 /** 596 /**
597 * POD object for holding references to helper objects of a popup window. 597 * POD object for holding references to helper objects of a popup window.
598 */ 598 */
599 public static class PopupInfo { 599 public static class PopupInfo {
600 public final TestAwContentsClient popupContentsClient; 600 public final TestAwContentsClient popupContentsClient;
601 public final AwTestContainerView popupContainerView; 601 public final AwTestContainerView popupContainerView;
(...skipping 25 matching lines...) Expand all
627 } 627 }
628 }); 628 });
629 629
630 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag eFinishedHelper(); 630 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag eFinishedHelper();
631 int callCount = onPageFinishedHelper.getCallCount(); 631 int callCount = onPageFinishedHelper.getCallCount();
632 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time Unit.MILLISECONDS); 632 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time Unit.MILLISECONDS);
633 633
634 return new PopupInfo(popupContentsClient, popupContainerView, popupConte nts); 634 return new PopupInfo(popupContentsClient, popupContainerView, popupConte nts);
635 } 635 }
636 } 636 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698