Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "googleurl/src/gurl.h" | 25 #include "googleurl/src/gurl.h" |
| 26 | 26 |
| 27 using content::BrowserThread; | 27 using content::BrowserThread; |
| 28 using content::WorkerServiceImpl; | 28 using content::WorkerServiceImpl; |
| 29 | 29 |
| 30 class WorkerLayoutTest : public InProcessBrowserLayoutTest { | 30 class WorkerLayoutTest : public InProcessBrowserLayoutTest { |
| 31 public: | 31 public: |
| 32 WorkerLayoutTest() : InProcessBrowserLayoutTest( | 32 WorkerLayoutTest() : InProcessBrowserLayoutTest( |
| 33 FilePath(), FilePath().AppendASCII("fast").AppendASCII("workers")) { | 33 FilePath(), FilePath().AppendASCII("fast").AppendASCII("workers")) { |
| 34 } | 34 } |
| 35 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 36 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); | |
| 37 AddResourceForLayoutTest( | |
| 38 FilePath().AppendASCII("fast").AppendASCII("js"), | |
| 39 FilePath().AppendASCII("resources")); | |
| 40 } | |
| 41 }; | 35 }; |
| 42 | 36 |
| 43 // Crashy, http://crbug.com/35965. | 37 // Crashy, http://crbug.com/35965. |
| 44 // Flaky, http://crbug.com/36555. | 38 // Flaky, http://crbug.com/36555. |
| 45 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, DISABLED_WorkerClonePort) { | 39 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, DISABLED_WorkerClonePort) { |
| 46 RunLayoutTest("worker-cloneport.html"); | 40 RunLayoutTest("worker-cloneport.html"); |
| 47 } | 41 } |
| 48 | 42 |
| 49 // http://crbug.com/101996 (started flaking with WebKit roll 98537:98582). | 43 // http://crbug.com/101996 (started flaking with WebKit roll 98537:98582). |
| 50 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerContextMultiPort) { | 44 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, WorkerContextMultiPort) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 | 120 |
| 127 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, SharedWorkerFastSimple) { | 121 IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, SharedWorkerFastSimple) { |
| 128 RunLayoutTest("shared-worker-simple.html"); | 122 RunLayoutTest("shared-worker-simple.html"); |
| 129 } | 123 } |
| 130 | 124 |
| 131 class MessagePortTest : public InProcessBrowserLayoutTest { | 125 class MessagePortTest : public InProcessBrowserLayoutTest { |
| 132 public: | 126 public: |
| 133 MessagePortTest() : InProcessBrowserLayoutTest( | 127 MessagePortTest() : InProcessBrowserLayoutTest( |
| 134 FilePath(), FilePath().AppendASCII("fast").AppendASCII("events")) { | 128 FilePath(), FilePath().AppendASCII("fast").AppendASCII("events")) { |
| 135 } | 129 } |
| 136 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 137 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); | |
| 138 AddResourceForLayoutTest( | |
| 139 FilePath().AppendASCII("fast").AppendASCII("js"), | |
| 140 FilePath().AppendASCII("resources")); | |
| 141 } | |
| 142 }; | 130 }; |
| 143 | 131 |
| 144 // Flaky, http://crbug.com/34996. | 132 // Flaky, http://crbug.com/34996. |
| 145 IN_PROC_BROWSER_TEST_F(MessagePortTest, Tests) { | 133 IN_PROC_BROWSER_TEST_F(MessagePortTest, Tests) { |
| 146 static const char* kLayoutTestFiles[] = { | 134 static const char* kLayoutTestFiles[] = { |
| 147 "message-channel-gc.html", | 135 "message-channel-gc.html", |
| 148 "message-channel-gc-2.html", | 136 "message-channel-gc-2.html", |
| 149 "message-channel-gc-3.html", | 137 "message-channel-gc-3.html", |
| 150 "message-channel-gc-4.html", | 138 "message-channel-gc-4.html", |
| 151 "message-port.html", | 139 "message-port.html", |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 168 class WorkerHttpLayoutTest : public InProcessBrowserLayoutTest { | 156 class WorkerHttpLayoutTest : public InProcessBrowserLayoutTest { |
| 169 public: | 157 public: |
| 170 // The resources for these tests hardcode 8000, so must use that here. If | 158 // The resources for these tests hardcode 8000, so must use that here. If |
| 171 // multiple tests which use it run in parallel, then the test will fail but | 159 // multiple tests which use it run in parallel, then the test will fail but |
| 172 // it'll run again at the end in serial and pass. | 160 // it'll run again at the end in serial and pass. |
| 173 WorkerHttpLayoutTest() : InProcessBrowserLayoutTest( | 161 WorkerHttpLayoutTest() : InProcessBrowserLayoutTest( |
| 174 FilePath().AppendASCII("http").AppendASCII("tests"), | 162 FilePath().AppendASCII("http").AppendASCII("tests"), |
| 175 FilePath().AppendASCII("workers"), | 163 FilePath().AppendASCII("workers"), |
| 176 8000) { | 164 8000) { |
| 177 } | 165 } |
| 178 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 179 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); | |
| 180 AddResourceForLayoutTest( | |
| 181 FilePath().AppendASCII("http").AppendASCII("tests"), | |
| 182 FilePath().AppendASCII("resources")); | |
| 183 } | |
| 184 }; | 166 }; |
| 185 | 167 |
| 186 // http://crbug.com/16934 | 168 // http://crbug.com/16934 |
| 187 IN_PROC_BROWSER_TEST_F(WorkerHttpLayoutTest, DISABLED_Tests) { | 169 IN_PROC_BROWSER_TEST_F(WorkerHttpLayoutTest, DISABLED_Tests) { |
| 188 static const char* kLayoutTestFiles[] = { | 170 static const char* kLayoutTestFiles[] = { |
| 189 "shared-worker-importScripts.html", | 171 "shared-worker-importScripts.html", |
| 190 "shared-worker-redirect.html", | 172 "shared-worker-redirect.html", |
| 191 "text-encoding.html", | 173 "text-encoding.html", |
| 192 #if defined(OS_WIN) | 174 #if defined(OS_WIN) |
| 193 // Fails on the mac (and linux?): | 175 // Fails on the mac (and linux?): |
| 194 // http://code.google.com/p/chromium/issues/detail?id=22599 | 176 // http://code.google.com/p/chromium/issues/detail?id=22599 |
| 195 "worker-importScripts.html", | 177 "worker-importScripts.html", |
| 196 #endif | 178 #endif |
| 197 "worker-redirect.html", | 179 "worker-redirect.html", |
| 198 }; | 180 }; |
| 199 | 181 |
| 200 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) | 182 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) |
| 201 RunHttpLayoutTest(kLayoutTestFiles[i]); | 183 RunHttpLayoutTest(kLayoutTestFiles[i]); |
| 202 } | 184 } |
| 203 | 185 |
| 204 class WorkerXHRHttpLayoutTest : public InProcessBrowserLayoutTest { | 186 class WorkerXHRHttpLayoutTest : public InProcessBrowserLayoutTest { |
| 205 public: | 187 public: |
| 206 WorkerXHRHttpLayoutTest() : InProcessBrowserLayoutTest( | 188 WorkerXHRHttpLayoutTest() : InProcessBrowserLayoutTest( |
| 207 FilePath().AppendASCII("http").AppendASCII("tests"), | 189 FilePath().AppendASCII("http").AppendASCII("tests"), |
| 208 FilePath().AppendASCII("xmlhttprequest").AppendASCII("workers"), | 190 FilePath().AppendASCII("xmlhttprequest").AppendASCII("workers"), |
| 209 -1) { | 191 -1) { |
| 210 } | 192 } |
| 211 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 212 InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); | |
| 213 AddResourceForLayoutTest( | |
| 214 FilePath().AppendASCII("http").AppendASCII("tests"), | |
| 215 FilePath().AppendASCII("workers").AppendASCII("resources")); | |
| 216 } | |
| 217 }; | 193 }; |
| 218 | 194 |
| 219 IN_PROC_BROWSER_TEST_F(WorkerXHRHttpLayoutTest, Tests) { | 195 IN_PROC_BROWSER_TEST_F(WorkerXHRHttpLayoutTest, Tests) { |
| 220 static const char* kLayoutTestFiles[] = { | 196 static const char* kLayoutTestFiles[] = { |
| 221 "abort-exception-assert.html", | 197 // worker thread count never drops to zero. |
| 198 // http://crbug.com/150565 | |
| 199 // "abort-exception-assert.html", | |
|
jam
2012/09/18 20:04:08
how did this work before?
jam
2012/09/18 20:29:53
ah, ok, lgtm
| |
| 222 #if defined(OS_WIN) | 200 #if defined(OS_WIN) |
| 223 // Fails on the mac (and linux?): | 201 // Fails on the mac (and linux?): |
| 224 // http://code.google.com/p/chromium/issues/detail?id=22599 | 202 // http://code.google.com/p/chromium/issues/detail?id=22599 |
| 225 "close.html", | 203 "close.html", |
| 226 #endif | 204 #endif |
| 227 // These tests (and the shared-worker versions below) are disabled due to | 205 // These tests (and the shared-worker versions below) are disabled due to |
| 228 // limitations in lighttpd (doesn't handle all of the HTTP methods). | 206 // limitations in lighttpd (doesn't handle all of the HTTP methods). |
| 229 // "methods-async.html", | 207 // "methods-async.html", |
| 230 // "methods.html", | 208 // "methods.html", |
| 231 | 209 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 | 473 |
| 496 // First window has hit its limit. Now launch second window which creates | 474 // First window has hit its limit. Now launch second window which creates |
| 497 // the same worker that was queued in the first window, to ensure it gets | 475 // the same worker that was queued in the first window, to ensure it gets |
| 498 // connected to the first window too. | 476 // connected to the first window too. |
| 499 query = StringPrintf("?id=%d", max_workers_per_tab); | 477 query = StringPrintf("?id=%d", max_workers_per_tab); |
| 500 url = GetTestURL("single_shared_worker.html", query); | 478 url = GetTestURL("single_shared_worker.html", query); |
| 501 content::NavigateToURL(CreateBrowser(), url); | 479 content::NavigateToURL(CreateBrowser(), url); |
| 502 | 480 |
| 503 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); | 481 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); |
| 504 } | 482 } |
| OLD | NEW |