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/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/worker_host/worker_service.h" | 10 #include "chrome/browser/worker_host/worker_service.h" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/chrome_switches.h" | |
13 #include "chrome/test/automation/browser_proxy.h" | 12 #include "chrome/test/automation/browser_proxy.h" |
14 #include "chrome/test/automation/tab_proxy.h" | 13 #include "chrome/test/automation/tab_proxy.h" |
15 #include "chrome/test/ui/ui_test.h" | 14 #include "chrome/test/ui/ui_test.h" |
16 #include "net/base/escape.h" | 15 #include "net/base/escape.h" |
17 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
18 | 17 |
19 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
20 const char kPlatformName[] = "chromium-win"; | 19 const char kPlatformName[] = "chromium-win"; |
21 #elif defined(OS_MACOSX) | 20 #elif defined(OS_MACOSX) |
22 const char kPlatformName[] = "chromium-mac"; | 21 const char kPlatformName[] = "chromium-mac"; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 276 |
278 TEST_F(WorkerTest, MultipleWorkers) { | 277 TEST_F(WorkerTest, MultipleWorkers) { |
279 RunTest(L"multi_worker.html"); | 278 RunTest(L"multi_worker.html"); |
280 } | 279 } |
281 | 280 |
282 TEST_F(WorkerTest, WorkerFastLayoutTests) { | 281 TEST_F(WorkerTest, WorkerFastLayoutTests) { |
283 static const char* kLayoutTestFiles[] = { | 282 static const char* kLayoutTestFiles[] = { |
284 "stress-js-execution.html", | 283 "stress-js-execution.html", |
285 "use-machine-stack.html", | 284 "use-machine-stack.html", |
286 "worker-close.html", | 285 "worker-close.html", |
287 "worker-constructor.html", | 286 //"worker-constructor.html", |
288 "worker-context-gc.html", | 287 "worker-context-gc.html", |
289 "worker-event-listener.html", | 288 "worker-event-listener.html", |
290 "worker-gc.html", | 289 "worker-gc.html", |
291 "worker-location.html", | 290 "worker-location.html", |
292 "worker-navigator.html", | 291 "worker-navigator.html", |
293 "worker-replace-global-constructor.html", | 292 "worker-replace-global-constructor.html", |
294 "worker-replace-self.html", | 293 "worker-replace-self.html", |
295 "worker-terminate.html", | 294 "worker-terminate.html", |
296 "worker-timeout.html" | 295 "worker-timeout.html" |
297 }; | 296 }; |
298 | 297 |
299 FilePath fast_test_dir; | 298 FilePath fast_test_dir; |
300 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests"); | 299 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests"); |
301 fast_test_dir = fast_test_dir.AppendASCII("fast"); | 300 fast_test_dir = fast_test_dir.AppendASCII("fast"); |
302 | 301 |
303 FilePath worker_test_dir; | 302 FilePath worker_test_dir; |
304 worker_test_dir = worker_test_dir.AppendASCII("workers"); | 303 worker_test_dir = worker_test_dir.AppendASCII("workers"); |
305 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false); | 304 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false); |
306 | 305 |
307 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) | 306 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) |
308 RunLayoutTest(kLayoutTestFiles[i], false); | 307 RunLayoutTest(kLayoutTestFiles[i], false); |
309 } | 308 } |
310 | 309 |
311 TEST_F(WorkerTest, WorkerHttpLayoutTests) { | 310 TEST_F(WorkerTest, WorkerHttpLayoutTests) { |
312 static const char* kLayoutTestFiles[] = { | 311 static const char* kLayoutTestFiles[] = { |
313 "text-encoding.html", | 312 "text-encoding.html", |
314 "worker-importScripts.html", | 313 "worker-importScripts.html", |
315 "worker-redirect.html", | 314 //"worker-redirect.html", |
316 }; | 315 }; |
317 | 316 |
318 FilePath http_test_dir; | 317 FilePath http_test_dir; |
319 http_test_dir = http_test_dir.AppendASCII("LayoutTests"); | 318 http_test_dir = http_test_dir.AppendASCII("LayoutTests"); |
320 http_test_dir = http_test_dir.AppendASCII("http"); | 319 http_test_dir = http_test_dir.AppendASCII("http"); |
321 http_test_dir = http_test_dir.AppendASCII("tests"); | 320 http_test_dir = http_test_dir.AppendASCII("tests"); |
322 | 321 |
323 FilePath worker_test_dir; | 322 FilePath worker_test_dir; |
324 worker_test_dir = worker_test_dir.AppendASCII("workers"); | 323 worker_test_dir = worker_test_dir.AppendASCII("workers"); |
325 InitializeForLayoutTest(http_test_dir, worker_test_dir, true); | 324 InitializeForLayoutTest(http_test_dir, worker_test_dir, true); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), | 386 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), |
388 UITest::GetBrowserProcessCount()); | 387 UITest::GetBrowserProcessCount()); |
389 | 388 |
390 // Now close the first tab and check that the queued workers were started. | 389 // Now close the first tab and check that the queued workers were started. |
391 tab->Close(true); | 390 tab->Close(true); |
392 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); | 391 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); |
393 | 392 |
394 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), | 393 EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count), |
395 UITest::GetBrowserProcessCount()); | 394 UITest::GetBrowserProcessCount()); |
396 } | 395 } |
OLD | NEW |