OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_path.h" | 5 #include "base/file_path.h" |
6 #include "chrome/app/chrome_dll_resource.h" | 6 #include "chrome/app/chrome_dll_resource.h" |
7 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
8 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
9 #include "chrome/test/ui/ui_layout_test.h" | 9 #include "chrome/test/ui/ui_layout_test.h" |
10 #include "chrome/test/ui_test_utils.h" | 10 #include "chrome/test/ui_test_utils.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 launch_arguments_.AppendSwitch(switches::kEnableSearchProviderApiV2); | 36 launch_arguments_.AppendSwitch(switches::kEnableSearchProviderApiV2); |
37 | 37 |
38 // Map all hosts to our local server. | 38 // Map all hosts to our local server. |
39 GURL server_url = server_->TestServerPage(""); | 39 GURL server_url = server_->TestServerPage(""); |
40 std::string host_rule = "MAP * "; | 40 std::string host_rule = "MAP * "; |
41 host_rule.append(server_url.host()); | 41 host_rule.append(server_url.host()); |
42 if (server_url.has_port()) { | 42 if (server_url.has_port()) { |
43 host_rule.append(":"); | 43 host_rule.append(":"); |
44 host_rule.append(server_url.port()); | 44 host_rule.append(server_url.port()); |
45 } | 45 } |
46 launch_arguments_.AppendSwitchWithValue(switches::kHostRules, | 46 launch_arguments_.AppendSwitchASCII(switches::kHostRules, host_rule); |
47 host_rule); | |
48 } | 47 } |
49 | 48 |
50 SearchProviderTest::~SearchProviderTest() { | 49 SearchProviderTest::~SearchProviderTest() { |
51 server_->Stop(); | 50 server_->Stop(); |
52 } | 51 } |
53 | 52 |
54 void SearchProviderTest::TestIsSearchProviderInstalledForHost( | 53 void SearchProviderTest::TestIsSearchProviderInstalledForHost( |
55 TabProxy* tab, | 54 TabProxy* tab, |
56 const char* host, | 55 const char* host, |
57 const char* expected_result) { | 56 const char* expected_result) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 ASSERT_TRUE(browser.get()); | 88 ASSERT_TRUE(browser.get()); |
90 ASSERT_TRUE(browser->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); | 89 ASSERT_TRUE(browser->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); |
91 scoped_refptr<BrowserProxy> incognito(automation()->GetBrowserWindow(1)); | 90 scoped_refptr<BrowserProxy> incognito(automation()->GetBrowserWindow(1)); |
92 ASSERT_TRUE(incognito.get()); | 91 ASSERT_TRUE(incognito.get()); |
93 scoped_refptr<TabProxy> incognito_tab(incognito->GetTab(0)); | 92 scoped_refptr<TabProxy> incognito_tab(incognito->GetTab(0)); |
94 ASSERT_TRUE(incognito_tab.get()); | 93 ASSERT_TRUE(incognito_tab.get()); |
95 TestIsSearchProviderInstalledForHost(incognito_tab, "www.google.com", "0"); | 94 TestIsSearchProviderInstalledForHost(incognito_tab, "www.google.com", "0"); |
96 TestIsSearchProviderInstalledForHost(incognito_tab, "www.bing.com", "0"); | 95 TestIsSearchProviderInstalledForHost(incognito_tab, "www.bing.com", "0"); |
97 TestIsSearchProviderInstalledForHost(incognito_tab, "localhost", "0"); | 96 TestIsSearchProviderInstalledForHost(incognito_tab, "localhost", "0"); |
98 } | 97 } |
OLD | NEW |