| OLD | NEW |
| 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 <UIKit/UIKit.h> | 6 #import <UIKit/UIKit.h> |
| 7 #import <XCTest/XCTest.h> | 7 #import <XCTest/XCTest.h> |
| 8 | 8 |
| 9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // Make sure that the "example.com" exception is listed. | 267 // Make sure that the "example.com" exception is listed. |
| 268 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( | 268 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( |
| 269 allowedPattern))] | 269 allowedPattern))] |
| 270 assertWithMatcher:grey_sufficientlyVisible()]; | 270 assertWithMatcher:grey_sufficientlyVisible()]; |
| 271 | 271 |
| 272 // Toggle the switch off via the UI and make sure the exceptions are not | 272 // Toggle the switch off via the UI and make sure the exceptions are not |
| 273 // visible. | 273 // visible. |
| 274 [[EarlGrey | 274 [[EarlGrey |
| 275 selectElementWithMatcher:chrome_test_util::CollectionViewSwitchCell( | 275 selectElementWithMatcher:chrome_test_util::CollectionViewSwitchCell( |
| 276 @"blockPopupsContentView_switch", YES)] | 276 @"blockPopupsContentView_switch", YES)] |
| 277 performAction:chrome_test_util::turnCollectionViewSwitchOn(NO)]; | 277 performAction:chrome_test_util::TurnCollectionViewSwitchOn(NO)]; |
| 278 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( | 278 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( |
| 279 allowedPattern))] | 279 allowedPattern))] |
| 280 assertWithMatcher:grey_notVisible()]; | 280 assertWithMatcher:grey_notVisible()]; |
| 281 [[EarlGrey | 281 [[EarlGrey |
| 282 selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( | 282 selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( |
| 283 IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON))] | 283 IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON))] |
| 284 assertWithMatcher:grey_notVisible()]; | 284 assertWithMatcher:grey_notVisible()]; |
| 285 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] | 285 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] |
| 286 assertWithMatcher:grey_sufficientlyVisible()]; | 286 assertWithMatcher:grey_sufficientlyVisible()]; |
| 287 | 287 |
| 288 // Toggle the switch back on via the UI and make sure the exceptions are now | 288 // Toggle the switch back on via the UI and make sure the exceptions are now |
| 289 // visible. | 289 // visible. |
| 290 [[EarlGrey | 290 [[EarlGrey |
| 291 selectElementWithMatcher:chrome_test_util::CollectionViewSwitchCell( | 291 selectElementWithMatcher:chrome_test_util::CollectionViewSwitchCell( |
| 292 @"blockPopupsContentView_switch", NO)] | 292 @"blockPopupsContentView_switch", NO)] |
| 293 performAction:chrome_test_util::turnCollectionViewSwitchOn(YES)]; | 293 performAction:chrome_test_util::TurnCollectionViewSwitchOn(YES)]; |
| 294 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( | 294 [[EarlGrey selectElementWithMatcher:grey_text(base::SysUTF8ToNSString( |
| 295 allowedPattern))] | 295 allowedPattern))] |
| 296 assertWithMatcher:grey_sufficientlyVisible()]; | 296 assertWithMatcher:grey_sufficientlyVisible()]; |
| 297 [[EarlGrey | 297 [[EarlGrey |
| 298 selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( | 298 selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( |
| 299 IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON))] | 299 IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON))] |
| 300 assertWithMatcher:grey_sufficientlyVisible()]; | 300 assertWithMatcher:grey_sufficientlyVisible()]; |
| 301 | 301 |
| 302 CloseSettings(); | 302 CloseSettings(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 @end | 305 @end |
| OLD | NEW |