summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DEPS3
-rw-r--r--chrome/chrome.gyp5
-rw-r--r--chrome/test/ui/ui_layout_test.cc19
-rw-r--r--chrome/test/ui/ui_layout_test.h2
-rw-r--r--chrome/worker/worker_uitest.cc43
-rw-r--r--webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/events/message-port-multi-expected.txt18
-rw-r--r--webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-context-multi-port-expected.txt16
-rw-r--r--webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-multi-port-expected.txt16
8 files changed, 120 insertions, 2 deletions
diff --git a/DEPS b/DEPS
index 413ac43..cfb0231 100644
--- a/DEPS
+++ b/DEPS
@@ -66,6 +66,9 @@ deps = {
"src/chrome/test/data/layout_tests/LayoutTests/fast/events":
Var("webkit_trunk") + "/LayoutTests/fast/events@" +
Var("webkit_revision"),
+ "src/chrome/test/data/layout_tests/LayoutTests/fast/js/resources":
+ Var("webkit_trunk") + "/LayoutTests/fast/js/resources@" +
+ Var("webkit_revision"),
"src/chrome/test/data/layout_tests/LayoutTests/fast/workers":
Var("webkit_trunk") + "/LayoutTests/fast/workers@" +
Var("webkit_revision"),
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 881fdff..0846bcb 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -3940,6 +3940,10 @@
],
}],
['OS=="mac"', {
+ 'sources': [
+ 'app/keystone_glue.h',
+ 'app/keystone_glue.m',
+ ],
'sources!': [
# TODO(port)
'app/chrome_main_uitest.cc',
@@ -3992,7 +3996,6 @@
'common/logging_chrome_uitest.cc',
'test/ui/npapi_uitest.cc',
'test/ui/sandbox_uitests.cc',
- 'worker/worker_uitest.cc',
],
}],
],
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index dc0a4a2..9fab8c0 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -142,6 +142,25 @@ void UILayoutTest::InitializeForLayoutTest(const FilePath& test_parent_dir,
ASSERT_TRUE(file_util::ReadFileToString(path, &layout_test_controller_));
}
+void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir,
+ const FilePath& resource_dir) {
+ FilePath root_dir;
+ PathService::Get(base::DIR_SOURCE_ROOT, &root_dir);
+
+ FilePath src_dir = root_dir.AppendASCII("chrome");
+ src_dir = src_dir.AppendASCII("test");
+ src_dir = src_dir.AppendASCII("data");
+ src_dir = src_dir.AppendASCII("layout_tests");
+ src_dir = src_dir.Append(parent_dir);
+ src_dir = src_dir.Append(resource_dir);
+ ASSERT_TRUE(file_util::DirectoryExists(src_dir));
+
+ FilePath dest_parent_dir = temp_test_dir_.Append(parent_dir);
+ ASSERT_TRUE(file_util::CreateDirectory(dest_parent_dir));
+ FilePath dest_dir = dest_parent_dir.Append(resource_dir);
+ ASSERT_TRUE(file_util::CopyDirectory(src_dir, dest_dir, true));
+}
+
void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name,
bool is_http_test) {
SCOPED_TRACE(test_case_file_name.c_str());
diff --git a/chrome/test/ui/ui_layout_test.h b/chrome/test/ui/ui_layout_test.h
index 49d6a63..3770478 100644
--- a/chrome/test/ui/ui_layout_test.h
+++ b/chrome/test/ui/ui_layout_test.h
@@ -16,6 +16,8 @@ class UILayoutTest : public UITest {
void InitializeForLayoutTest(const FilePath& test_parent_dir,
const FilePath& test_case_dir,
bool is_http_test);
+ void AddResourceForLayoutTest(const FilePath& parent_dir,
+ const FilePath& resource_dir);
void RunLayoutTest(const std::string& test_case_file_name,
bool is_http_test);
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc
index 4f1e189..15c4e3f 100644
--- a/chrome/worker/worker_uitest.cc
+++ b/chrome/worker/worker_uitest.cc
@@ -38,16 +38,28 @@ TEST_F(WorkerTest, MultipleWorkers) {
TEST_F(WorkerTest, WorkerFastLayoutTests) {
static const char* kLayoutTestFiles[] = {
"stress-js-execution.html",
+#if defined(OS_WIN)
+ // Workers don't properly initialize the V8 stack guard.
+ // (http://code.google.com/p/chromium/issues/detail?id=21653).
"use-machine-stack.html",
+#endif
"worker-call.html",
- //"worker-close.html",
+ "worker-cloneport.html",
+ // Disabled because worker exceptions outside of script eval() are not
+ // reported (http://code.google.com/p/chromium/issues/detail?id=20953)
+ // "worker-close.html",
"worker-constructor.html",
"worker-context-gc.html",
+ "worker-context-multi-port.html",
"worker-event-listener.html",
"worker-gc.html",
+ // worker-lifecycle.html relies on layoutTestController.workerThreadCount
+ // which is not currently implemented.
+ // "worker-lifecycle.html",
"worker-location.html",
"worker-messageport.html",
"worker-messageport-gc.html",
+ "worker-multi-port.html",
"worker-navigator.html",
"worker-replace-global-constructor.html",
"worker-replace-self.html",
@@ -64,6 +76,12 @@ TEST_F(WorkerTest, WorkerFastLayoutTests) {
worker_test_dir = worker_test_dir.AppendASCII("workers");
InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
+ // Worker tests also rely on common files in js/resources.
+ FilePath js_dir = fast_test_dir.AppendASCII("js");
+ FilePath resource_dir;
+ resource_dir = resource_dir.AppendASCII("resources");
+ AddResourceForLayoutTest(js_dir, resource_dir);
+
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
RunLayoutTest(kLayoutTestFiles[i], false);
}
@@ -71,7 +89,11 @@ TEST_F(WorkerTest, WorkerFastLayoutTests) {
TEST_F(WorkerTest, WorkerHttpLayoutTests) {
static const char* kLayoutTestFiles[] = {
// flakey? BUG 16934 "text-encoding.html",
+#if defined(OS_WIN)
+ // Fails on the mac (and linux?):
+ // http://code.google.com/p/chromium/issues/detail?id=22599
"worker-importScripts.html",
+#endif
"worker-redirect.html",
};
@@ -93,7 +115,11 @@ TEST_F(WorkerTest, WorkerHttpLayoutTests) {
TEST_F(WorkerTest, WorkerXhrHttpLayoutTests) {
static const char* kLayoutTestFiles[] = {
"abort-exception-assert.html",
+#if defined(OS_WIN)
+ // Fails on the mac (and linux?):
+ // http://code.google.com/p/chromium/issues/detail?id=22599
"close.html",
+#endif
//"methods-async.html",
//"methods.html",
"xmlhttprequest-file-not-found.html"
@@ -127,6 +153,7 @@ TEST_F(WorkerTest, MessagePorts) {
"message-port-deleted-document.html",
"message-port-deleted-frame.html",
"message-port-inactive-document.html",
+ "message-port-multi.html",
"message-port-no-wrapper.html",
// Only works with run-webkit-tests --leaks.
//"message-channel-listener-circular-ownership.html",
@@ -140,10 +167,19 @@ TEST_F(WorkerTest, MessagePorts) {
worker_test_dir = worker_test_dir.AppendASCII("events");
InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
+ // MessagePort tests also rely on common files in js/resources.
+ FilePath js_dir = fast_test_dir.AppendASCII("js");
+ FilePath resource_dir;
+ resource_dir = resource_dir.AppendASCII("resources");
+ AddResourceForLayoutTest(js_dir, resource_dir);
+
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
RunLayoutTest(kLayoutTestFiles[i], false);
}
+// Disable LimitPerPage on Linux. Seems to work on Mac though:
+// http://code.google.com/p/chromium/issues/detail?id=22608
+#if !defined(OS_LINUX)
TEST_F(WorkerTest, LimitPerPage) {
int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate;
GURL url = GetTestUrl(L"workers", L"many_workers.html");
@@ -156,7 +192,11 @@ TEST_F(WorkerTest, LimitPerPage) {
EXPECT_EQ(max_workers_per_tab + 1 + (UITest::in_process_renderer() ? 0 : 1),
UITest::GetBrowserProcessCount());
}
+#endif
+// Disable LimitTotal on Linux and Mac.
+// http://code.google.com/p/chromium/issues/detail?id=22608
+#if defined(OS_WIN)
TEST_F(WorkerTest, LimitTotal) {
int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate;
int total_workers = WorkerService::kMaxWorkersWhenSeparate;
@@ -183,3 +223,4 @@ TEST_F(WorkerTest, LimitTotal) {
EXPECT_EQ(total_workers + 1 + (UITest::in_process_renderer() ? 0 : tab_count),
UITest::GetBrowserProcessCount());
}
+#endif
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/events/message-port-multi-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/events/message-port-multi-expected.txt
new file mode 100644
index 0000000..981eb92f
--- /dev/null
+++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/events/message-port-multi-expected.txt
@@ -0,0 +1,18 @@
+This test checks the various use cases around sending multiple ports through MessagePort.postMessage
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS channel.port1.postMessage("same port", [channel.port1]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS channel.port1.postMessage("entangled port", [channel.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
+PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: MessagePortArray argument has no length attribute.
+PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
+PASS event.ports is null when no port sent
+PASS event.ports is null when empty array sent
+PASS event.ports contains two ports when two ports sent
+PASS event.ports contains two ports when two ports re-sent after error
+
+TEST COMPLETE
+
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-context-multi-port-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-context-multi-port-expected.txt
new file mode 100644
index 0000000..e66270f
--- /dev/null
+++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-context-multi-port-expected.txt
@@ -0,0 +1,16 @@
+This test checks the various use cases around sending multiple ports through WorkerGlobalScope.postMessage
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS event.ports is null when no port sent
+PASS event.ports is null when empty array sent
+PASS event.ports contains two ports when two ports sent
+PASS posting a null port did throw: Error: INVALID_STATE_ERR: DOM Exception 11
+PASS posting a non-port did throw: TypeError: MessagePortArray argument must contain only MessagePorts
+PASS event.ports contains two ports when two ports re-sent after error
+PASS posting a non-array did throw: TypeError: MessagePortArray argument has no length attribute
+PASS posting a non-sequence did throw: TypeError: MessagePortArray argument must contain only MessagePorts
+
+TEST COMPLETE
+
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-multi-port-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-multi-port-expected.txt
new file mode 100644
index 0000000..f11c74c
--- /dev/null
+++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-multi-port-expected.txt
@@ -0,0 +1,16 @@
+This test checks the various use cases around sending multiple ports through Worker.postMessage
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS worker.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS worker.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
+PASS worker.postMessage("notAnArray", channel3.port1) threw exception TypeError: MessagePortArray argument has no length attribute.
+PASS worker.postMessage("notASequence", [{length: 3}]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
+PASS event.ports is null when no port sent
+PASS event.ports is null when empty array sent
+PASS event.ports contains two ports when two ports sent
+PASS event.ports contains two ports when two ports re-sent after error
+
+TEST COMPLETE
+