| 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());
|
| +}
|
|
|