OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
8 #include "chrome/browser/worker_host/worker_service.h" | 8 #include "chrome/browser/worker_host/worker_service.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 const wchar_t kDocRoot[] = L"chrome/test/data/workers"; | 192 const wchar_t kDocRoot[] = L"chrome/test/data/workers"; |
193 | 193 |
194 #if defined(OS_WIN) | 194 #if defined(OS_WIN) |
195 // http://crbug.com/33344 - NavigateAndWaitForAuth times out on the Windows | 195 // http://crbug.com/33344 - NavigateAndWaitForAuth times out on the Windows |
196 // build bots. | 196 // build bots. |
197 #define WorkerHttpAuth DISABLED_WorkerHttpAuth | 197 #define WorkerHttpAuth DISABLED_WorkerHttpAuth |
198 #endif | 198 #endif |
199 // Make sure that auth dialog is displayed from worker context. | 199 // Make sure that auth dialog is displayed from worker context. |
200 TEST_F(WorkerTest, WorkerHttpAuth) { | 200 TEST_F(WorkerTest, WorkerHttpAuth) { |
201 scoped_refptr<HTTPTestServer> server = | 201 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); |
202 HTTPTestServer::CreateServer(kDocRoot, NULL); | |
203 ASSERT_TRUE(NULL != server.get()); | 202 ASSERT_TRUE(NULL != server.get()); |
204 | 203 |
205 scoped_refptr<TabProxy> tab(GetActiveTab()); | 204 scoped_refptr<TabProxy> tab(GetActiveTab()); |
206 ASSERT_TRUE(tab.get()); | 205 ASSERT_TRUE(tab.get()); |
207 | 206 |
208 GURL url = server->TestServerPage("files/worker_auth.html"); | 207 GURL url = server->TestServerPage("files/worker_auth.html"); |
209 EXPECT_TRUE(NavigateAndWaitForAuth(tab, url)); | 208 EXPECT_TRUE(NavigateAndWaitForAuth(tab, url)); |
210 } | 209 } |
211 | 210 |
212 #if defined(OS_WIN) | 211 #if defined(OS_WIN) |
213 // http://crbug.com/33344 - NavigateAndWaitForAuth times out on the Windows | 212 // http://crbug.com/33344 - NavigateAndWaitForAuth times out on the Windows |
214 // build bots. | 213 // build bots. |
215 #define SharedWorkerHttpAuth DISABLED_SharedWorkerHttpAuth | 214 #define SharedWorkerHttpAuth DISABLED_SharedWorkerHttpAuth |
216 #endif | 215 #endif |
217 // Make sure that auth dialog is displayed from shared worker context. | 216 // Make sure that auth dialog is displayed from shared worker context. |
218 TEST_F(WorkerTest, SharedWorkerHttpAuth) { | 217 TEST_F(WorkerTest, SharedWorkerHttpAuth) { |
219 scoped_refptr<HTTPTestServer> server = | 218 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); |
220 HTTPTestServer::CreateServer(kDocRoot, NULL); | |
221 ASSERT_TRUE(NULL != server.get()); | 219 ASSERT_TRUE(NULL != server.get()); |
222 | 220 |
223 scoped_refptr<TabProxy> tab(GetActiveTab()); | 221 scoped_refptr<TabProxy> tab(GetActiveTab()); |
224 ASSERT_TRUE(tab.get()); | 222 ASSERT_TRUE(tab.get()); |
225 | 223 |
226 GURL url = server->TestServerPage("files/shared_worker_auth.html"); | 224 GURL url = server->TestServerPage("files/shared_worker_auth.html"); |
227 EXPECT_TRUE(NavigateAndWaitForAuth(tab, url)); | 225 EXPECT_TRUE(NavigateAndWaitForAuth(tab, url)); |
228 // TODO(atwilson): Add support to automation framework to test for auth | 226 // TODO(atwilson): Add support to automation framework to test for auth |
229 // dialogs displayed by non-navigating tabs. | 227 // dialogs displayed by non-navigating tabs. |
230 } | 228 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 GURL url2 = ui_test_utils::GetTestUrl(FilePath(kTestDir), | 660 GURL url2 = ui_test_utils::GetTestUrl(FilePath(kTestDir), |
663 FilePath(kSingleSharedWorkersFile)); | 661 FilePath(kSingleSharedWorkersFile)); |
664 url2 = GURL(url2.spec() + StringPrintf("?id=%d", max_workers_per_tab)); | 662 url2 = GURL(url2.spec() + StringPrintf("?id=%d", max_workers_per_tab)); |
665 ASSERT_TRUE(window->AppendTab(url2)); | 663 ASSERT_TRUE(window->AppendTab(url2)); |
666 | 664 |
667 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, | 665 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
668 kTestCompleteCookie, action_max_timeout_ms()); | 666 kTestCompleteCookie, action_max_timeout_ms()); |
669 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); | 667 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); |
670 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); | 668 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); |
671 } | 669 } |
OLD | NEW |