OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chrome_browsing_data_remover_delegate.h" | 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
6 | 6 |
| 7 #include <cstdint> |
| 8 |
7 #include "base/guid.h" | 9 #include "base/guid.h" |
8 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
14 #include "base/test/scoped_feature_list.h" | 16 #include "base/test/scoped_feature_list.h" |
15 #include "base/time/time.h" | 17 #include "base/time/time.h" |
16 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 18 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool get_cookie_success_ = false; | 228 bool get_cookie_success_ = false; |
227 base::Closure quit_closure_; | 229 base::Closure quit_closure_; |
228 | 230 |
229 // CookieStore must out live |this|. | 231 // CookieStore must out live |this|. |
230 net::CookieStore* cookie_store_ = nullptr; | 232 net::CookieStore* cookie_store_ = nullptr; |
231 | 233 |
232 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); | 234 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); |
233 }; | 235 }; |
234 | 236 |
235 void RunClosureAfterCookiesCleared(const base::Closure& task, | 237 void RunClosureAfterCookiesCleared(const base::Closure& task, |
236 int cookies_deleted) { | 238 uint32_t cookies_deleted) { |
237 task.Run(); | 239 task.Run(); |
238 } | 240 } |
239 | 241 |
240 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { | 242 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { |
241 public: | 243 public: |
242 RemoveSafeBrowsingCookieTester() | 244 RemoveSafeBrowsingCookieTester() |
243 : browser_process_(TestingBrowserProcess::GetGlobal()) { | 245 : browser_process_(TestingBrowserProcess::GetGlobal()) { |
244 scoped_refptr<safe_browsing::SafeBrowsingService> sb_service = | 246 scoped_refptr<safe_browsing::SafeBrowsingService> sb_service = |
245 safe_browsing::SafeBrowsingService::CreateSafeBrowsingService(); | 247 safe_browsing::SafeBrowsingService::CreateSafeBrowsingService(); |
246 browser_process_->SetSafeBrowsingService(sb_service.get()); | 248 browser_process_->SetSafeBrowsingService(sb_service.get()); |
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 base::Callback<bool(const GURL&)> origin_filter; | 2318 base::Callback<bool(const GURL&)> origin_filter; |
2317 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); | 2319 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); |
2318 | 2320 |
2319 EXPECT_EQ(1, remove_count); | 2321 EXPECT_EQ(1, remove_count); |
2320 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | | 2322 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | |
2321 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, | 2323 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, |
2322 data_type_mask); | 2324 data_type_mask); |
2323 EXPECT_TRUE( | 2325 EXPECT_TRUE( |
2324 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); | 2326 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); |
2325 } | 2327 } |
OLD | NEW |