OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/showcase/test/showcase_test_case.h" |
| 6 |
| 7 #import <EarlGrey/EarlGrey.h> |
| 8 |
| 9 #import "base/logging.h" |
| 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." |
| 13 #endif |
| 14 |
| 15 @implementation ShowcaseTestCase |
| 16 |
| 17 // Overrides testInvocations so the set of tests run can be modified, as |
| 18 // necessary. |
| 19 + (NSArray*)testInvocations { |
| 20 NSError* error = nil; |
| 21 [[EarlGrey selectElementWithMatcher:grey_systemAlertViewShown()] |
| 22 assertWithMatcher:grey_nil() |
| 23 error:&error]; |
| 24 if (error != nil) { |
| 25 LOG(ERROR) << "System alert view is present, so skipping all tests."; |
| 26 return @[]; |
| 27 } |
| 28 return [super testInvocations]; |
| 29 } |
| 30 |
| 31 @end |
OLD | NEW |