Index: LayoutTests/fast/workers/worker-timeout-cancel-order.html |
diff --git a/LayoutTests/fast/workers/worker-timeout-cancel-order.html b/LayoutTests/fast/workers/worker-timeout-cancel-order.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aa70fdf59a88214b64256a865997f3aedb91eda1 |
--- /dev/null |
+++ b/LayoutTests/fast/workers/worker-timeout-cancel-order.html |
@@ -0,0 +1,41 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<p>Test setTimeOut,cancelTimeout in Web Workers.</p> |
+<div id="result"></div> |
+<script type="text/javascript"> |
+function log(message) |
+{ |
+ document.getElementById("result").innerHTML += message + "</br>"; |
+} |
+ |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+var worker = new Worker('resources/worker-timeout-cancel-order.js'); |
+var testAlreadyFailed = false; |
+ |
+worker.postMessage("TS"); |
+ |
+worker.onmessage = function(evt) { |
+ if (evt.data == "DONE") { |
+ log("DONE."); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ if(2 == evt.data && !testAlreadyFailed) { |
+ log("PASS: Timeout canceled."); |
+ } |
+ else if(1 == evt.data) { |
+ testAlreadyFailed = true; |
+ log("FAIL: Timeout did not cancel."); |
+ } |
+ if(evt.data == "Test started.") { |
+ log(evt.data); |
+ } |
+} |
+</script> |
+</body> |
+</html> |