Commit 022132ce authored by atwilson@chromium.org's avatar atwilson@chromium.org

Enabled a number of worker tests on various platforms.

Added new SingleSharedWorker and MultipleSharedWorker tests, and enabled a bunch of other tests after marking them flaky/excluding them from valgrind.

Review URL: http://codereview.chromium.org/490023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34429 0039d316-1c4b-4281-b951-d872f2087c98
parent 55beb13f
......@@ -14,6 +14,10 @@ UnloadTest.BrowserCloseInfiniteBeforeUnloadAlert
# See http://crbug.com/25917 and http://crbug.com/22608
WorkerTest.LimitTotal
# Occasionally fails under valgrind (http://crbug.com/28445)
WorkerTest.SingleWorker
WorkerTest.WorkerXhrHttpLayoutTests
# Don't run reference tests under Valgrind
# On the Mac, they don't have symbols, even, so suppressions don't work
# They probably don't have ThreadSanitizer annotations TODO(timurrrr): check
......
......@@ -13,7 +13,7 @@ var completed_worker_count = 0;
var total_workers = 4;
function createWorker(base) {
var worker = new Worker("worker_common.js");
var worker = getWorker("worker_common.js");
for (var i = 0; i < 100; i++) {
worker.postMessage("eval " + base + "+" + i);
expected_total += base + i;
......
......@@ -7,7 +7,7 @@
<script>
var worker = new Worker("worker_common.js");
var worker = getWorker("worker_common.js");
worker.postMessage("ping");
worker.onmessage = function(evt) {
if (evt.data == "pong")
......
if (!self.postMessage) {
// This is a shared worker - mimic dedicated worker APIs
onconnect = function(event) {
event.ports[0].onmessage = function(e) {
self.onmessage(e);
};
self.postMessage = function(msg, ports) {
event.ports[0].postMessage(msg, ports);
};
};
}
onmessage = function(evt) {
if (evt.data == "ping")
postMessage("pong");
......
var shared_worker_count = 0;
function getWorker(worker_url)
{
// Create either a dedicated or shared worker, depending on flags
var url = document.location.toString();
if (url.search("shared") >= 0) {
// Make a shared worker that looks like a worker
var worker = new SharedWorker(worker_url, "name" + ++shared_worker_count);
worker.port.onmessage = function(evt) {
worker.onmessage(evt);
};
worker.postMessage = function(msg, port) {
worker.port.postMessage(msg, port);
};
return worker;
} else {
return new Worker(worker_url);
}
}
function onSuccess()
{
setTimeout(onFinished, 0, "OK");
......
......@@ -77,11 +77,6 @@ class WorkerTest : public UILayoutTest {
};
#if defined(OS_LINUX)
// Fails running under valgrind, http://crbug.com/28445
#define SingleWorker DISABLED_SingleWorker
#endif
TEST_F(WorkerTest, SingleWorker) {
RunTest(L"single_worker.html");
}
......@@ -90,6 +85,14 @@ TEST_F(WorkerTest, MultipleWorkers) {
RunTest(L"multi_worker.html");
}
TEST_F(WorkerTest, SingleSharedWorker) {
RunTest(L"single_worker.html?shared=true");
}
TEST_F(WorkerTest, MultipleSharedWorkers) {
RunTest(L"multi_worker.html?shared=true");
}
#if defined(OS_LINUX)
#define IncognitoSharedWorkers FLAKY_IncognitoSharedWorkers
#endif
......@@ -103,7 +106,7 @@ TEST_F(WorkerTest, IncognitoSharedWorkers) {
}
#if defined(OS_LINUX) || defined (OS_MACOSX)
#define WorkerFastLayoutTests DISABLED_WorkerFastLayoutTests
#define WorkerFastLayoutTests FLAKY_WorkerFastLayoutTests
#endif
TEST_F(WorkerTest, WorkerFastLayoutTests) {
......@@ -162,7 +165,7 @@ TEST_F(WorkerTest, WorkerFastLayoutTests) {
// http://crbug.com/27636 - incorrect URL_MISMATCH exceptions sometimes get
// generated on the windows try bots.
// http://crbug.com/28445 - flakiness on mac
#define SharedWorkerFastLayoutTests DISABLED_SharedWorkerFastLayoutTests
#define SharedWorkerFastLayoutTests FLAKY_SharedWorkerFastLayoutTests
#endif
#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
......@@ -246,11 +249,6 @@ TEST_F(WorkerTest, WorkerHttpLayoutTests) {
StopHttpServer();
}
#if defined(OS_LINUX)
// Fails running under valgrind http://crbug.com/28445
#define WorkerXhrHttpLayoutTests DISABLED_WorkerXhrHttpLayoutTests
#endif
TEST_F(WorkerTest, WorkerXhrHttpLayoutTests) {
static const char* kLayoutTestFiles[] = {
"abort-exception-assert.html",
......@@ -326,10 +324,6 @@ TEST_F(WorkerTest, MessagePorts) {
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)
// This test fails after WebKit merge 49414:49432. (BUG=24652)
TEST_F(WorkerTest, LimitPerPage) {
int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate;
GURL url = GetTestUrl(L"workers", L"many_workers.html");
......@@ -341,12 +335,8 @@ TEST_F(WorkerTest, LimitPerPage) {
ASSERT_TRUE(WaitForProcessCountToBe(1, max_workers_per_tab));
}
#endif
#if defined(OS_LINUX)
// Fails (crashes) on Linux Tests: http://crbug.com/28445
#define LimitTotal DISABLED_LimitTotal
#elif defined(OS_MACOSX)
#if defined(OS_LINUX) || defined(OS_MACOSX)
// Doesn't crash, but on Mac it sometimes fails for a few runs in a row,
// http://crbug.com/28445
#define LimitTotal FLAKY_LimitTotal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment