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

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

Issue 2390753004: Revert of [Reland] 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 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) override { 321 const base::Callback<bool(const GURL&)>& url_filter,
322 // Mocks out a JNI call. 322 const base::Closure& callback) override {
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));
323 } 326 }
324 327
325 void ClearWebappHistoryForUrls( 328 void ClearWebappHistoryForUrls(
326 const base::Callback<bool(const GURL&)>& url_filter) override { 329 const base::Callback<bool(const GURL&)>& url_filter,
327 // Mocks out a JNI call. 330 const base::Closure& callback) override {
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));
328 } 334 }
329 }; 335 };
330 #endif 336 #endif
331 337
332 // Custom matcher to test the equivalence of two URL filters. Since those are 338 // Custom matcher to test the equivalence of two URL filters. Since those are
333 // blackbox predicates, we can only approximate the equivalence by testing 339 // blackbox predicates, we can only approximate the equivalence by testing
334 // whether the filter give the same answer for several URLs. This is currently 340 // whether the filter give the same answer for several URLs. This is currently
335 // good enough for our testing purposes, to distinguish whitelists 341 // good enough for our testing purposes, to distinguish whitelists
336 // and blacklists, empty and non-empty filters and such. 342 // and blacklists, empty and non-empty filters and such.
337 // TODO(msramek): BrowsingDataRemover and some of its backends support URL 343 // TODO(msramek): BrowsingDataRemover and some of its backends support URL
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 EXPECT_TRUE(remover->is_removing()); 3041 EXPECT_TRUE(remover->is_removing());
3036 3042
3037 // Add one more deletion and wait for it. 3043 // Add one more deletion and wait for it.
3038 BlockUntilBrowsingDataRemoved( 3044 BlockUntilBrowsingDataRemoved(
3039 browsing_data::ALL_TIME, 3045 browsing_data::ALL_TIME,
3040 BrowsingDataRemover::REMOVE_COOKIES, 3046 BrowsingDataRemover::REMOVE_COOKIES,
3041 BrowsingDataHelper::UNPROTECTED_WEB); 3047 BrowsingDataHelper::UNPROTECTED_WEB);
3042 3048
3043 EXPECT_FALSE(remover->is_removing()); 3049 EXPECT_FALSE(remover->is_removing());
3044 } 3050 }
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