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

Unified Diff: ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h

Issue 2622913002: Simplify registration of a test ChromeBrowserStateManager. (Closed)
Patch Set: Fix typo in naming variable. Created 3 years, 11 months 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/BUILD.gn ('k') | ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h
diff --git a/ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h b/ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..da1d381e22eb015bae89c953512b75f5797594db
--- /dev/null
+++ b/ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h
@@ -0,0 +1,31 @@
+// Copyright 2017 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_IOS_CHROME_SCOPED_TESTING_CHROME_BROWSER_STATE_MANAGER_H_
+#define IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_CHROME_BROWSER_STATE_MANAGER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+
+namespace ios {
+class ChromeBrowserStateManager;
+}
+
+// Helper class to register an ios::ChromeBrowserStateManager against
+// the TestApplicationContext using local scoping to do proper cleanup.
+class IOSChromeScopedTestingChromeBrowserStateManager {
+ public:
+ explicit IOSChromeScopedTestingChromeBrowserStateManager(
+ std::unique_ptr<ios::ChromeBrowserStateManager> browser_state_manager);
+ ~IOSChromeScopedTestingChromeBrowserStateManager();
+
+ private:
+ std::unique_ptr<ios::ChromeBrowserStateManager> browser_state_manager_;
+ ios::ChromeBrowserStateManager* saved_browser_state_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSChromeScopedTestingChromeBrowserStateManager);
+};
+
+#endif // IOS_CHROME_TEST_IOS_CHROME_SCOPED_TESTING_CHROME_BROWSER_STATE_MANAGER_H_
« no previous file with comments | « ios/chrome/test/BUILD.gn ('k') | ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698