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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bool get_cookie_success_; | 216 bool get_cookie_success_; |
217 AwaitCompletionHelper await_completion_; | 217 AwaitCompletionHelper await_completion_; |
218 net::CookieStore* monster_; | 218 net::CookieStore* monster_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); | 220 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); |
221 }; | 221 }; |
222 | 222 |
223 class RemoveProfileCookieTester : public RemoveCookieTester { | 223 class RemoveProfileCookieTester : public RemoveCookieTester { |
224 public: | 224 public: |
225 explicit RemoveProfileCookieTester(TestingProfile* profile) { | 225 explicit RemoveProfileCookieTester(TestingProfile* profile) { |
226 profile->CreateRequestContext(); | |
227 SetMonster(profile->GetRequestContext()->GetURLRequestContext()-> | 226 SetMonster(profile->GetRequestContext()->GetURLRequestContext()-> |
228 cookie_store()->GetCookieMonster()); | 227 cookie_store()->GetCookieMonster()); |
229 } | 228 } |
230 }; | 229 }; |
231 | 230 |
232 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 231 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
233 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { | 232 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { |
234 public: | 233 public: |
235 RemoveSafeBrowsingCookieTester() | 234 RemoveSafeBrowsingCookieTester() |
236 : browser_process_(TestingBrowserProcess::GetGlobal()) { | 235 : browser_process_(TestingBrowserProcess::GetGlobal()) { |
(...skipping 21 matching lines...) Expand all Loading... |
258 TestingBrowserProcess* browser_process_; | 257 TestingBrowserProcess* browser_process_; |
259 | 258 |
260 DISALLOW_COPY_AND_ASSIGN(RemoveSafeBrowsingCookieTester); | 259 DISALLOW_COPY_AND_ASSIGN(RemoveSafeBrowsingCookieTester); |
261 }; | 260 }; |
262 #endif | 261 #endif |
263 | 262 |
264 class RemoveServerBoundCertTester : public net::SSLConfigService::Observer { | 263 class RemoveServerBoundCertTester : public net::SSLConfigService::Observer { |
265 public: | 264 public: |
266 explicit RemoveServerBoundCertTester(TestingProfile* profile) | 265 explicit RemoveServerBoundCertTester(TestingProfile* profile) |
267 : ssl_config_changed_count_(0) { | 266 : ssl_config_changed_count_(0) { |
268 profile->CreateRequestContext(); | |
269 server_bound_cert_service_ = profile->GetRequestContext()-> | 267 server_bound_cert_service_ = profile->GetRequestContext()-> |
270 GetURLRequestContext()->server_bound_cert_service(); | 268 GetURLRequestContext()->server_bound_cert_service(); |
271 ssl_config_service_ = profile->GetSSLConfigService(); | 269 ssl_config_service_ = profile->GetSSLConfigService(); |
272 ssl_config_service_->AddObserver(this); | 270 ssl_config_service_->AddObserver(this); |
273 } | 271 } |
274 | 272 |
275 virtual ~RemoveServerBoundCertTester() { | 273 virtual ~RemoveServerBoundCertTester() { |
276 ssl_config_service_->RemoveObserver(this); | 274 ssl_config_service_->RemoveObserver(this); |
277 } | 275 } |
278 | 276 |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 BlockUntilBrowsingDataRemoved( | 1373 BlockUntilBrowsingDataRemoved( |
1376 BrowsingDataRemover::LAST_HOUR, | 1374 BrowsingDataRemover::LAST_HOUR, |
1377 BrowsingDataRemover::REMOVE_HISTORY, false); | 1375 BrowsingDataRemover::REMOVE_HISTORY, false); |
1378 | 1376 |
1379 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); | 1377 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); |
1380 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); | 1378 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); |
1381 EXPECT_TRUE(tester.HasOrigin(std::string())); | 1379 EXPECT_TRUE(tester.HasOrigin(std::string())); |
1382 EXPECT_FALSE(tester.HasOrigin(kWebOrigin)); | 1380 EXPECT_FALSE(tester.HasOrigin(kWebOrigin)); |
1383 EXPECT_TRUE(tester.HasOrigin(kChromeOrigin)); | 1381 EXPECT_TRUE(tester.HasOrigin(kChromeOrigin)); |
1384 } | 1382 } |
OLD | NEW |