diff options
Diffstat (limited to 'chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc')
-rw-r--r-- | chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc index 7fe0336..e28c034 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc @@ -63,19 +63,17 @@ void AssertIntercepted( // ProtocolHandlerRegistry properly handled a job creation request. class FakeURLRequestJobFactory : public net::URLRequestJobFactory { // net::URLRequestJobFactory implementation: - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return NULL; } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return false; } - virtual bool IsHandledURL(const GURL& url) const override { - return false; - } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsHandledURL(const GURL& url) const override { return false; } + bool IsSafeRedirectTarget(const GURL& location) const override { return true; } }; @@ -124,34 +122,32 @@ base::DictionaryValue* GetProtocolHandlerValueWithDefault(std::string protocol, class FakeDelegate : public ProtocolHandlerRegistry::Delegate { public: FakeDelegate() : force_os_failure_(false) {} - virtual ~FakeDelegate() { } - virtual void RegisterExternalHandler(const std::string& protocol) override { + ~FakeDelegate() override {} + void RegisterExternalHandler(const std::string& protocol) override { ASSERT_TRUE( registered_protocols_.find(protocol) == registered_protocols_.end()); registered_protocols_.insert(protocol); } - virtual void DeregisterExternalHandler(const std::string& protocol) override { + void DeregisterExternalHandler(const std::string& protocol) override { registered_protocols_.erase(protocol); } - virtual ShellIntegration::DefaultProtocolClientWorker* CreateShellWorker( - ShellIntegration::DefaultWebClientObserver* observer, - const std::string& protocol) override; + ShellIntegration::DefaultProtocolClientWorker* CreateShellWorker( + ShellIntegration::DefaultWebClientObserver* observer, + const std::string& protocol) override; - virtual ProtocolHandlerRegistry::DefaultClientObserver* CreateShellObserver( + ProtocolHandlerRegistry::DefaultClientObserver* CreateShellObserver( ProtocolHandlerRegistry* registry) override; - virtual void RegisterWithOSAsDefaultClient( - const std::string& protocol, - ProtocolHandlerRegistry* reg) override { + void RegisterWithOSAsDefaultClient(const std::string& protocol, + ProtocolHandlerRegistry* reg) override { ProtocolHandlerRegistry::Delegate::RegisterWithOSAsDefaultClient(protocol, reg); ASSERT_FALSE(IsFakeRegisteredWithOS(protocol)); } - virtual bool IsExternalHandlerRegistered( - const std::string& protocol) override { + bool IsExternalHandlerRegistered(const std::string& protocol) override { return registered_protocols_.find(protocol) != registered_protocols_.end(); } @@ -188,7 +184,7 @@ class FakeClientObserver : ProtocolHandlerRegistry::DefaultClientObserver(registry), delegate_(registry_delegate) {} - virtual void SetDefaultWebClientUIState( + void SetDefaultWebClientUIState( ShellIntegration::DefaultWebClientUIState state) override { ProtocolHandlerRegistry::DefaultClientObserver::SetDefaultWebClientUIState( state); @@ -214,9 +210,9 @@ class FakeProtocolClientWorker force_failure_(force_failure) {} private: - virtual ~FakeProtocolClientWorker() {} + ~FakeProtocolClientWorker() override {} - virtual ShellIntegration::DefaultWebClientState CheckIsDefault() override { + ShellIntegration::DefaultWebClientState CheckIsDefault() override { if (force_failure_) { return ShellIntegration::NOT_DEFAULT; } else { @@ -224,9 +220,7 @@ class FakeProtocolClientWorker } } - virtual bool SetAsDefault(bool interactive_permitted) override { - return true; - } + bool SetAsDefault(bool interactive_permitted) override { return true; } private: bool force_failure_; @@ -256,9 +250,9 @@ class NotificationCounter : public content::NotificationObserver { int events() { return events_; } bool notified() { return events_ > 0; } void Clear() { events_ = 0; } - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override { + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override { ++events_; } @@ -279,9 +273,9 @@ class QueryProtocolHandlerOnChange content::Source<content::BrowserContext>(context)); } - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override { + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override { std::vector<std::string> output; local_registry_->GetRegisteredProtocols(&output); called_ = true; @@ -301,8 +295,8 @@ class QueryProtocolHandlerOnChange class TestMessageLoop : public base::MessageLoop { public: TestMessageLoop() {} - virtual ~TestMessageLoop() {} - virtual bool IsType(base::MessageLoop::Type type) const override { + ~TestMessageLoop() override {} + bool IsType(base::MessageLoop::Type type) const override { switch (type) { case base::MessageLoop::TYPE_UI: return BrowserThread::CurrentlyOn(BrowserThread::UI); |