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

Side by Side Diff: ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm

Issue 2733973002: Create shared matcher for navigation bar done button. (Closed)
Patch Set: remove sufficientlyVisible from shared matcher Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import <EarlGrey/EarlGrey.h> 5 #import <EarlGrey/EarlGrey.h>
6 #import <XCTest/XCTest.h> 6 #import <XCTest/XCTest.h>
7 7
8 #include "base/mac/bind_objc_block.h" 8 #include "base/mac/bind_objc_block.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 // TODO(crbug.com/640977): EarlGrey synchronize on some animations when a 630 // TODO(crbug.com/640977): EarlGrey synchronize on some animations when a
631 // page is loading. Need to handle synchronization manually for this test. 631 // page is loading. Need to handle synchronization manually for this test.
632 [[GREYConfiguration sharedInstance] 632 [[GREYConfiguration sharedInstance]
633 setValue:@(NO) 633 setValue:@(NO)
634 forConfigKey:kGREYConfigKeySynchronizationEnabled]; 634 forConfigKey:kGREYConfigKeySynchronizationEnabled];
635 OpenSettingsMenuUnsynced(); 635 OpenSettingsMenuUnsynced();
636 OpenSettingsSubMenuUnsynced(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY); 636 OpenSettingsSubMenuUnsynced(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY);
637 Wait(grey_accessibilityID(kPrivacyCollectionViewId), 637 Wait(grey_accessibilityID(kPrivacyCollectionViewId),
638 @"Privacy settings view."); 638 @"Privacy settings view.");
639 639
640 WaitAndTap(grey_accessibilityLabel( 640 WaitAndTap(chrome_test_util::NavigationBarDoneButton(), @"Close settings");
641 l10n_util::GetNSString(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)),
642 @"Close settings");
643 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; 641 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
644 [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText( 642 [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
645 responses[slowURL])] 643 responses[slowURL])]
646 assertWithMatcher:grey_notNil()]; 644 assertWithMatcher:grey_notNil()];
647 645
648 [[GREYConfiguration sharedInstance] 646 [[GREYConfiguration sharedInstance]
649 setValue:@(YES) 647 setValue:@(YES)
650 forConfigKey:kGREYConfigKeySynchronizationEnabled]; 648 forConfigKey:kGREYConfigKeySynchronizationEnabled];
651 649
652 histogramTester.ExpectBucketCount(kDidUserWaitForEvictedTabReload, 650 histogramTester.ExpectBucketCount(kDidUserWaitForEvictedTabReload,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; 937 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
940 } 938 }
941 // The deleted tabs are purged during foregrounding and backgrounding. 939 // The deleted tabs are purged during foregrounding and backgrounding.
942 chrome_test_util::SimulateTabsBackgrounding(); 940 chrome_test_util::SimulateTabsBackgrounding();
943 // Make sure |evicted_tabs_| purged the deleted tabs. 941 // Make sure |evicted_tabs_| purged the deleted tabs.
944 int evicted = chrome_test_util::GetEvictedMainTabCount(); 942 int evicted = chrome_test_util::GetEvictedMainTabCount();
945 GREYAssertEqual(evicted, 0, @"Check number of evicted tabs"); 943 GREYAssertEqual(evicted, 0, @"Check number of evicted tabs");
946 } 944 }
947 945
948 @end 946 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/dialogs/javascript_dialog_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698