Commit 8a50746f authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Fix testTopSitesTileAfterRedirect on iPad.

Fixes some flake in the EG tests, and catches an error in the previous CL
crrev.com/c/1339340.  The NTP should not be created while web usage is disabled.

Bug: 905735
Change-Id: I8bd3d942c3594e4706e29ed0478a935a10602727
Reviewed-on: https://chromium-review.googlesource.com/c/1341208Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609148}
parent f0ece513
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#endif #endif
using chrome_test_util::ClearBrowsingDataCell; using chrome_test_util::ClearBrowsingDataCell;
using chrome_test_util::ClearBrowsingDataCollectionView;
using chrome_test_util::ClearBrowsingDataButton; using chrome_test_util::ClearBrowsingDataButton;
using chrome_test_util::ConfirmClearBrowsingDataButton; using chrome_test_util::ConfirmClearBrowsingDataButton;
using chrome_test_util::SettingsDoneButton; using chrome_test_util::SettingsDoneButton;
...@@ -130,6 +131,12 @@ using web::test::HttpServer; ...@@ -130,6 +131,12 @@ using web::test::HttpServer;
[ChromeEarlGreyUI tapClearBrowsingDataMenuButton:ClearBrowsingDataButton()]; [ChromeEarlGreyUI tapClearBrowsingDataMenuButton:ClearBrowsingDataButton()];
[[EarlGrey selectElementWithMatcher:ConfirmClearBrowsingDataButton()] [[EarlGrey selectElementWithMatcher:ConfirmClearBrowsingDataButton()]
performAction:grey_tap()]; performAction:grey_tap()];
// Before returning, make sure that the top of the Clear Browsing Data
// settings screen is visible to match the state at the start of the method.
[[EarlGrey selectElementWithMatcher:ClearBrowsingDataCollectionView()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
......
...@@ -1696,7 +1696,7 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint ...@@ -1696,7 +1696,7 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint
self.primaryToolbarHeightConstraint.constant = self.primaryToolbarHeightConstraint.constant =
[self primaryToolbarHeightWithInset]; [self primaryToolbarHeightWithInset];
if (self.currentWebState) { if (self.currentWebState && self.webUsageEnabled) {
NewTabPageTabHelper* NTPHelper = NewTabPageTabHelper* NTPHelper =
NewTabPageTabHelper::FromWebState(self.currentWebState); NewTabPageTabHelper::FromWebState(self.currentWebState);
if (NTPHelper && NTPHelper->IsActive()) { if (NTPHelper && NTPHelper->IsActive()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment