summaryrefslogtreecommitdiffstats
path: root/chrome/worker
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 10:25:53 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 10:25:53 +0000
commita6fb1417e1c35469835a6066f5fadaeadd6bfb69 (patch)
tree700131027585983d6574b81bca69bd8c700be2c3 /chrome/worker
parentc2034d9a454ee55e048d601ff2f172d24b1a28c7 (diff)
downloadchromium_src-a6fb1417e1c35469835a6066f5fadaeadd6bfb69.zip
chromium_src-a6fb1417e1c35469835a6066f5fadaeadd6bfb69.tar.gz
chromium_src-a6fb1417e1c35469835a6066f5fadaeadd6bfb69.tar.bz2
Add LayoutTests/websocket/tests/worker support.
BUG=27618 TEST=none Review URL: http://codereview.chromium.org/460106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r--chrome/worker/worker_uitest.cc43
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc2
2 files changed, 34 insertions, 11 deletions
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc
index a9e8695..72f8af6 100644
--- a/chrome/worker/worker_uitest.cc
+++ b/chrome/worker/worker_uitest.cc
@@ -115,7 +115,7 @@ class WorkerTest : public UILayoutTest {
FilePath worker_test_dir;
worker_test_dir = worker_test_dir.AppendASCII("workers");
- InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
+ InitializeForLayoutTest(fast_test_dir, worker_test_dir, kNoHttpPort);
// Worker tests also rely on common files in js/resources.
FilePath js_dir = fast_test_dir.AppendASCII("js");
@@ -126,7 +126,7 @@ class WorkerTest : public UILayoutTest {
for (size_t i = 0; i < arraysize(kWorkerFastLayoutTestFiles); ++i) {
if ((i % kWorkerFastLayoutTestShards) == shard) {
printf ("Test: %s\n", kWorkerFastLayoutTestFiles[i]);
- RunLayoutTest(kWorkerFastLayoutTestFiles[i], false);
+ RunLayoutTest(kWorkerFastLayoutTestFiles[i], kNoHttpPort);
}
}
@@ -233,7 +233,7 @@ TEST_F(WorkerTest, SharedWorkerFastLayoutTests) {
FilePath worker_test_dir;
worker_test_dir = worker_test_dir.AppendASCII("workers");
- InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
+ InitializeForLayoutTest(fast_test_dir, worker_test_dir, kNoHttpPort);
// Worker tests also rely on common files in js/resources.
FilePath js_dir = fast_test_dir.AppendASCII("js");
@@ -242,7 +242,7 @@ TEST_F(WorkerTest, SharedWorkerFastLayoutTests) {
AddResourceForLayoutTest(js_dir, resource_dir);
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) {
- RunLayoutTest(kLayoutTestFiles[i], false);
+ RunLayoutTest(kLayoutTestFiles[i], kNoHttpPort);
// Shared workers will error out if we ever have more than one tab open.
int window_count = 0;
ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
@@ -271,14 +271,37 @@ TEST_F(WorkerTest, WorkerHttpLayoutTests) {
FilePath worker_test_dir;
worker_test_dir = worker_test_dir.AppendASCII("workers");
- InitializeForLayoutTest(http_test_dir, worker_test_dir, true);
+ InitializeForLayoutTest(http_test_dir, worker_test_dir, kHttpPort);
StartHttpServer(new_http_root_dir_);
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
- RunLayoutTest(kLayoutTestFiles[i], true);
+ RunLayoutTest(kLayoutTestFiles[i], kHttpPort);
StopHttpServer();
}
+TEST_F(WorkerTest, WorkerWebSocketLayoutTests) {
+ static const char* kLayoutTestFiles[] = {
+ "worker-simple.html",
+ };
+
+ FilePath websocket_test_dir;
+ websocket_test_dir = websocket_test_dir.AppendASCII("LayoutTests");
+ websocket_test_dir = websocket_test_dir.AppendASCII("websocket");
+ websocket_test_dir = websocket_test_dir.AppendASCII("tests");
+
+ FilePath worker_test_dir;
+ worker_test_dir = worker_test_dir.AppendASCII("workers");
+ InitializeForLayoutTest(websocket_test_dir, worker_test_dir, kWebSocketPort);
+ test_case_dir_ = test_case_dir_.AppendASCII("websocket");
+ test_case_dir_ = test_case_dir_.AppendASCII("tests");
+ test_case_dir_ = test_case_dir_.AppendASCII("workers");
+
+ StartWebSocketServer(temp_test_dir_.AppendASCII("LayoutTests"));
+ for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
+ RunLayoutTest(kLayoutTestFiles[i], kWebSocketPort);
+ StopWebSocketServer();
+}
+
TEST_F(WorkerTest, WorkerXhrHttpLayoutTests) {
static const char* kLayoutTestFiles[] = {
"abort-exception-assert.html",
@@ -310,11 +333,11 @@ TEST_F(WorkerTest, WorkerXhrHttpLayoutTests) {
FilePath worker_test_dir;
worker_test_dir = worker_test_dir.AppendASCII("xmlhttprequest");
worker_test_dir = worker_test_dir.AppendASCII("workers");
- InitializeForLayoutTest(http_test_dir, worker_test_dir, true);
+ InitializeForLayoutTest(http_test_dir, worker_test_dir, kHttpPort);
StartHttpServer(new_http_root_dir_);
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
- RunLayoutTest(kLayoutTestFiles[i], true);
+ RunLayoutTest(kLayoutTestFiles[i], kHttpPort);
StopHttpServer();
}
@@ -342,7 +365,7 @@ TEST_F(WorkerTest, MessagePorts) {
FilePath worker_test_dir;
worker_test_dir = worker_test_dir.AppendASCII("events");
- InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
+ InitializeForLayoutTest(fast_test_dir, worker_test_dir, kNoHttpPort);
// MessagePort tests also rely on common files in js/resources.
FilePath js_dir = fast_test_dir.AppendASCII("js");
@@ -351,7 +374,7 @@ TEST_F(WorkerTest, MessagePorts) {
AddResourceForLayoutTest(js_dir, resource_dir);
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
- RunLayoutTest(kLayoutTestFiles[i], false);
+ RunLayoutTest(kLayoutTestFiles[i], kNoHttpPort);
}
#if defined(OS_LINUX)
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc
index bb8bb04..fbc6505 100644
--- a/chrome/worker/worker_webkitclient_impl.cc
+++ b/chrome/worker/worker_webkitclient_impl.cc
@@ -64,7 +64,7 @@ void WorkerWebKitClientImpl::setCookies(const WebURL& url,
WebString WorkerWebKitClientImpl::cookies(
const WebURL& url, const WebURL& first_party_for_cookies) {
- NOTREACHED();
+ // WebSocketHandshake may access cookies in worker process.
return WebString();
}