Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: LayoutTests/http/tests/workers/terminate-during-sync-operation.html

Issue 293363014: Split termiante-during-sync-operation.html into three. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/workers/terminate-during-sync-operation.html
diff --git a/LayoutTests/http/tests/workers/terminate-during-sync-operation.html b/LayoutTests/http/tests/workers/terminate-during-sync-operation.html
deleted file mode 100644
index 8489bafcb82c7b227d535e9a4d386dc6b5d28cc3..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/workers/terminate-during-sync-operation.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<html>
-<head>
-<script src='resources/worker-util.js'></script>
-<script>
-var workersStarted;
-var workersClosed;
-
-var testNumber = -1;
-var syncOperationTests = new Array('openDatabaseSync', 'requestFileSystemSync', 'fileSyncOperations');
-
-// 30 workers seemed to cause the crash to happen frequently.
-var workers = new Array(30);
-
-function startNextTest()
-{
- testNumber++;
- log('Waiting for all workers to exit.');
- if (testNumber >= syncOperationTests.length) {
- waitUntilWorkerThreadsExit(done)
- return;
- }
- waitUntilWorkerThreadsExit(startWorkers)
-}
-
-function startWorkers()
-{
- log('Testing interrupting: ' + syncOperationTests[testNumber]);
- log('Starting workers.');
- workersStarted = 0;
- workersClosed = 0;
- for (var i = 0; i < workers.length; ++i) {
- workers[i] = new Worker('resources/sync-operations.js?arg=' + i)
- workers[i].onmessage = onWorkerStarted;
- }
-}
-
-// Do our best to try to interrupt the database open
-// call by waiting for the worker to start and then
-// telling it to do the open database call (and
-// then terminate the worker).
-function onWorkerStarted()
-{
- workersStarted++;
- log('Started worker count: ' + workersStarted);
- if (workersStarted < workers.length)
- return;
-
- log('Running operation.');
- for (var i = 0; i < workers.length; ++i)
- workers[i].postMessage(syncOperationTests[testNumber]);
-
- setTimeout('closeWorker()', 0);
-}
-
-function closeWorker()
-{
- workers[workersClosed].terminate();
- workersClosed++;
- log('Closed worker count: ' + workersClosed);
- if (workersClosed < workers.length)
- setTimeout('closeWorker()', 3);
- else
- startNextTest();
-}
-
-function runTest()
-{
- log('Starting test run.');
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
- startNextTest();
-}
-</script>
-</head>
-<body onload='runTest()'>
-<p>Test that terminating the worker while it is performing synchronous file or database operations will not cause any crashes, asserts, etc.</p>
-<div id='result'>
-</div>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698