| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); | 293 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); |
| 294 browser_client->resource_dispatcher_host_delegate()-> | 294 browser_client->resource_dispatcher_host_delegate()-> |
| 295 set_login_request_callback( | 295 set_login_request_callback( |
| 296 base::Bind(&QuitUIMessageLoop, runner->QuitClosure())); | 296 base::Bind(&QuitUIMessageLoop, runner->QuitClosure())); |
| 297 shell()->LoadURL(url); | 297 shell()->LoadURL(url); |
| 298 runner->Run(); | 298 runner->Run(); |
| 299 } | 299 } |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { | 302 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { |
| 303 RunTest("single_worker.html", ""); | 303 RunTest("single_worker.html", std::string()); |
| 304 } | 304 } |
| 305 | 305 |
| 306 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { | 306 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { |
| 307 RunTest("multi_worker.html", ""); | 307 RunTest("multi_worker.html", std::string()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleSharedWorker) { | 310 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleSharedWorker) { |
| 311 RunTest("single_worker.html", "shared=true"); | 311 RunTest("single_worker.html", "shared=true"); |
| 312 } | 312 } |
| 313 | 313 |
| 314 // http://crbug.com/96435 | 314 // http://crbug.com/96435 |
| 315 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleSharedWorkers) { | 315 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleSharedWorkers) { |
| 316 RunTest("multi_worker.html", "shared=true"); | 316 RunTest("multi_worker.html", "shared=true"); |
| 317 } | 317 } |
| 318 | 318 |
| 319 // Incognito windows should not share workers with non-incognito windows | 319 // Incognito windows should not share workers with non-incognito windows |
| 320 // http://crbug.com/30021 | 320 // http://crbug.com/30021 |
| 321 IN_PROC_BROWSER_TEST_F(WorkerTest, IncognitoSharedWorkers) { | 321 IN_PROC_BROWSER_TEST_F(WorkerTest, IncognitoSharedWorkers) { |
| 322 // Load a non-incognito tab and have it create a shared worker | 322 // Load a non-incognito tab and have it create a shared worker |
| 323 RunTest("incognito_worker.html", ""); | 323 RunTest("incognito_worker.html", std::string()); |
| 324 | 324 |
| 325 // Incognito worker should not share with non-incognito | 325 // Incognito worker should not share with non-incognito |
| 326 RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", ""); | 326 RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", std::string()); |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Make sure that auth dialog is displayed from worker context. | 329 // Make sure that auth dialog is displayed from worker context. |
| 330 // http://crbug.com/33344 | 330 // http://crbug.com/33344 |
| 331 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerHttpAuth) { | 331 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerHttpAuth) { |
| 332 ASSERT_TRUE(test_server()->Start()); | 332 ASSERT_TRUE(test_server()->Start()); |
| 333 GURL url = test_server()->GetURL("files/workers/worker_auth.html"); | 333 GURL url = test_server()->GetURL("files/workers/worker_auth.html"); |
| 334 | 334 |
| 335 NavigateAndWaitForAuth(url); | 335 NavigateAndWaitForAuth(url); |
| 336 } | 336 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 392 |
| 393 // Now close a page and check that the queued workers were started. | 393 // Now close a page and check that the queued workers were started. |
| 394 url = GURL(GetTestUrl("google", "google.html")); | 394 url = GURL(GetTestUrl("google", "google.html")); |
| 395 NavigateToURL(shell(), url); | 395 NavigateToURL(shell(), url); |
| 396 | 396 |
| 397 ASSERT_TRUE(WaitForWorkerProcessCount(total_workers)); | 397 ASSERT_TRUE(WaitForWorkerProcessCount(total_workers)); |
| 398 } | 398 } |
| 399 | 399 |
| 400 // Flaky, http://crbug.com/59786. | 400 // Flaky, http://crbug.com/59786. |
| 401 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerClose) { | 401 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerClose) { |
| 402 RunTest("worker_close.html", ""); | 402 RunTest("worker_close.html", std::string()); |
| 403 ASSERT_TRUE(WaitForWorkerProcessCount(0)); | 403 ASSERT_TRUE(WaitForWorkerProcessCount(0)); |
| 404 } | 404 } |
| 405 | 405 |
| 406 // Flaky, http://crbug.com/70861. | 406 // Flaky, http://crbug.com/70861. |
| 407 // Times out regularly on Windows debug bots. See http://crbug.com/212339 . | 407 // Times out regularly on Windows debug bots. See http://crbug.com/212339 . |
| 408 #if defined(OS_WIN) && !defined(NDEBUG) | 408 #if defined(OS_WIN) && !defined(NDEBUG) |
| 409 #define MAYBE_QueuedSharedWorkerShutdown DISABLED_QueuedSharedWorkerShutdown | 409 #define MAYBE_QueuedSharedWorkerShutdown DISABLED_QueuedSharedWorkerShutdown |
| 410 #else | 410 #else |
| 411 #define MAYBE_QueuedSharedWorkerShutdown QueuedSharedWorkerShutdown | 411 #define MAYBE_QueuedSharedWorkerShutdown QueuedSharedWorkerShutdown |
| 412 #endif | 412 #endif |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // Run test. | 481 // Run test. |
| 482 Shell* window = shell(); | 482 Shell* window = shell(); |
| 483 const string16 expected_title = ASCIIToUTF16("OK"); | 483 const string16 expected_title = ASCIIToUTF16("OK"); |
| 484 TitleWatcher title_watcher(window->web_contents(), expected_title); | 484 TitleWatcher title_watcher(window->web_contents(), expected_title); |
| 485 NavigateToURL(window, url); | 485 NavigateToURL(window, url); |
| 486 string16 final_title = title_watcher.WaitAndGetTitle(); | 486 string16 final_title = title_watcher.WaitAndGetTitle(); |
| 487 EXPECT_EQ(expected_title, final_title); | 487 EXPECT_EQ(expected_title, final_title); |
| 488 } | 488 } |
| 489 | 489 |
| 490 } // namespace content | 490 } // namespace content |
| OLD | NEW |