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

Unified Diff: ios/chrome/test/app/chrome_test_util.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/app/bookmarks_test_util.mm ('k') | ios/chrome/test/app/chrome_test_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/test/app/chrome_test_util.h
diff --git a/ios/chrome/test/app/chrome_test_util.h b/ios/chrome/test/app/chrome_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed9588514ec1f229923e5a113e265f8b75f4e1d0
--- /dev/null
+++ b/ios/chrome/test/app/chrome_test_util.h
@@ -0,0 +1,91 @@
+// 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_APP_CHROME_TEST_UTIL_H_
+#define IOS_CHROME_TEST_APP_CHROME_TEST_UTIL_H_
+
+#include "base/ios/block_types.h"
+#import "ios/web/public/web_state/web_state.h"
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+@class DeviceSharingManager;
+@class GenericChromeCommand;
+@class MainController;
+@class NewTabPageController;
+
+namespace chrome_test_util {
+
+// Returns the main controller.
+MainController* GetMainController();
+
+// Returns the DeviceSharingManager object.
+DeviceSharingManager* GetDeviceSharingManager();
+
+// Returns the |NewTabPageController| of the current tab if the current tab is
+// a new tab and nil otherwise.
+NewTabPageController* GetCurrentNewTabPageController();
+
+// Returns the current WebState.
+web::WebState* GetCurrentWebState();
+
+// Returns the current, non-incognito ChromeBrowserState.
+ios::ChromeBrowserState* GetOriginalBrowserState();
+
+// Returns the current incognito ChromeBrowserState
+ios::ChromeBrowserState* GetCurrentIncognitoBrowserState();
+
+// Returns the number of key commands currently registered with the main BVC.
+NSUInteger GetRegisteredKeyCommandsCount();
+
+// Runs |command| using the active view controller.
+void RunCommandWithActiveViewController(GenericChromeCommand* command);
+
+// Removes all presented infobars.
+void RemoveAllInfoBars();
+
+// Dismisses all presented views and modal dialogs.
+void ClearPresentedState();
+
+// Purges and recreates all web views.
+void ResetAllWebViews();
+
+// Sets the value of a boolean local state pref.
+// TODO(crbug.com/647022): Clean up other tests that use this helper function.
+void SetBooleanLocalStatePref(const char* pref_name, bool value);
+
+// Sets the value of a boolean user pref in the given browser state.
+void SetBooleanUserPref(ios::ChromeBrowserState* browser_state,
+ const char* pref_name,
+ bool value);
+
+// Sets the state of using cellular network.
+void SetWWANStateTo(bool value);
+
+// Sets the state of first launch.
+void SetFirstLaunchStateTo(bool value);
+
+// Check whether metrics recording is enabled or not.
+bool IsMetricsRecordingEnabled();
+
+// Check whether metrics reporting is enabled or not.
+bool IsMetricsReportingEnabled();
+
+// Check whether breakpad recording is enabled or not.
+bool IsBreakpadEnabled();
+
+// Check whether breakpad reporting is enabled or not.
+bool IsBreakpadReportingEnabled();
+
+// Check whether this is the first launch after upgrade or not.
+bool IsFirstLaunchAfterUpgrade();
+
+// Simulate launching Chrome from another application.
+void OpenChromeFromExternalApp(const GURL& url);
+
+} // namespace chrome_test_util
+
+#endif // IOS_CHROME_TEST_APP_CHROME_TEST_UTIL_H_
« no previous file with comments | « ios/chrome/test/app/bookmarks_test_util.mm ('k') | ios/chrome/test/app/chrome_test_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698