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

Unified Diff: ios/chrome/test/earl_grey/chrome_earl_grey.h

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (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/chrome/test/earl_grey/chrome_assertions.mm ('k') | ios/chrome/test/earl_grey/chrome_earl_grey.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/test/earl_grey/chrome_earl_grey.h
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h
new file mode 100644
index 0000000000000000000000000000000000000000..f9ac0224b624cdb2a4b96fbe157b217a2942af9f
--- /dev/null
+++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -0,0 +1,49 @@
+// 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.
+
+#ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_
+#define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_
+
+#import <EarlGrey/EarlGrey.h>
+
+#include "url/gurl.h"
+
+namespace chrome_test_util {
+
+// TODO(crbug.com/638674): Evaluate if this can move to shared code.
+// Execute |javascript| on current web state, and wait for either the completion
+// of execution or timeout. If |out_error| is not nil, it is set to the
+// error resulting from the execution, if one occurs. The return value is the
+// result of the JavaScript execution. If the request is timed out, then nil is
+// returned.
+id ExecuteJavaScript(NSString* javascript, NSError** out_error);
+
+} // namespace chrome_test_util
+
+// Test methods that perform actions on Chrome. These methods may read or alter
+// Chrome's internal state programmatically or via the UI, but in both cases
+// will properly synchronize the UI for Earl Grey tests.
+@interface ChromeEarlGrey : NSObject
+
+#pragma mark - History Utilities
+
+// Clears browsing history.
++ (void)clearBrowsingHistory;
+
+#pragma mark - Navigation Utilities
+
+// Loads |URL| in the current WebState with transition of type
+// ui::PAGE_TRANSITION_TYPED, and waits for the page to complete loading, or
+// a timeout.
++ (void)loadURL:(GURL)URL;
+
+// Waits for the page to finish loading or a timeout.
++ (void)waitForPageToFinishLoading;
+
+// Taps html element with |elementID| in the current web view.
++ (void)tapWebViewElementWithID:(NSString*)elementID;
+
+@end
+
+#endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_assertions.mm ('k') | ios/chrome/test/earl_grey/chrome_earl_grey.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698