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

Unified Diff: ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.mm

Issue 1664823003: Upstream ChromeBrowserState sub-classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 10 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
Index: ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.mm
diff --git a/ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.mm b/ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.mm
new file mode 100644
index 0000000000000000000000000000000000000000..0f23ae5987e18625cbdff7b3e53da03c14a5df8c
--- /dev/null
+++ b/ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.mm
@@ -0,0 +1,44 @@
+// Copyright 2014 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.
+
+#include "ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.h"
+
+#include "base/logging.h"
+#include "components/syncable_prefs/pref_service_syncable.h"
+#include "ios/web/public/web_thread.h"
+#include "net/url_request/url_request_test_util.h"
+
+TestChromeBrowserStateWithIsolatedContext::
+ TestChromeBrowserStateWithIsolatedContext()
+ : TestChromeBrowserState(base::FilePath(),
+ scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
+ TestingFactories(),
+ RefcountedTestingFactories()),
+ main_context_called_(false),
+ request_context_(new net::TestURLRequestContextGetter(
+ web::WebThread::GetTaskRunnerForThread(web::WebThread::IO))) {}
+
+TestChromeBrowserStateWithIsolatedContext::
+ ~TestChromeBrowserStateWithIsolatedContext() {}
+
+bool TestChromeBrowserStateWithIsolatedContext::MainContextCalled() const {
+ return main_context_called_;
+}
+
+IOSWebViewFactoryExternalService
+TestChromeBrowserStateWithIsolatedContext::SharingService() {
+ return SSO_AUTHENTICATION;
+}
+
+net::URLRequestContextGetter*
+TestChromeBrowserStateWithIsolatedContext::GetRequestContext() {
+ main_context_called_ = true;
+ return TestChromeBrowserState::GetRequestContext();
+}
+
+net::URLRequestContextGetter*
+TestChromeBrowserStateWithIsolatedContext::CreateIsolatedRequestContext(
+ const base::FilePath& partition_path) {
+ return request_context_.get();
+}

Powered by Google App Engine
This is Rietveld 408576698