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

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 10139002: Preventing our default handlers for ChromeOS to show up or confuse the user (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Resolving merge issues Created 8 years, 8 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
Index: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
index f5afb11c38b3c691e955ca17ad5a689ec77d3f19..65699f7f994507ccade4557ae32aac93c533f4c5 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
@@ -229,6 +229,16 @@ class ProtocolHandlerRegistryTest : public testing::Test {
registry_->Load();
}
+ void ReloadProtocolHandlerRegistryAndInstallDefaultHandler() {
+ delegate_ = new FakeDelegate();
+ registry_->Finalize();
+ registry_ = NULL;
+ registry_ = new ProtocolHandlerRegistry(profile(), delegate());
+ registry_->AddDefaultHandler(CreateProtocolHandler(
+ "test", GURL("http://test.com/%s"), "Test"));
+ registry_->Load();
+ }
+
virtual void SetUp() {
ui_message_loop_.reset(new MessageLoopForUI());
ui_thread_.reset(new content::TestBrowserThread(BrowserThread::UI,
@@ -796,3 +806,10 @@ TEST_F(ProtocolHandlerRegistryTest, TestIsSameOrigin) {
ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(),
ph3.IsSameOrigin(ph2));
}
+
+TEST_F(ProtocolHandlerRegistryTest, TestInstallDefaultHandler) {
+ ReloadProtocolHandlerRegistryAndInstallDefaultHandler();
+ std::vector<std::string> protocols;
+ registry()->GetRegisteredProtocols(&protocols);
+ ASSERT_EQ(static_cast<size_t>(1), protocols.size());
+}

Powered by Google App Engine
This is Rietveld 408576698