Commit 943548fd authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Don't race on debugger paused event in breakpoint worker web test

This CL removes a race in a breakpoint web test. The CL does a similar
things an existing test helper, but in a safe way.

{waitUntilPausedAndDumpStackAndResume} also prints the reason why we
are paused. Since we pause at a breakpoint and we get a status message
for that (plus a stack trace), we removed the reason from the test
expectation in favor of a non-flaking test.

R=petermarshall@chromium.org

Change-Id: I20aa786d370e64eb16ed3a9036b5599a6be02651
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028888Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736783}
parent 68d7ef9b
......@@ -23,16 +23,13 @@ Test breakpoint in each worker
Script execution paused.
Call stack:
0) onmessage (worker.js:2)
Paused on breakpoint
Script execution resumed.
Script execution paused.
Call stack:
0) onmessage (worker.js:2)
Paused on breakpoint
Script execution resumed.
Script execution paused.
Call stack:
0) onmessage (worker.js:2)
Paused on breakpoint
Script execution resumed.
......@@ -36,8 +36,13 @@
TestRunner.addResult('Test breakpoint in each worker');
await SourcesTestRunner.startDebuggerTestPromise();
for (var i = 0; i < 3; ++i) {
TestRunner.evaluateInPageAsync(`window.workers[${i}].postMessage('')`);
await new Promise(resolve => SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(resolve));
const pausedPromise = SourcesTestRunner.waitUntilPausedPromise();
await TestRunner.evaluateInPageAsync(`window.workers[${i}].postMessage('')`);
const callFrames = await pausedPromise;
SourcesTestRunner.captureStackTrace(callFrames);
await new Promise(resolve => SourcesTestRunner.resumeExecution(resolve));
}
SourcesTestRunner.completeDebuggerTest();
......
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