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

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

Issue 2384413003: Revert of Refactor WebappRegistry into a singleton instance. (Closed)
Patch Set: 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 310
311 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); 311 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition);
312 }; 312 };
313 313
314 #if BUILDFLAG(ANDROID_JAVA_UI) 314 #if BUILDFLAG(ANDROID_JAVA_UI)
315 class TestWebappRegistry : public WebappRegistry { 315 class TestWebappRegistry : public WebappRegistry {
316 public: 316 public:
317 TestWebappRegistry() : WebappRegistry() { } 317 TestWebappRegistry() : WebappRegistry() { }
318 318
319 void UnregisterWebappsForUrls( 319 void UnregisterWebappsForUrls(
320 const base::Callback<bool(const GURL&)>& url_filter) override { 320 const base::Callback<bool(const GURL&)>& url_filter,
321 // Mocks out a JNI call. 321 const base::Closure& callback) override {
322 // Mocks out a JNI call and runs the callback as a delayed task.
323 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback,
324 base::TimeDelta::FromMilliseconds(10));
322 } 325 }
323 326
324 void ClearWebappHistoryForUrls( 327 void ClearWebappHistoryForUrls(
325 const base::Callback<bool(const GURL&)>& url_filter) override { 328 const base::Callback<bool(const GURL&)>& url_filter,
326 // Mocks out a JNI call. 329 const base::Closure& callback) override {
330 // Mocks out a JNI call and runs the callback as a delayed task.
331 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback,
332 base::TimeDelta::FromMilliseconds(10));
327 } 333 }
328 }; 334 };
329 #endif 335 #endif
330 336
331 // Custom matcher to test the equivalence of two URL filters. Since those are 337 // Custom matcher to test the equivalence of two URL filters. Since those are
332 // blackbox predicates, we can only approximate the equivalence by testing 338 // blackbox predicates, we can only approximate the equivalence by testing
333 // whether the filter give the same answer for several URLs. This is currently 339 // whether the filter give the same answer for several URLs. This is currently
334 // good enough for our testing purposes, to distinguish whitelists 340 // good enough for our testing purposes, to distinguish whitelists
335 // and blacklists, empty and non-empty filters and such. 341 // and blacklists, empty and non-empty filters and such.
336 // TODO(msramek): BrowsingDataRemover and some of its backends support URL 342 // TODO(msramek): BrowsingDataRemover and some of its backends support URL
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2992 EXPECT_TRUE(remover->is_removing()); 2998 EXPECT_TRUE(remover->is_removing());
2993 2999
2994 // Add one more deletion and wait for it. 3000 // Add one more deletion and wait for it.
2995 BlockUntilBrowsingDataRemoved( 3001 BlockUntilBrowsingDataRemoved(
2996 browsing_data::ALL_TIME, 3002 browsing_data::ALL_TIME,
2997 BrowsingDataRemover::REMOVE_COOKIES, 3003 BrowsingDataRemover::REMOVE_COOKIES,
2998 BrowsingDataHelper::UNPROTECTED_WEB); 3004 BrowsingDataHelper::UNPROTECTED_WEB);
2999 3005
3000 EXPECT_FALSE(remover->is_removing()); 3006 EXPECT_FALSE(remover->is_removing());
3001 } 3007 }
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