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

Side by Side Diff: ios/showcase/test/showcase_test_case.mm

Issue 2789433004: Add tools for code coverage support in iOS. (Closed)
Patch Set: Rebased Created 3 years, 7 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 | « ios/showcase/test/BUILD.gn ('k') | testing/coverage_util_ios.h » ('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 "ios/showcase/test/showcase_test_case.h" 5 #import "ios/showcase/test/showcase_test_case.h"
6 6
7 #import <EarlGrey/EarlGrey.h> 7 #import <EarlGrey/EarlGrey.h>
8 8
9 #import "base/logging.h" 9 #import "base/logging.h"
10 #include "testing/coverage_util_ios.h"
10 11
11 #if !defined(__has_feature) || !__has_feature(objc_arc) 12 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support." 13 #error "This file requires ARC support."
13 #endif 14 #endif
14 15
15 @implementation ShowcaseTestCase 16 @implementation ShowcaseTestCase
16 17
18 + (void)setUp {
19 coverage_util::ConfigureCoverageReportPath();
20 }
21
17 // Overrides testInvocations so the set of tests run can be modified, as 22 // Overrides testInvocations so the set of tests run can be modified, as
18 // necessary. 23 // necessary.
19 + (NSArray*)testInvocations { 24 + (NSArray*)testInvocations {
20 NSError* error = nil; 25 NSError* error = nil;
21 [[EarlGrey selectElementWithMatcher:grey_systemAlertViewShown()] 26 [[EarlGrey selectElementWithMatcher:grey_systemAlertViewShown()]
22 assertWithMatcher:grey_nil() 27 assertWithMatcher:grey_nil()
23 error:&error]; 28 error:&error];
24 if (error != nil) { 29 if (error != nil) {
25 LOG(ERROR) << "System alert view is present, so skipping all tests."; 30 LOG(ERROR) << "System alert view is present, so skipping all tests.";
26 return @[]; 31 return @[];
27 } 32 }
28 return [super testInvocations]; 33 return [super testInvocations];
29 } 34 }
30 35
31 @end 36 @end
OLDNEW
« no previous file with comments | « ios/showcase/test/BUILD.gn ('k') | testing/coverage_util_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698