OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |