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

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

Issue 2351113005: [Reland] Refactor WebappRegistry into a singleton instance. (Closed)
Patch Set: Checkstyle import order has changed overnight argh Created 4 years, 2 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
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); 312 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition);
313 }; 313 };
314 314
315 #if BUILDFLAG(ANDROID_JAVA_UI) 315 #if BUILDFLAG(ANDROID_JAVA_UI)
316 class TestWebappRegistry : public WebappRegistry { 316 class TestWebappRegistry : public WebappRegistry {
317 public: 317 public:
318 TestWebappRegistry() : WebappRegistry() { } 318 TestWebappRegistry() : WebappRegistry() { }
319 319
320 void UnregisterWebappsForUrls( 320 void UnregisterWebappsForUrls(
321 const base::Callback<bool(const GURL&)>& url_filter, 321 const base::Callback<bool(const GURL&)>& url_filter) override {
322 const base::Closure& callback) override { 322 // Mocks out a JNI call.
323 // Mocks out a JNI call and runs the callback as a delayed task.
324 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback,
325 base::TimeDelta::FromMilliseconds(10));
326 } 323 }
327 324
328 void ClearWebappHistoryForUrls( 325 void ClearWebappHistoryForUrls(
329 const base::Callback<bool(const GURL&)>& url_filter, 326 const base::Callback<bool(const GURL&)>& url_filter) override {
330 const base::Closure& callback) override { 327 // Mocks out a JNI call.
331 // Mocks out a JNI call and runs the callback as a delayed task.
332 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback,
333 base::TimeDelta::FromMilliseconds(10));
334 } 328 }
335 }; 329 };
336 #endif 330 #endif
337 331
338 // Custom matcher to test the equivalence of two URL filters. Since those are 332 // Custom matcher to test the equivalence of two URL filters. Since those are
339 // blackbox predicates, we can only approximate the equivalence by testing 333 // blackbox predicates, we can only approximate the equivalence by testing
340 // whether the filter give the same answer for several URLs. This is currently 334 // whether the filter give the same answer for several URLs. This is currently
341 // good enough for our testing purposes, to distinguish whitelists 335 // good enough for our testing purposes, to distinguish whitelists
342 // and blacklists, empty and non-empty filters and such. 336 // and blacklists, empty and non-empty filters and such.
343 // TODO(msramek): BrowsingDataRemover and some of its backends support URL 337 // TODO(msramek): BrowsingDataRemover and some of its backends support URL
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 EXPECT_TRUE(remover->is_removing()); 3035 EXPECT_TRUE(remover->is_removing());
3042 3036
3043 // Add one more deletion and wait for it. 3037 // Add one more deletion and wait for it.
3044 BlockUntilBrowsingDataRemoved( 3038 BlockUntilBrowsingDataRemoved(
3045 browsing_data::ALL_TIME, 3039 browsing_data::ALL_TIME,
3046 BrowsingDataRemover::REMOVE_COOKIES, 3040 BrowsingDataRemover::REMOVE_COOKIES,
3047 BrowsingDataHelper::UNPROTECTED_WEB); 3041 BrowsingDataHelper::UNPROTECTED_WEB);
3048 3042
3049 EXPECT_FALSE(remover->is_removing()); 3043 EXPECT_FALSE(remover->is_removing());
3050 } 3044 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698