| 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 26df993e8235b375b9c8698f2ba13a0421066eea..75e6bec5be331385d13e93b4a90c1757f56365ff 100644
|
| --- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
|
| +++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
|
| @@ -192,10 +192,6 @@ class FakeDelegate : public ProtocolHandlerRegistry::Delegate {
|
| const std::string& protocol,
|
| ProtocolHandlerRegistry* registry) override;
|
|
|
| - bool IsExternalHandlerRegistered(const std::string& protocol) override {
|
| - return registered_protocols_.find(protocol) != registered_protocols_.end();
|
| - }
|
| -
|
| bool IsFakeRegisteredWithOS(const std::string& protocol) {
|
| return os_registered_protocols_.find(protocol) !=
|
| os_registered_protocols_.end();
|
| @@ -215,6 +211,10 @@ class FakeDelegate : public ProtocolHandlerRegistry::Delegate {
|
|
|
| bool force_os_failure() { return force_os_failure_; }
|
|
|
| + bool IsExternalHandlerRegistered(const std::string& protocol) {
|
| + return registered_protocols_.find(protocol) != registered_protocols_.end();
|
| + }
|
| +
|
| private:
|
| std::set<std::string> registered_protocols_;
|
| std::set<std::string> os_registered_protocols_;
|
| @@ -443,13 +443,17 @@ TEST_F(ProtocolHandlerRegistryTest, ClearDefaultMakesProtocolNotHandled) {
|
|
|
| TEST_F(ProtocolHandlerRegistryTest, DisableDeregistersProtocolHandlers) {
|
| ASSERT_FALSE(delegate()->IsExternalHandlerRegistered("test"));
|
| + ASSERT_TRUE(delegate()->CanSchemeBeOverridden("test"));
|
| registry()->OnAcceptRegisterProtocolHandler(test_protocol_handler());
|
| ASSERT_TRUE(delegate()->IsExternalHandlerRegistered("test"));
|
| + ASSERT_FALSE(delegate()->CanSchemeBeOverridden("test"));
|
|
|
| registry()->Disable();
|
| ASSERT_FALSE(delegate()->IsExternalHandlerRegistered("test"));
|
| + ASSERT_TRUE(delegate()->CanSchemeBeOverridden("test"));
|
| registry()->Enable();
|
| ASSERT_TRUE(delegate()->IsExternalHandlerRegistered("test"));
|
| + ASSERT_FALSE(delegate()->CanSchemeBeOverridden("test"));
|
| }
|
|
|
| TEST_F(ProtocolHandlerRegistryTest, IgnoreProtocolHandler) {
|
|
|