OLD | NEW |
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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 base::Closure quit_closure_; | 337 base::Closure quit_closure_; |
338 net::CookieStore* cookie_store_ = nullptr; | 338 net::CookieStore* cookie_store_ = nullptr; |
339 | 339 |
340 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); | 340 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); |
341 }; | 341 }; |
342 | 342 |
343 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { | 343 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { |
344 public: | 344 public: |
345 RemoveSafeBrowsingCookieTester() | 345 RemoveSafeBrowsingCookieTester() |
346 : browser_process_(TestingBrowserProcess::GetGlobal()) { | 346 : browser_process_(TestingBrowserProcess::GetGlobal()) { |
347 scoped_refptr<SafeBrowsingService> sb_service = | 347 scoped_refptr<safe_browsing::SafeBrowsingService> sb_service = |
348 SafeBrowsingService::CreateSafeBrowsingService(); | 348 safe_browsing::SafeBrowsingService::CreateSafeBrowsingService(); |
349 browser_process_->SetSafeBrowsingService(sb_service.get()); | 349 browser_process_->SetSafeBrowsingService(sb_service.get()); |
350 sb_service->Initialize(); | 350 sb_service->Initialize(); |
351 base::MessageLoop::current()->RunUntilIdle(); | 351 base::MessageLoop::current()->RunUntilIdle(); |
352 | 352 |
353 // Create a cookiemonster that does not have persistant storage, and replace | 353 // Create a cookiemonster that does not have persistant storage, and replace |
354 // the SafeBrowsingService created one with it. | 354 // the SafeBrowsingService created one with it. |
355 net::CookieStore* monster = | 355 net::CookieStore* monster = |
356 content::CreateCookieStore(content::CookieStoreConfig()); | 356 content::CreateCookieStore(content::CookieStoreConfig()); |
357 sb_service->url_request_context()->GetURLRequestContext()-> | 357 sb_service->url_request_context()->GetURLRequestContext()-> |
358 set_cookie_store(monster); | 358 set_cookie_store(monster); |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 TEST_F(BrowsingDataRemoverTest, RemoveSameOriginDownloads) { | 2109 TEST_F(BrowsingDataRemoverTest, RemoveSameOriginDownloads) { |
2110 RemoveDownloadsTester tester(GetProfile()); | 2110 RemoveDownloadsTester tester(GetProfile()); |
2111 const url::Origin expectedOrigin(kOrigin1); | 2111 const url::Origin expectedOrigin(kOrigin1); |
2112 | 2112 |
2113 EXPECT_CALL(*tester.download_manager(), | 2113 EXPECT_CALL(*tester.download_manager(), |
2114 RemoveDownloadsByOriginAndTime(SameOrigin(expectedOrigin), _, _)); | 2114 RemoveDownloadsByOriginAndTime(SameOrigin(expectedOrigin), _, _)); |
2115 | 2115 |
2116 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, | 2116 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, |
2117 BrowsingDataRemover::REMOVE_DOWNLOADS, kOrigin1); | 2117 BrowsingDataRemover::REMOVE_DOWNLOADS, kOrigin1); |
2118 } | 2118 } |
OLD | NEW |