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 static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
8 | 8 |
9 import android.app.Instrumentation; | 9 import android.app.Instrumentation; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 enableJavaScriptOnUiThread(popupContents); | 652 enableJavaScriptOnUiThread(popupContents); |
653 | 653 |
654 getInstrumentation().runOnMainSync(new Runnable() { | 654 getInstrumentation().runOnMainSync(new Runnable() { |
655 @Override | 655 @Override |
656 public void run() { | 656 public void run() { |
657 parentAwContents.supplyContentsForPopup(popupContents); | 657 parentAwContents.supplyContentsForPopup(popupContents); |
658 } | 658 } |
659 }); | 659 }); |
660 | 660 |
661 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); | 661 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); |
662 int callCount = onPageFinishedHelper.getCallCount(); | 662 int finishCallCount = onPageFinishedHelper.getCallCount(); |
663 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time
Unit.MILLISECONDS); | 663 TestAwContentsClient.OnReceivedTitleHelper onReceivedTitleHelper = |
| 664 popupContentsClient.getOnReceivedTitleHelper(); |
| 665 int titleCallCount = onReceivedTitleHelper.getCallCount(); |
| 666 |
| 667 onPageFinishedHelper.waitForCallback(finishCallCount, 1, WAIT_TIMEOUT_MS
, |
| 668 TimeUnit.MILLISECONDS); |
| 669 onReceivedTitleHelper.waitForCallback(titleCallCount, 1, WAIT_TIMEOUT_MS
, |
| 670 TimeUnit.MILLISECONDS); |
664 | 671 |
665 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); | 672 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); |
666 } | 673 } |
667 } | 674 } |
OLD | NEW |