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

Unified Diff: ios/showcase/test/showcase_test_case.mm

Issue 2592593003: Upstream ios/showcase source code. (Closed)
Patch Set: Created 4 years 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 | « ios/showcase/test/showcase_test_case.h ('k') | ios/showcase/uikit_table_view_cell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/showcase/test/showcase_test_case.mm
diff --git a/ios/showcase/test/showcase_test_case.mm b/ios/showcase/test/showcase_test_case.mm
new file mode 100644
index 0000000000000000000000000000000000000000..e4877f11f752c2f49acdf50c1365ed9b58d52c2a
--- /dev/null
+++ b/ios/showcase/test/showcase_test_case.mm
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/showcase/test/showcase_test_case.h"
+
+#import <EarlGrey/EarlGrey.h>
+
+#import "base/logging.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation ShowcaseTestCase
+
+// Overrides testInvocations so the set of tests run can be modified, as
+// necessary.
++ (NSArray*)testInvocations {
+ NSError* error = nil;
+ [[EarlGrey selectElementWithMatcher:grey_systemAlertViewShown()]
+ assertWithMatcher:grey_nil()
+ error:&error];
+ if (error != nil) {
+ LOG(ERROR) << "System alert view is present, so skipping all tests.";
+ return @[];
+ }
+ return [super testInvocations];
+}
+
+@end
« no previous file with comments | « ios/showcase/test/showcase_test_case.h ('k') | ios/showcase/uikit_table_view_cell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698