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

Unified Diff: ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm

Issue 2825673003: Enable testShowJavaScriptAfterNewTabAnimation for iPad (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2c7e0f421ca727a8ee935042249deaf85a96733b..d149a721e4e73a1ddd1d70c5c7ea2bbc77092e8c 100644
--- a/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
+++ b/ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm
@@ -555,11 +555,6 @@ - (void)testShowJavaScriptAfterNewTabAnimation {
@"correctly.");
#endif
- // TODO(crbug.com/711291): reenable this on tablets.
- if (IsIPadIdiom()) {
- EARL_GREY_TEST_DISABLED(@"Disabled for iPad.");
- }
-
// Load the test page with a link to kOnLoadAlertURL and long tap on the link.
[self loadPageWithLink];
id<GREYMatcher> webViewMatcher =
@@ -573,6 +568,20 @@ - (void)testShowJavaScriptAfterNewTabAnimation {
l10n_util::GetNSStringWithFixup(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB));
[[EarlGrey selectElementWithMatcher:newTabMatcher] performAction:grey_tap()];
+ // This test case requires that a dialog is presented in the onload event so
+ // that the DialogPresenter attempts to display during a new tab animation.
+ // Because presenting a dialog halts the JavaScript execution on the page,
+ // this prevents the page loaded event from being received until the alert is
+ // closed. On iPad, this means that there is a loading indicator that
+ // continues to animate until the dialog is closed. Disabling EarlGrey
+ // synchronization code for iPad allows the test to detect and dismiss the
+ // dialog while this animation is occurring.
+ if (IsIPadIdiom()) {
+ [[GREYConfiguration sharedInstance]
+ setValue:@(NO)
+ forConfigKey:kGREYConfigKeySynchronizationEnabled];
baxley 2017/04/18 23:15:31 Should we also add the call to enable synchronizat
kkhorimoto 2017/04/19 18:40:38 Done.
+ }
+
// Wait for the alert to be shown.
NSString* alertLabel = [DialogPresenter
localizedTitleForJavaScriptAlertFromPage:HttpServer::MakeUrl(
@@ -587,6 +596,13 @@ - (void)testShowJavaScriptAfterNewTabAnimation {
// Close the alert.
TapOK();
+
+ // Reenable synchronization on iPads now that the dialog has been dismissed.
+ if (IsIPadIdiom()) {
+ [[GREYConfiguration sharedInstance]
+ setValue:@(YES)
+ forConfigKey:kGREYConfigKeySynchronizationEnabled];
+ }
}
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698