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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/test/test_file_util.h" | 8 #include "base/test/test_file_util.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/test/automation/automation_proxy.h" | 13 #include "chrome/test/automation/automation_proxy.h" |
14 #include "chrome/test/automation/browser_proxy.h" | 14 #include "chrome/test/automation/browser_proxy.h" |
15 #include "chrome/test/automation/tab_proxy.h" | 15 #include "chrome/test/automation/tab_proxy.h" |
16 #include "chrome/test/ui/ui_test.h" | 16 #include "chrome/test/ui/ui_test.h" |
17 #include "net/test/test_server.h" | 17 #include "net/test/test_server.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class CustomHandlerTest : public UITest { | 21 class CustomHandlerTest : public UITest { |
22 public: | 22 public: |
23 CustomHandlerTest() | 23 CustomHandlerTest() |
24 : test_server_(net::TestServer::TYPE_HTTP, | 24 : test_server_(net::TestServer::TYPE_HTTP, |
| 25 net::TestServer::kLocalhost, |
25 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { | 26 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { |
26 // Stop Chrome from removing custom protocol handlers for protocols that | 27 // Stop Chrome from removing custom protocol handlers for protocols that |
27 // Chrome is not registered with the OS as the default application. | 28 // Chrome is not registered with the OS as the default application. |
28 // In the test environment Chrome will not be registered with the OS as the | 29 // In the test environment Chrome will not be registered with the OS as the |
29 // default application to handle any protocols. | 30 // default application to handle any protocols. |
30 launch_arguments_.AppendSwitch(switches::kDisableCustomProtocolOSCheck); | 31 launch_arguments_.AppendSwitch(switches::kDisableCustomProtocolOSCheck); |
31 | 32 |
32 FilePath template_dir; | 33 FilePath template_dir; |
33 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &template_dir)); | 34 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &template_dir)); |
34 template_dir = template_dir.AppendASCII("profiles"). | 35 template_dir = template_dir.AppendASCII("profiles"). |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 ASSERT_EQ(test_server_.GetURL("files/custom_handler_mailto.html"), | 114 ASSERT_EQ(test_server_.GetURL("files/custom_handler_mailto.html"), |
114 GetTabURL()); | 115 GetTabURL()); |
115 } | 116 } |
116 | 117 |
117 TEST_F(CustomHandlerWebcalStartupTest, CustomHandlerWebcalStartup) { | 118 TEST_F(CustomHandlerWebcalStartupTest, CustomHandlerWebcalStartup) { |
118 ASSERT_EQ(test_server_.GetURL("files/custom_handler_webcal.html"), | 119 ASSERT_EQ(test_server_.GetURL("files/custom_handler_webcal.html"), |
119 GetTabURL()); | 120 GetTabURL()); |
120 } | 121 } |
121 | 122 |
122 } // namespace | 123 } // namespace |
OLD | NEW |