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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 2206953002: Use mojo for WebappRegistry. Base URL: https://chromium.googlesource.com/chromium/src.git@java-interface-registry
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a0acbf71d3f513530a35b0376d316c35a88ff4ea..f9183ae0e0d2434dd016a6b9544d37e987841ef9 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
@@ -89,7 +89,8 @@
#include "url/origin.h"
#if BUILDFLAG(ANDROID_JAVA_UI)
-#include "chrome/browser/android/webapps/webapp_registry.h"
+#include "chrome/browser/android/webapps/webapp_registry.mojom.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#endif
#if defined(OS_CHROMEOS)
@@ -306,21 +307,20 @@ class TestStoragePartition : public StoragePartition {
};
#if BUILDFLAG(ANDROID_JAVA_UI)
-class TestWebappRegistry : public WebappRegistry {
+class TestWebappRegistry : public mojom::WebappRegistry {
public:
- TestWebappRegistry() : WebappRegistry() { }
+ explicit TestWebappRegistry(mojom::WebappRegistryRequest request)
+ : binding_(this, std::move(request)) {}
- 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));
+ void UnregisterAllWebapps(const base::Closure& callback) override {
+ callback.Run();
}
void ClearWebappHistory(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));
+ callback.Run();
}
+
+ mojo::StrongBinding<mojom::WebappRegistry> binding_;
};
#endif
@@ -1029,8 +1029,9 @@ class BrowsingDataRemoverTest : public testing::Test {
BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get());
#if BUILDFLAG(ANDROID_JAVA_UI)
- remover_->OverrideWebappRegistryForTesting(
- std::unique_ptr<WebappRegistry>(new TestWebappRegistry()));
+ mojom::WebappRegistryPtr webapp_registry;
+ new TestWebappRegistry(mojo::GetProxy(&webapp_registry));
+ remover_->OverrideWebappRegistryForTesting(std::move(webapp_registry));
#endif
}
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698