OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const BookmarkNode* node) {} | 107 const BookmarkNode* node) {} |
108 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, | 108 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
109 const BookmarkNode* node) {} | 109 const BookmarkNode* node) {} |
110 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 110 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
111 const BookmarkNode* node) {} | 111 const BookmarkNode* node) {} |
112 | 112 |
113 private: | 113 private: |
114 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); | 114 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); |
115 }; | 115 }; |
116 | 116 |
117 class TestExtensionURLRequestContext : public URLRequestContext { | 117 class TestExtensionURLRequestContext : public net::URLRequestContext { |
118 public: | 118 public: |
119 TestExtensionURLRequestContext() { | 119 TestExtensionURLRequestContext() { |
120 net::CookieMonster* cookie_monster = new net::CookieMonster(NULL, NULL); | 120 net::CookieMonster* cookie_monster = new net::CookieMonster(NULL, NULL); |
121 const char* schemes[] = {chrome::kExtensionScheme}; | 121 const char* schemes[] = {chrome::kExtensionScheme}; |
122 cookie_monster->SetCookieableSchemes(schemes, 1); | 122 cookie_monster->SetCookieableSchemes(schemes, 1); |
123 cookie_store_ = cookie_monster; | 123 cookie_store_ = cookie_monster; |
124 } | 124 } |
125 }; | 125 }; |
126 | 126 |
127 class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { | 127 class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { |
128 public: | 128 public: |
129 virtual URLRequestContext* GetURLRequestContext() { | 129 virtual net::URLRequestContext* GetURLRequestContext() { |
130 if (!context_) | 130 if (!context_) |
131 context_ = new TestExtensionURLRequestContext(); | 131 context_ = new TestExtensionURLRequestContext(); |
132 return context_.get(); | 132 return context_.get(); |
133 } | 133 } |
134 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { | 134 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { |
135 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 135 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
136 } | 136 } |
137 | 137 |
138 private: | 138 private: |
139 scoped_refptr<URLRequestContext> context_; | 139 scoped_refptr<net::URLRequestContext> context_; |
140 }; | 140 }; |
141 | 141 |
142 } // namespace | 142 } // namespace |
143 | 143 |
144 TestingProfile::TestingProfile() | 144 TestingProfile::TestingProfile() |
145 : start_time_(Time::Now()), | 145 : start_time_(Time::Now()), |
146 testing_prefs_(NULL), | 146 testing_prefs_(NULL), |
147 created_theme_provider_(false), | 147 created_theme_provider_(false), |
148 has_history_service_(false), | 148 has_history_service_(false), |
149 off_the_record_(false), | 149 off_the_record_(false), |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 517 } |
518 return profile_sync_service_.get(); | 518 return profile_sync_service_.get(); |
519 } | 519 } |
520 | 520 |
521 void TestingProfile::DestroyWebDataService() { | 521 void TestingProfile::DestroyWebDataService() { |
522 if (!web_data_service_.get()) | 522 if (!web_data_service_.get()) |
523 return; | 523 return; |
524 | 524 |
525 web_data_service_->Shutdown(); | 525 web_data_service_->Shutdown(); |
526 } | 526 } |
OLD | NEW |