OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void SetClearingFinished(bool finished) { finished_ = finished; } | 496 void SetClearingFinished(bool finished) { finished_ = finished; } |
497 | 497 |
498 bool IsClearingFinished() { return finished_; } | 498 bool IsClearingFinished() { return finished_; } |
499 | 499 |
500 private: | 500 private: |
501 static std::unique_ptr<KeyedService> GetRemover( | 501 static std::unique_ptr<KeyedService> GetRemover( |
502 content::BrowserContext* context) { | 502 content::BrowserContext* context) { |
503 return base::WrapUnique(new MockBrowsingDataRemover(context)); | 503 return base::WrapUnique(new MockBrowsingDataRemover(context)); |
504 } | 504 } |
505 | 505 |
506 base::MessageLoop loop_; | 506 content::TestBrowserThreadBundle thread_bundle_; |
507 TestingProfile profile_; | 507 TestingProfile profile_; |
508 bool finished_; | 508 bool finished_; |
509 }; | 509 }; |
510 | 510 |
511 // Tests that the parameters to ClearBrowsingData() are translated to | 511 // Tests that the parameters to ClearBrowsingData() are translated to |
512 // the correct BrowsingDataRemover::RemoveInternal() operation. The fourth | 512 // the correct BrowsingDataRemover::RemoveInternal() operation. The fourth |
513 // parameter, |filter_builder|, is tested in detail in the RegistrableDomains | 513 // parameter, |filter_builder|, is tested in detail in the RegistrableDomains |
514 // test below. | 514 // test below. |
515 TEST_F(ChromeContentBrowserClientClearSiteDataTest, Parameters) { | 515 TEST_F(ChromeContentBrowserClientClearSiteDataTest, Parameters) { |
516 ChromeContentBrowserClient client; | 516 ChromeContentBrowserClient client; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 client.ClearSiteData( | 707 client.ClearSiteData( |
708 profile(), origin, true /* cookies */, false /* storage */, | 708 profile(), origin, true /* cookies */, false /* storage */, |
709 true /* cache */, | 709 true /* cache */, |
710 base::Bind( | 710 base::Bind( |
711 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, | 711 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, |
712 base::Unretained(this), true)); | 712 base::Unretained(this), true)); |
713 EXPECT_TRUE(IsClearingFinished()); | 713 EXPECT_TRUE(IsClearingFinished()); |
714 } | 714 } |
715 | 715 |
716 } // namespace | 716 } // namespace |
OLD | NEW |