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

Side by Side Diff: content/test/test_browser_context.cc

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/test_browser_context.h ('k') | content/test/test_browser_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/test/test_browser_context.h" 5 #include "content/test/test_browser_context.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "content/browser/in_process_webkit/webkit_context.h" 8 #include "content/browser/in_process_webkit/webkit_context.h"
9 #include "content/browser/mock_resource_context.h" 9 #include "content/browser/mock_resource_context.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using content::DownloadManager; 12 using content::DownloadManager;
13 using content::HostZoomMap; 13 using content::HostZoomMap;
14 14
15 TestBrowserContext::TestBrowserContext() { 15 TestBrowserContext::TestBrowserContext() {
16 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir()); 16 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir());
17 } 17 }
18 18
19 TestBrowserContext::~TestBrowserContext() { 19 TestBrowserContext::~TestBrowserContext() {
20 } 20 }
21 21
22 FilePath TestBrowserContext::TakePath() {
23 return browser_context_dir_.Take();
24 }
25
22 FilePath TestBrowserContext::GetPath() { 26 FilePath TestBrowserContext::GetPath() {
23 return browser_context_dir_.path(); 27 return browser_context_dir_.path();
24 } 28 }
25 29
26 bool TestBrowserContext::IsOffTheRecord() { 30 bool TestBrowserContext::IsOffTheRecord() {
27 return false; 31 return false;
28 } 32 }
29 33
30 DownloadManager* TestBrowserContext::GetDownloadManager() { 34 DownloadManager* TestBrowserContext::GetDownloadManager() {
31 return NULL; 35 return NULL;
(...skipping 28 matching lines...) Expand all
60 64
61 content::SpeechInputPreferences* 65 content::SpeechInputPreferences*
62 TestBrowserContext::GetSpeechInputPreferences() { 66 TestBrowserContext::GetSpeechInputPreferences() {
63 return NULL; 67 return NULL;
64 } 68 }
65 69
66 bool TestBrowserContext::DidLastSessionExitCleanly() { 70 bool TestBrowserContext::DidLastSessionExitCleanly() {
67 return true; 71 return true;
68 } 72 }
69 73
70 quota::QuotaManager* TestBrowserContext::GetQuotaManager() { 74 quota::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() {
71 return NULL; 75 return NULL;
72 } 76 }
73
74 WebKitContext* TestBrowserContext::GetWebKitContext() {
75 if (webkit_context_ == NULL) {
76 webkit_context_ = new WebKitContext(
77 IsOffTheRecord(), GetPath(),
78 NULL, false, NULL, NULL);
79 }
80 return webkit_context_;
81 }
82
83 webkit_database::DatabaseTracker* TestBrowserContext::GetDatabaseTracker() {
84 return NULL;
85 }
86
87 ChromeBlobStorageContext* TestBrowserContext::GetBlobStorageContext() {
88 return NULL;
89 }
90
91 ChromeAppCacheService* TestBrowserContext::GetAppCacheService() {
92 return NULL;
93 }
94
95 fileapi::FileSystemContext* TestBrowserContext::GetFileSystemContext() {
96 return NULL;
97 }
OLDNEW
« no previous file with comments | « content/test/test_browser_context.h ('k') | content/test/test_browser_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698