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

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: Fix WebappModeTest 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
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, 320 const base::Callback<bool(const GURL&)>& url_filter) override {
321 const base::Closure& callback) override { 321 // Mocks out a JNI call.
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));
325 } 322 }
326 323
327 void ClearWebappHistoryForUrls( 324 void ClearWebappHistoryForUrls(
328 const base::Callback<bool(const GURL&)>& url_filter, 325 const base::Callback<bool(const GURL&)>& url_filter) override {
329 const base::Closure& callback) override { 326 // Mocks out a JNI call.
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));
333 } 327 }
334 }; 328 };
335 #endif 329 #endif
336 330
337 // Custom matcher to test the equivalence of two URL filters. Since those are 331 // Custom matcher to test the equivalence of two URL filters. Since those are
338 // blackbox predicates, we can only approximate the equivalence by testing 332 // blackbox predicates, we can only approximate the equivalence by testing
339 // whether the filter give the same answer for several URLs. This is currently 333 // whether the filter give the same answer for several URLs. This is currently
340 // good enough for our testing purposes, to distinguish whitelists 334 // good enough for our testing purposes, to distinguish whitelists
341 // and blacklists, empty and non-empty filters and such. 335 // and blacklists, empty and non-empty filters and such.
342 // TODO(msramek): BrowsingDataRemover and some of its backends support URL 336 // TODO(msramek): BrowsingDataRemover and some of its backends support URL
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 EXPECT_TRUE(remover->is_removing()); 2992 EXPECT_TRUE(remover->is_removing());
2999 2993
3000 // Add one more deletion and wait for it. 2994 // Add one more deletion and wait for it.
3001 BlockUntilBrowsingDataRemoved( 2995 BlockUntilBrowsingDataRemoved(
3002 browsing_data::ALL_TIME, 2996 browsing_data::ALL_TIME,
3003 BrowsingDataRemover::REMOVE_COOKIES, 2997 BrowsingDataRemover::REMOVE_COOKIES,
3004 BrowsingDataHelper::UNPROTECTED_WEB); 2998 BrowsingDataHelper::UNPROTECTED_WEB);
3005 2999
3006 EXPECT_FALSE(remover->is_removing()); 3000 EXPECT_FALSE(remover->is_removing());
3007 } 3001 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698