OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "content/public/test/test_browser_thread.h" | 8 #include "content/public/test/test_browser_thread.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 private: | 23 private: |
24 ~FakeExternalProtocolHandlerWorker() override {} | 24 ~FakeExternalProtocolHandlerWorker() override {} |
25 | 25 |
26 void CheckIsDefault() override { | 26 void CheckIsDefault() override { |
27 BrowserThread::PostTask( | 27 BrowserThread::PostTask( |
28 BrowserThread::UI, FROM_HERE, | 28 BrowserThread::UI, FROM_HERE, |
29 base::Bind(&FakeExternalProtocolHandlerWorker::OnCheckIsDefaultComplete, | 29 base::Bind(&FakeExternalProtocolHandlerWorker::OnCheckIsDefaultComplete, |
30 this, os_state_)); | 30 this, os_state_)); |
31 } | 31 } |
32 | 32 |
33 void SetAsDefault(bool interactive_permitted) override { | 33 void SetAsDefault() override { |
34 BrowserThread::PostTask( | 34 BrowserThread::PostTask( |
35 BrowserThread::UI, FROM_HERE, | 35 BrowserThread::UI, FROM_HERE, |
36 base::Bind( | 36 base::Bind( |
37 &FakeExternalProtocolHandlerWorker::OnSetAsDefaultAttemptComplete, | 37 &FakeExternalProtocolHandlerWorker::OnSetAsDefaultAttemptComplete, |
38 this, AttemptResult::SUCCESS)); | 38 this, AttemptResult::SUCCESS)); |
39 } | 39 } |
40 | 40 |
41 ShellIntegration::DefaultWebClientState os_state_; | 41 ShellIntegration::DefaultWebClientState os_state_; |
42 }; | 42 }; |
43 | 43 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 DoTest(ExternalProtocolHandler::UNKNOWN, | 194 DoTest(ExternalProtocolHandler::UNKNOWN, |
195 ShellIntegration::NOT_DEFAULT, | 195 ShellIntegration::NOT_DEFAULT, |
196 true, false, false); | 196 true, false, false); |
197 } | 197 } |
198 | 198 |
199 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) { | 199 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) { |
200 DoTest(ExternalProtocolHandler::UNKNOWN, | 200 DoTest(ExternalProtocolHandler::UNKNOWN, |
201 ShellIntegration::UNKNOWN_DEFAULT, | 201 ShellIntegration::UNKNOWN_DEFAULT, |
202 true, false, false); | 202 true, false, false); |
203 } | 203 } |
OLD | NEW |