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 #import "ios/chrome/test/app/tab_test_util.h" | 9 #import "ios/chrome/test/app/tab_test_util.h" |
10 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" | 10 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" |
11 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 11 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
12 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 12 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 // Test case to verify that EarlGrey tests can be launched and perform basic UI | 18 // Test case to verify that EarlGrey tests can be launched and perform basic UI |
15 // interactions. | 19 // interactions. |
16 @interface SmokeTestCase : ChromeTestCase | 20 @interface SmokeTestCase : ChromeTestCase |
17 @end | 21 @end |
18 | 22 |
19 @implementation SmokeTestCase | 23 @implementation SmokeTestCase |
20 | 24 |
21 // Tests that the tools menu is tappable. | 25 // Tests that the tools menu is tappable. |
22 - (void)testTapToolsMenu { | 26 - (void)testTapToolsMenu { |
23 [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuButton()] | 27 [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuButton()] |
24 performAction:grey_tap()]; | 28 performAction:grey_tap()]; |
25 } | 29 } |
26 | 30 |
27 // Tests that a tab can be opened. | 31 // Tests that a tab can be opened. |
28 - (void)testOpenTab { | 32 - (void)testOpenTab { |
29 [ChromeEarlGreyUI openNewTab]; | 33 [ChromeEarlGreyUI openNewTab]; |
30 GREYAssertEqual(2, chrome_test_util::GetMainTabCount(), @"Expected 2 tabs."); | 34 GREYAssertEqual(2, chrome_test_util::GetMainTabCount(), @"Expected 2 tabs."); |
31 } | 35 } |
32 @end | 36 @end |
OLD | NEW |