| Index: chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| index 223fd0cd9a0824d4ae4aa76db0df698b3a80c376..a96654745cc01b761a7841216721e0abccf797ca 100644
|
| --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| @@ -76,6 +76,10 @@
|
| #include "ui/gfx/favicon_size.h"
|
| #include "url/origin.h"
|
|
|
| +#if BUILDFLAG(ANDROID_JAVA_UI)
|
| +#include "chrome/browser/android/webapps/webapp_registry.h"
|
| +#endif
|
| +
|
| #if defined(OS_CHROMEOS)
|
| #include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
| #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
| @@ -260,6 +264,19 @@ class TestStoragePartition : public StoragePartition {
|
| DISALLOW_COPY_AND_ASSIGN(TestStoragePartition);
|
| };
|
|
|
| +#if BUILDFLAG(ANDROID_JAVA_UI)
|
| +class TestWebappRegistry : public WebappRegistry {
|
| + public:
|
| + TestWebappRegistry() : WebappRegistry() { }
|
| +
|
| + void UnregisterWebapps(const base::Closure& callback) override {
|
| + // Mocks out a JNI call and runs the callback as a delayed task.
|
| + BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback,
|
| + base::TimeDelta::FromMilliseconds(10));
|
| + }
|
| +};
|
| +#endif
|
| +
|
| // Custom matcher to test the equivalence of two URL filters. Since those are
|
| // blackbox predicates, we can only approximate the equivalence by testing
|
| // whether the filter give the same answer for several URLs. This is currently
|
| @@ -942,6 +959,13 @@ class BrowsingDataRemoverTest : public testing::Test {
|
| BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
|
| base::Bind(&BrowsingDataRemoverTest::NotifyWithDetails,
|
| base::Unretained(this)));
|
| +
|
| +#if BUILDFLAG(ANDROID_JAVA_UI)
|
| + BrowsingDataRemover* remover =
|
| + BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get());
|
| + remover->OverrideWebappRegistryForTesting(
|
| + scoped_ptr<WebappRegistry>(new TestWebappRegistry()));
|
| +#endif
|
| }
|
|
|
| ~BrowsingDataRemoverTest() override {}
|
|
|