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/file_path.h" | 6 #include "base/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/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 35 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
36 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); | 36 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); |
37 AddResourceForLayoutTest( | 37 AddResourceForLayoutTest( |
38 FilePath().AppendASCII("fast").AppendASCII("js"), | 38 FilePath().AppendASCII("fast").AppendASCII("js"), |
39 FilePath().AppendASCII("resources")); | 39 FilePath().AppendASCII("resources")); |
40 } | 40 } |
41 }; | 41 }; |
42 | 42 |
43 // Crashy, http://crbug.com/35965. | 43 // Crashy, http://crbug.com/35965. |
44 // Flaky, http://crbug.com/36555. | 44 // Flaky, http://crbug.com/36555. |
45 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, DISABLED_WorkerClonePort) { | 45 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerClonePort) { |
46 RunLayoutTest("worker-cloneport.html"); | 46 RunLayoutTest("worker-cloneport.html"); |
47 } | 47 } |
48 | 48 |
49 // http://crbug.com/101996 (started flaking with WebKit roll 98537:98582). | 49 // http://crbug.com/101996 (started flaking with WebKit roll 98537:98582). |
50 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerContextMultiPort) { | 50 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerContextMultiPort) { |
51 RunLayoutTest("worker-context-multi-port.html"); | 51 RunLayoutTest("worker-context-multi-port.html"); |
52 } | 52 } |
53 | 53 |
54 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerMessagePort) { | 54 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerMessagePort) { |
55 RunLayoutTest("worker-messageport.html"); | 55 RunLayoutTest("worker-messageport.html"); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 // workers shut down. | 455 // workers shut down. |
456 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; | 456 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; |
457 std::string query = StringPrintf("?count=%d", max_workers_per_tab); | 457 std::string query = StringPrintf("?count=%d", max_workers_per_tab); |
458 RunTest("queued_shared_worker_shutdown.html", query); | 458 RunTest("queued_shared_worker_shutdown.html", query); |
459 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 459 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
460 } | 460 } |
461 | 461 |
462 // Flaky, http://crbug.com/69881. | 462 // Flaky, http://crbug.com/69881. |
463 // Sometimes triggers | 463 // Sometimes triggers |
464 // Check failed: message_ports_[message_port_id].queued_messages.empty(). | 464 // Check failed: message_ports_[message_port_id].queued_messages.empty(). |
465 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_MultipleTabsQueuedSharedWorker) { | 465 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleTabsQueuedSharedWorker) { |
466 // Tests to make sure that only one instance of queued shared workers are | 466 // Tests to make sure that only one instance of queued shared workers are |
467 // started up even when those instances are on multiple tabs. | 467 // started up even when those instances are on multiple tabs. |
468 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; | 468 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; |
469 std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); | 469 std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); |
470 GURL url = GetTestURL("many_shared_workers.html", query); | 470 GURL url = GetTestURL("many_shared_workers.html", query); |
471 content::NavigateToURL(shell(), url); | 471 content::NavigateToURL(shell(), url); |
472 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 472 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
473 | 473 |
474 // Create same set of workers in new tab (leaves one worker queued from this | 474 // Create same set of workers in new tab (leaves one worker queued from this |
475 // tab). | 475 // tab). |
476 url = GetTestURL("many_shared_workers.html", query); | 476 url = GetTestURL("many_shared_workers.html", query); |
477 content::NavigateToURL(CreateBrowser(), url); | 477 content::NavigateToURL(CreateBrowser(), url); |
478 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 478 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
479 | 479 |
480 // Now shutdown one of the shared workers - this will fire both queued | 480 // Now shutdown one of the shared workers - this will fire both queued |
481 // workers, but only one instance should be started. | 481 // workers, but only one instance should be started. |
482 url = GetTestURL("shutdown_shared_worker.html", "?id=0"); | 482 url = GetTestURL("shutdown_shared_worker.html", "?id=0"); |
483 content::NavigateToURL(CreateBrowser(), url); | 483 content::NavigateToURL(CreateBrowser(), url); |
484 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 484 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
485 } | 485 } |
486 | 486 |
487 // Flaky: http://crbug.com/48148 | 487 // Flaky: http://crbug.com/48148 |
488 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_QueuedSharedWorkerStartedFromOtherTa
b) { | 488 IN_PROC_BROWSER_TEST_F(WorkerTest, QueuedSharedWorkerStartedFromOtherTab) { |
489 // Tests to make sure that queued shared workers are started up when | 489 // Tests to make sure that queued shared workers are started up when |
490 // an instance is launched from another tab. | 490 // an instance is launched from another tab. |
491 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; | 491 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; |
492 std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); | 492 std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); |
493 GURL url = GetTestURL("many_shared_workers.html", query); | 493 GURL url = GetTestURL("many_shared_workers.html", query); |
494 content::NavigateToURL(shell(), url); | 494 content::NavigateToURL(shell(), url); |
495 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 495 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
496 | 496 |
497 // First window has hit its limit. Now launch second window which creates | 497 // First window has hit its limit. Now launch second window which creates |
498 // the same worker that was queued in the first window, to ensure it gets | 498 // the same worker that was queued in the first window, to ensure it gets |
499 // connected to the first window too. | 499 // connected to the first window too. |
500 query = StringPrintf("?id=%d", max_workers_per_tab); | 500 query = StringPrintf("?id=%d", max_workers_per_tab); |
501 url = GetTestURL("single_shared_worker.html", query); | 501 url = GetTestURL("single_shared_worker.html", query); |
502 content::NavigateToURL(CreateBrowser(), url); | 502 content::NavigateToURL(CreateBrowser(), url); |
503 | 503 |
504 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); | 504 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); |
505 } | 505 } |
OLD | NEW |