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

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: Addressed 4th review 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 67820c402177eee6e06b52d8eef425b10afb4806..9b8837944cddbd6bd4fd84e83db61bb354b709dc 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
@@ -227,6 +227,16 @@ class ProtocolHandlerRegistryTest : public testing::Test {
registry_->Load();
}
+ void ReloadProtocolHandlerRegistryAndInstallDefaultHandler() {
+ delegate_ = new FakeDelegate();
+ registry_->Finalize();
+ registry_ = NULL;
+ registry_ = new ProtocolHandlerRegistry(profile(), delegate());
+ registry_->AddFixedHandler(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,
@@ -794,3 +804,10 @@ TEST_F(ProtocolHandlerRegistryTest, TestIsSameOrigin) {
ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(),
ph3.IsSameOrigin(ph2));
}
+
+TEST_F(ProtocolHandlerRegistryTest, TestInstallFixedHandler) {
+ 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