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 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ | 5 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ |
6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ | 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ |
7 | 7 |
8 #import <XCTest/XCTest.h> | 8 #import <XCTest/XCTest.h> |
9 | 9 |
10 #import "base/ios/block_types.h" | 10 #import "base/ios/block_types.h" |
| 11 #import "ios/testing/earl_grey/disabled_test_macros.h" |
11 | 12 |
12 // Base class for all Chrome Earl Grey tests. | 13 // Base class for all Chrome Earl Grey tests. |
13 @interface ChromeTestCase : XCTestCase | 14 @interface ChromeTestCase : XCTestCase |
14 | 15 |
15 // Sets a block to always be executed at the end of a test during tearDown, | 16 // Sets a block to always be executed at the end of a test during tearDown, |
16 // whether the test passes or fails. This shall only be set once per test. | 17 // whether the test passes or fails. This shall only be set once per test. |
17 - (void)setTearDownHandler:(ProceduralBlock)tearDownHandler; | 18 - (void)setTearDownHandler:(ProceduralBlock)tearDownHandler; |
18 | 19 |
19 // Removes any UI elements that are present, to ensure it is in a clean state. | 20 // Removes any UI elements that are present, to ensure it is in a clean state. |
20 + (void)removeAnyOpenMenusAndInfoBars; | 21 + (void)removeAnyOpenMenusAndInfoBars; |
21 | 22 |
22 // Closes all tabs, and waits for the UI to synchronize. | 23 // Closes all tabs, and waits for the UI to synchronize. |
23 + (void)closeAllTabs; | 24 + (void)closeAllTabs; |
24 | 25 |
25 // Turns off mock authentication. It will automatically be re-enabled at the | 26 // Turns off mock authentication. It will automatically be re-enabled at the |
26 // end of the test. This shall only be called once per test. | 27 // end of the test. This shall only be called once per test. |
27 - (void)disableMockAuthentication; | 28 - (void)disableMockAuthentication; |
28 | 29 |
29 // Stops the HTTP server. It will be re-started at the end of the test. This | 30 // Stops the HTTP server. It will be re-started at the end of the test. This |
30 // should only be called when the HTTP server is running. This shall only be | 31 // should only be called when the HTTP server is running. This shall only be |
31 // called once per test. | 32 // called once per test. |
32 - (void)stopHTTPServer; | 33 - (void)stopHTTPServer; |
33 | 34 |
34 @end | 35 @end |
35 | 36 |
36 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ | 37 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_TEST_CASE_H_ |
OLD | NEW |