| 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 "chrome/browser/worker_host/worker_service.h" | 5 #include "chrome/browser/worker_host/worker_service.h" |
| 6 #include "chrome/test/automation/browser_proxy.h" | 6 #include "chrome/test/automation/browser_proxy.h" |
| 7 #include "chrome/test/automation/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
| 8 #include "chrome/test/ui/ui_layout_test.h" | 8 #include "chrome/test/ui/ui_layout_test.h" |
| 9 | 9 |
| 10 static const char kTestCompleteCookie[] = "status"; | 10 static const char kTestCompleteCookie[] = "status"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 TEST_F(WorkerTest, SingleWorker) { | 30 TEST_F(WorkerTest, SingleWorker) { |
| 31 RunTest(L"single_worker.html"); | 31 RunTest(L"single_worker.html"); |
| 32 } | 32 } |
| 33 | 33 |
| 34 TEST_F(WorkerTest, MultipleWorkers) { | 34 TEST_F(WorkerTest, MultipleWorkers) { |
| 35 RunTest(L"multi_worker.html"); | 35 RunTest(L"multi_worker.html"); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // WorkerFastLayoutTests works on the linux try servers, but fails on the |
| 39 // build bots. |
| 40 #if !defined(OS_LINUX) |
| 38 TEST_F(WorkerTest, WorkerFastLayoutTests) { | 41 TEST_F(WorkerTest, WorkerFastLayoutTests) { |
| 39 static const char* kLayoutTestFiles[] = { | 42 static const char* kLayoutTestFiles[] = { |
| 40 "stress-js-execution.html", | 43 "stress-js-execution.html", |
| 41 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 42 // Workers don't properly initialize the V8 stack guard. | 45 // Workers don't properly initialize the V8 stack guard. |
| 43 // (http://code.google.com/p/chromium/issues/detail?id=21653). | 46 // (http://code.google.com/p/chromium/issues/detail?id=21653). |
| 44 "use-machine-stack.html", | 47 "use-machine-stack.html", |
| 45 #endif | 48 #endif |
| 46 "worker-call.html", | 49 "worker-call.html", |
| 47 // Disabled because cloning ports are too slow in Chromium to meet the | 50 // Disabled because cloning ports are too slow in Chromium to meet the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 85 |
| 83 // Worker tests also rely on common files in js/resources. | 86 // Worker tests also rely on common files in js/resources. |
| 84 FilePath js_dir = fast_test_dir.AppendASCII("js"); | 87 FilePath js_dir = fast_test_dir.AppendASCII("js"); |
| 85 FilePath resource_dir; | 88 FilePath resource_dir; |
| 86 resource_dir = resource_dir.AppendASCII("resources"); | 89 resource_dir = resource_dir.AppendASCII("resources"); |
| 87 AddResourceForLayoutTest(js_dir, resource_dir); | 90 AddResourceForLayoutTest(js_dir, resource_dir); |
| 88 | 91 |
| 89 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) | 92 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) |
| 90 RunLayoutTest(kLayoutTestFiles[i], false); | 93 RunLayoutTest(kLayoutTestFiles[i], false); |
| 91 } | 94 } |
| 95 #endif // !defined(OS_LINUX) |
| 92 | 96 |
| 93 TEST_F(WorkerTest, WorkerHttpLayoutTests) { | 97 TEST_F(WorkerTest, WorkerHttpLayoutTests) { |
| 94 static const char* kLayoutTestFiles[] = { | 98 static const char* kLayoutTestFiles[] = { |
| 95 // flakey? BUG 16934 "text-encoding.html", | 99 // flakey? BUG 16934 "text-encoding.html", |
| 96 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
| 97 // Fails on the mac (and linux?): | 101 // Fails on the mac (and linux?): |
| 98 // http://code.google.com/p/chromium/issues/detail?id=22599 | 102 // http://code.google.com/p/chromium/issues/detail?id=22599 |
| 99 "worker-importScripts.html", | 103 "worker-importScripts.html", |
| 100 #endif | 104 #endif |
| 101 "worker-redirect.html", | 105 "worker-redirect.html", |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 UITest::GetBrowserProcessCount()); | 225 UITest::GetBrowserProcessCount()); |
| 222 | 226 |
| 223 // Now close the first tab and check that the queued workers were started. | 227 // Now close the first tab and check that the queued workers were started. |
| 224 tab->Close(true); | 228 tab->Close(true); |
| 225 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); | 229 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); |
| 226 | 230 |
| 227 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), | 231 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), |
| 228 UITest::GetBrowserProcessCount()); | 232 UITest::GetBrowserProcessCount()); |
| 229 } | 233 } |
| 230 #endif | 234 #endif |
| OLD | NEW |