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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged to ToT Created 7 years, 5 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
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 "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool get_cookie_success_; 218 bool get_cookie_success_;
219 AwaitCompletionHelper await_completion_; 219 AwaitCompletionHelper await_completion_;
220 net::CookieStore* monster_; 220 net::CookieStore* monster_;
221 221
222 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); 222 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester);
223 }; 223 };
224 224
225 class RemoveProfileCookieTester : public RemoveCookieTester { 225 class RemoveProfileCookieTester : public RemoveCookieTester {
226 public: 226 public:
227 explicit RemoveProfileCookieTester(TestingProfile* profile) { 227 explicit RemoveProfileCookieTester(TestingProfile* profile) {
228 profile->CreateRequestContext();
229 SetMonster(profile->GetRequestContext()->GetURLRequestContext()-> 228 SetMonster(profile->GetRequestContext()->GetURLRequestContext()->
230 cookie_store()->GetCookieMonster()); 229 cookie_store()->GetCookieMonster());
231 } 230 }
232 }; 231 };
233 232
234 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 233 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING)
235 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { 234 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester {
236 public: 235 public:
237 RemoveSafeBrowsingCookieTester() 236 RemoveSafeBrowsingCookieTester()
238 : browser_process_(TestingBrowserProcess::GetGlobal()) { 237 : browser_process_(TestingBrowserProcess::GetGlobal()) {
(...skipping 21 matching lines...) Expand all
260 TestingBrowserProcess* browser_process_; 259 TestingBrowserProcess* browser_process_;
261 260
262 DISALLOW_COPY_AND_ASSIGN(RemoveSafeBrowsingCookieTester); 261 DISALLOW_COPY_AND_ASSIGN(RemoveSafeBrowsingCookieTester);
263 }; 262 };
264 #endif 263 #endif
265 264
266 class RemoveServerBoundCertTester : public net::SSLConfigService::Observer { 265 class RemoveServerBoundCertTester : public net::SSLConfigService::Observer {
267 public: 266 public:
268 explicit RemoveServerBoundCertTester(TestingProfile* profile) 267 explicit RemoveServerBoundCertTester(TestingProfile* profile)
269 : ssl_config_changed_count_(0) { 268 : ssl_config_changed_count_(0) {
270 profile->CreateRequestContext();
271 server_bound_cert_service_ = profile->GetRequestContext()-> 269 server_bound_cert_service_ = profile->GetRequestContext()->
272 GetURLRequestContext()->server_bound_cert_service(); 270 GetURLRequestContext()->server_bound_cert_service();
273 ssl_config_service_ = profile->GetSSLConfigService(); 271 ssl_config_service_ = profile->GetSSLConfigService();
274 ssl_config_service_->AddObserver(this); 272 ssl_config_service_->AddObserver(this);
275 } 273 }
276 274
277 virtual ~RemoveServerBoundCertTester() { 275 virtual ~RemoveServerBoundCertTester() {
278 ssl_config_service_->RemoveObserver(this); 276 ssl_config_service_->RemoveObserver(this);
279 } 277 }
280 278
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 BlockUntilBrowsingDataRemoved( 1375 BlockUntilBrowsingDataRemoved(
1378 BrowsingDataRemover::LAST_HOUR, 1376 BrowsingDataRemover::LAST_HOUR,
1379 BrowsingDataRemover::REMOVE_HISTORY, false); 1377 BrowsingDataRemover::REMOVE_HISTORY, false);
1380 1378
1381 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); 1379 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask());
1382 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); 1380 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask());
1383 EXPECT_TRUE(tester.HasOrigin(std::string())); 1381 EXPECT_TRUE(tester.HasOrigin(std::string()));
1384 EXPECT_FALSE(tester.HasOrigin(kWebOrigin)); 1382 EXPECT_FALSE(tester.HasOrigin(kWebOrigin));
1385 EXPECT_TRUE(tester.HasOrigin(kChromeOrigin)); 1383 EXPECT_TRUE(tester.HasOrigin(kChromeOrigin));
1386 } 1384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698