| Index: ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
|
| diff --git a/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm b/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
|
| index 9d4f449c8b122d9b98ba99b3ad43a94b136333ef..a57d2427c0521678fa5e08eb4426f0a9c3caa2b0 100644
|
| --- a/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
|
| +++ b/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
|
| @@ -201,10 +201,11 @@ void WaitForAlertToBeShown(NSString* alert_label) {
|
| }
|
|
|
| void WaitForJavaScripDialogToBeShown() {
|
| - NSString* alert_label = [DialogPresenter
|
| - localizedTitleForJavaScriptAlertFromPage:HttpServer::MakeUrl(
|
| - kJavaScriptTestURL)];
|
| - WaitForAlertToBeShown(alert_label);
|
| + GURL javaScriptURL = HttpServer::MakeUrl(kJavaScriptTestURL);
|
| + NSString* alertLabel =
|
| + [DialogPresenter localizedTitleForJavaScriptAlertFromPage:javaScriptURL
|
| + mainFrameURL:javaScriptURL];
|
| + WaitForAlertToBeShown(alertLabel);
|
| }
|
|
|
| // Injects JavaScript to show a dialog with |type|, verifying that it was
|
| @@ -226,9 +227,10 @@ void ShowJavaScriptDialog(JavaScriptAlertType type) {
|
| void AssertJavaScriptAlertNotPresent() {
|
| ConditionBlock condition = ^{
|
| NSError* error = nil;
|
| + GURL javaScriptURL = HttpServer::MakeUrl(kJavaScriptTestURL);
|
| NSString* alertLabel = [DialogPresenter
|
| - localizedTitleForJavaScriptAlertFromPage:HttpServer::MakeUrl(
|
| - kJavaScriptTestURL)];
|
| + localizedTitleForJavaScriptAlertFromPage:javaScriptURL
|
| + mainFrameURL:javaScriptURL];
|
| id<GREYMatcher> titleLabel =
|
| chrome_test_util::StaticTextWithAccessibilityLabel(alertLabel);
|
| [[EarlGrey selectElementWithMatcher:titleLabel] assertWithMatcher:grey_nil()
|
| @@ -574,9 +576,10 @@ void TapSuppressDialogsButton() {
|
| }
|
|
|
| // Wait for the alert to be shown.
|
| - NSString* alertLabel = [DialogPresenter
|
| - localizedTitleForJavaScriptAlertFromPage:HttpServer::MakeUrl(
|
| - kJavaScriptTestURL)];
|
| + GURL javaScriptURL = HttpServer::MakeUrl(kJavaScriptTestURL);
|
| + NSString* alertLabel =
|
| + [DialogPresenter localizedTitleForJavaScriptAlertFromPage:javaScriptURL
|
| + mainFrameURL:javaScriptURL];
|
| WaitForAlertToBeShown(alertLabel);
|
|
|
| // Verify that the omnibox shows the correct URL when the dialog is visible.
|
|
|