Chromium Code Reviews| 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_EARL_GREY_H_ | 5 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
| 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ | 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
| 7 | 7 |
| 8 #import <EarlGrey/EarlGrey.h> | 8 #import <EarlGrey/EarlGrey.h> |
| 9 | 9 |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace chrome_test_util { | 12 namespace chrome_test_util { |
| 13 | 13 |
| 14 // TODO(crbug.com/638674): Evaluate if this can move to shared code. | 14 // TODO(crbug.com/638674): Evaluate if this can move to shared code. |
| 15 // Execute |javascript| on current web state, and wait for either the completion | 15 // Execute |javascript| on current web state, and wait for either the completion |
| 16 // of execution or timeout. If |out_error| is not nil, it is set to the | 16 // of execution or timeout. If |out_error| is not nil, it is set to the |
| 17 // error resulting from the execution, if one occurs. The return value is the | 17 // error resulting from the execution, if one occurs. The return value is the |
| 18 // result of the JavaScript execution. If the request is timed out, then nil is | 18 // result of the JavaScript execution. If the request is timed out, then nil is |
| 19 // returned. | 19 // returned. |
| 20 id ExecuteJavaScript(NSString* javascript, NSError** out_error); | 20 // TODO(crbug.com/690057): Remove __unsafe_unretained once all callers are |
| 21 // converted to ARC. | |
| 22 id ExecuteJavaScript(NSString* javascript, | |
|
sdefresne
2017/02/09 13:12:17
I think we'll need to keep the __unsafe_unretained
lody
2017/02/09 13:25:44
It actually seems ( https://clang.llvm.org/docs/Au
sdefresne
2017/02/09 13:49:23
Thank you for the pointer (though I think you mean
| |
| 23 NSError* __unsafe_unretained* out_error); | |
| 21 | 24 |
| 22 } // namespace chrome_test_util | 25 } // namespace chrome_test_util |
| 23 | 26 |
| 24 // Test methods that perform actions on Chrome. These methods may read or alter | 27 // Test methods that perform actions on Chrome. These methods may read or alter |
| 25 // Chrome's internal state programmatically or via the UI, but in both cases | 28 // Chrome's internal state programmatically or via the UI, but in both cases |
| 26 // will properly synchronize the UI for Earl Grey tests. | 29 // will properly synchronize the UI for Earl Grey tests. |
| 27 @interface ChromeEarlGrey : NSObject | 30 @interface ChromeEarlGrey : NSObject |
| 28 | 31 |
| 29 #pragma mark - History Utilities | 32 #pragma mark - History Utilities |
| 30 | 33 |
| 31 // Clears browsing history. | 34 // Clears browsing history. |
| 32 + (void)clearBrowsingHistory; | 35 + (void)clearBrowsingHistory; |
| 33 | 36 |
| 34 #pragma mark - Navigation Utilities | 37 #pragma mark - Navigation Utilities |
| 35 | 38 |
| 36 // Loads |URL| in the current WebState with transition of type | 39 // Loads |URL| in the current WebState with transition of type |
| 37 // ui::PAGE_TRANSITION_TYPED, and waits for the page to complete loading, or | 40 // ui::PAGE_TRANSITION_TYPED, and waits for the page to complete loading, or |
| 38 // a timeout. | 41 // a timeout. |
| 39 + (void)loadURL:(GURL)URL; | 42 + (void)loadURL:(GURL)URL; |
| 40 | 43 |
| 41 // Waits for the page to finish loading or a timeout. | 44 // Waits for the page to finish loading or a timeout. |
| 42 + (void)waitForPageToFinishLoading; | 45 + (void)waitForPageToFinishLoading; |
| 43 | 46 |
| 44 // Taps html element with |elementID| in the current web view. | 47 // Taps html element with |elementID| in the current web view. |
| 45 + (void)tapWebViewElementWithID:(NSString*)elementID; | 48 + (void)tapWebViewElementWithID:(NSString*)elementID; |
| 46 | 49 |
| 47 @end | 50 @end |
| 48 | 51 |
| 49 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ | 52 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
| OLD | NEW |