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

Unified Diff: LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker.html

Issue 298383002: Suspend setTimeout callbacks while dedicated worker execution is paused (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed ASSERT condition Created 6 years, 6 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/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>

Powered by Google App Engine
This is Rietveld 408576698