Index: LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker.html |
diff --git a/LayoutTests/inspector-protocol/debugger/debugger-step-into-dedicated-worker.html b/LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker.html |
similarity index 65% |
copy from LayoutTests/inspector-protocol/debugger/debugger-step-into-dedicated-worker.html |
copy to LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker.html |
index 547d4ddb7383fb7c5e3101af27f33987e30b675b..913c180181f98bd143f2a1cb679371cbf8ce6160 100644 |
--- a/LayoutTests/inspector-protocol/debugger/debugger-step-into-dedicated-worker.html |
+++ b/LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker.html |
@@ -6,7 +6,7 @@ var worker; |
function startWorker() |
{ |
- worker = new Worker("resources/dedicated-worker-step-into.js"); |
+ worker = new Worker("resources/dedicated-worker-suspend-setTimeout.js"); |
worker.onmessage = function(event) { }; |
worker.postMessage(1); |
log("Started worker"); |
@@ -20,13 +20,15 @@ function test() |
var workerRequestId = 1; |
function sendCommandToWorker(method, params) |
{ |
+ var requestId = workerRequestId++; |
InspectorTest.sendCommand("Worker.sendMessageToWorker", |
{ |
"workerId": workerId, |
"message": { "method": method, |
"params": params, |
- "id": workerRequestId++ } |
+ "id": requestId } |
}); |
+ return requestId; |
} |
function didEnableWorkerDebugging(messageObject) |
@@ -49,26 +51,33 @@ function test() |
} |
var pauseCount = 0; |
+ var evalRequestId; |
InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject) |
{ |
var message = messageObject["params"]["message"]; |
if (message["method"] === "Debugger.paused") { |
InspectorTest.log("SUCCESS: Worker paused"); |
if (++pauseCount === 1) { |
- InspectorTest.log("Stepping into..."); |
- sendCommandToWorker("Debugger.stepInto", {}); |
+ evalRequestId = sendCommandToWorker("Runtime.evaluate", { "expression": "global_value" }); |
} else { |
- sendCommandToWorker("Debugger.disable", {}); |
+ InspectorTest.log("FAIL: debugger paused second time"); |
InspectorTest.completeTest(); |
} |
+ } else if (evalRequestId && message["id"] === evalRequestId) { |
+ var value = message["result"]["result"]["value"]; |
+ if (value === 1) |
+ InspectorTest.log("SUCCESS: global_value is 1"); |
+ else |
+ InspectorTest.log("FAIL: setTimeout callback fired while script execution was paused"); |
+ sendCommandToWorker("Debugger.disable", {}); |
+ InspectorTest.completeTest(); |
} |
} |
- |
} |
</script> |
</head> |
<body onLoad="runTest();"> |
-<p>Tests that dedicated worker won't crash on attempt to step into.<a href="https://code.google.com/p/chromium/issues/detail?id=232392">Bug 232392.</a> |
+<p>Tests that setTimeout callback will not fire while script execution is paused.<a href="https://code.google.com/p/chromium/issues/detail?id=377926">Bug 377926.</a> |
</p> |
</body> |
</html> |