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