| 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "chrome/browser/worker_host/worker_service.h" | 6 #include "chrome/browser/worker_host/worker_service.h" |
| 7 #include "chrome/test/automation/browser_proxy.h" | 7 #include "chrome/test/automation/browser_proxy.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 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 TEST_F(WorkerTest, SingleWorker) { | 53 TEST_F(WorkerTest, SingleWorker) { |
| 54 RunTest(L"single_worker.html"); | 54 RunTest(L"single_worker.html"); |
| 55 } | 55 } |
| 56 | 56 |
| 57 TEST_F(WorkerTest, MultipleWorkers) { | 57 TEST_F(WorkerTest, MultipleWorkers) { |
| 58 RunTest(L"multi_worker.html"); | 58 RunTest(L"multi_worker.html"); |
| 59 } | 59 } |
| 60 | 60 |
| 61 TEST_F(WorkerTest, DISABLED_WorkerFastLayoutTests) { | 61 #if defined(OS_LINUX) |
| 62 #define WorkerFastLayoutTests DISABLED_WorkerFastLayoutTests |
| 63 #endif |
| 64 |
| 65 TEST_F(WorkerTest, WorkerFastLayoutTests) { |
| 62 static const char* kLayoutTestFiles[] = { | 66 static const char* kLayoutTestFiles[] = { |
| 63 "stress-js-execution.html", | 67 "stress-js-execution.html", |
| 64 "use-machine-stack.html", | 68 "use-machine-stack.html", |
| 65 "worker-call.html", | 69 "worker-call.html", |
| 66 // Disabled because cloning ports are too slow in Chromium to meet the | 70 "worker-cloneport.html", |
| 67 // thresholds in this test. | |
| 68 // http://code.google.com/p/chromium/issues/detail?id=22780 | |
| 69 // "worker-cloneport.html", | |
| 70 | |
| 71 "worker-close.html", | 71 "worker-close.html", |
| 72 "worker-constructor.html", | 72 "worker-constructor.html", |
| 73 "worker-context-gc.html", | 73 "worker-context-gc.html", |
| 74 "worker-context-multi-port.html", | 74 "worker-context-multi-port.html", |
| 75 "worker-event-listener.html", | 75 "worker-event-listener.html", |
| 76 "worker-gc.html", | 76 "worker-gc.html", |
| 77 // worker-lifecycle.html relies on layoutTestController.workerThreadCount | 77 // worker-lifecycle.html relies on layoutTestController.workerThreadCount |
| 78 // which is not currently implemented. | 78 // which is not currently implemented. |
| 79 // "worker-lifecycle.html", | 79 // "worker-lifecycle.html", |
| 80 "worker-location.html", | 80 "worker-location.html", |
| 81 "worker-messageport.html", | 81 "worker-messageport.html", |
| 82 // Disabled after r27089 (WebKit merge), http://crbug.com/22947 | 82 // Disabled after r27089 (WebKit merge), http://crbug.com/22947 |
| 83 // "worker-messageport-gc.html", | 83 // "worker-messageport-gc.html", |
| 84 "worker-multi-port.html", | 84 "worker-multi-port.html", |
| 85 "worker-navigator.html", | 85 "worker-navigator.html", |
| 86 "worker-replace-global-constructor.html", | 86 "worker-replace-global-constructor.html", |
| 87 "worker-replace-self.html", | 87 "worker-replace-self.html", |
| 88 "worker-script-error.html", | 88 "worker-script-error.html", |
| 89 "worker-terminate.html", | 89 "worker-terminate.html", |
| 90 "worker-timeout.html" | 90 // clearInterval() sometimes lets the timer continue to fire |
| 91 // http://code.google.com/p/chromium/issues/detail?id=25548 |
| 92 // "worker-timeout.html" |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 FilePath fast_test_dir; | 95 FilePath fast_test_dir; |
| 94 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests"); | 96 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests"); |
| 95 fast_test_dir = fast_test_dir.AppendASCII("fast"); | 97 fast_test_dir = fast_test_dir.AppendASCII("fast"); |
| 96 | 98 |
| 97 FilePath worker_test_dir; | 99 FilePath worker_test_dir; |
| 98 worker_test_dir = worker_test_dir.AppendASCII("workers"); | 100 worker_test_dir = worker_test_dir.AppendASCII("workers"); |
| 99 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false); | 101 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false); |
| 100 | 102 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 window->AppendTab(url); | 237 window->AppendTab(url); |
| 236 | 238 |
| 237 // Check that we didn't create more than the max number of workers. | 239 // Check that we didn't create more than the max number of workers. |
| 238 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); | 240 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); |
| 239 | 241 |
| 240 // Now close a page and check that the queued workers were started. | 242 // Now close a page and check that the queued workers were started. |
| 241 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); | 243 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); |
| 242 | 244 |
| 243 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); | 245 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); |
| 244 } | 246 } |
| OLD | NEW |