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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // |observer| supplies the credential. | 122 // |observer| supplies the credential. |
123 LoginPromptObserver observer; | 123 LoginPromptObserver observer; |
124 registrar.Add(&observer, chrome::NOTIFICATION_AUTH_NEEDED, | 124 registrar.Add(&observer, chrome::NOTIFICATION_AUTH_NEEDED, |
125 content::Source<content::NavigationController>(controller)); | 125 content::Source<content::NavigationController>(controller)); |
126 | 126 |
127 content::TitleWatcher watcher(tab, base::ASCIIToUTF16("PASS")); | 127 content::TitleWatcher watcher(tab, base::ASCIIToUTF16("PASS")); |
128 watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); | 128 watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); |
129 | 129 |
130 // Visit a page that tries to establish WebSocket connection. The title | 130 // Visit a page that tries to establish WebSocket connection. The title |
131 // of the page will be 'PASS' on success. | 131 // of the page will be 'PASS' on success. |
132 std::string scheme("http"); | |
133 GURL::Replacements replacements; | 132 GURL::Replacements replacements; |
134 replacements.SetSchemeStr(scheme); | 133 replacements.SetSchemeStr("http"); |
135 ui_test_utils::NavigateToURL(browser(), | 134 ui_test_utils::NavigateToURL(browser(), |
136 ws_server.GetURL("proxied_request_check.html") | 135 ws_server.GetURL("proxied_request_check.html") |
137 .ReplaceComponents(replacements)); | 136 .ReplaceComponents(replacements)); |
138 | 137 |
139 const base::string16 result = watcher.WaitAndGetTitle(); | 138 const base::string16 result = watcher.WaitAndGetTitle(); |
140 EXPECT_TRUE(EqualsASCII(result, "PASS")); | 139 EXPECT_TRUE(EqualsASCII(result, "PASS")); |
141 EXPECT_TRUE(observer.auth_handled()); | 140 EXPECT_TRUE(observer.auth_handled()); |
142 } | 141 } |
143 | 142 |
144 // Fetch PAC script via an http:// URL. | 143 // Fetch PAC script via an http:// URL. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 243 |
245 private: | 244 private: |
246 DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); | 245 DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); |
247 }; | 246 }; |
248 | 247 |
249 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { | 248 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { |
250 VerifyProxyScript(browser()); | 249 VerifyProxyScript(browser()); |
251 } | 250 } |
252 | 251 |
253 } // namespace | 252 } // namespace |
OLD | NEW |