| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 5 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 
| 6 | 6 | 
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" | 
| 8 #include "content/test/test_browser_thread.h" | 8 #include "content/test/test_browser_thread.h" | 
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" | 
| 10 | 10 | 
| 11 using content::BrowserThread; | 11 using content::BrowserThread; | 
| 12 | 12 | 
| 13 class FakeExternalProtocolHandlerWorker | 13 class FakeExternalProtocolHandlerWorker | 
| 14     : public ShellIntegration::DefaultProtocolClientWorker { | 14     : public ShellIntegration::DefaultProtocolClientWorker { | 
| 15  public: | 15  public: | 
| 16   FakeExternalProtocolHandlerWorker( | 16   FakeExternalProtocolHandlerWorker( | 
| 17       ShellIntegration::DefaultWebClientObserver* observer, | 17       ShellIntegration::DefaultWebClientObserver* observer, | 
| 18       const std::string& protocol, | 18       const std::string& protocol, | 
| 19       ShellIntegration::DefaultWebClientState os_state) | 19       ShellIntegration::DefaultWebClientState os_state) | 
| 20       : ShellIntegration::DefaultProtocolClientWorker(observer, protocol), | 20       : ShellIntegration::DefaultProtocolClientWorker(observer, protocol), | 
| 21         os_state_(os_state) {} | 21         os_state_(os_state) {} | 
| 22 | 22 | 
| 23  private: | 23  private: | 
|  | 24   virtual ~FakeExternalProtocolHandlerWorker() {} | 
|  | 25 | 
| 24   virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { | 26   virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { | 
| 25     return os_state_; | 27     return os_state_; | 
| 26   } | 28   } | 
| 27 | 29 | 
| 28   virtual void SetAsDefault() {} | 30   virtual void SetAsDefault() {} | 
| 29 | 31 | 
| 30   ShellIntegration::DefaultWebClientState os_state_; | 32   ShellIntegration::DefaultWebClientState os_state_; | 
| 31 }; | 33 }; | 
| 32 | 34 | 
| 33 class FakeExternalProtocolHandlerDelegate | 35 class FakeExternalProtocolHandlerDelegate | 
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 180   DoTest(ExternalProtocolHandler::UNKNOWN, | 182   DoTest(ExternalProtocolHandler::UNKNOWN, | 
| 181          ShellIntegration::NOT_DEFAULT_WEB_CLIENT, | 183          ShellIntegration::NOT_DEFAULT_WEB_CLIENT, | 
| 182          true, false, false); | 184          true, false, false); | 
| 183 } | 185 } | 
| 184 | 186 | 
| 185 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) { | 187 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) { | 
| 186   DoTest(ExternalProtocolHandler::UNKNOWN, | 188   DoTest(ExternalProtocolHandler::UNKNOWN, | 
| 187          ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT, | 189          ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT, | 
| 188          true, false, false); | 190          true, false, false); | 
| 189 } | 191 } | 
| OLD | NEW | 
|---|