Commit 5f251d0f authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Add {async}/{await} to http/tests/devtools/bindings/* web tests

This CL prepares bindings web tests for the upcoming asynchronous
source mapping. Note that the tests are disabled for the transition
period as the test output will change slightly. This is due to timing
differences. In contrast to the current approach, the new live location
system imposes an ordering on live location updates in contrast to
"racing events".

Bug: chromium:1032016
Change-Id: Ic25c6297da3fcb3e5259c48ce97c6508e52af9d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066755Reviewed-by: default avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744207}
parent 26bc0a24
...@@ -3265,6 +3265,8 @@ crbug.com/1032016 http/tests/devtools/sources/debugger-breakpoints/breakpoints-u ...@@ -3265,6 +3265,8 @@ crbug.com/1032016 http/tests/devtools/sources/debugger-breakpoints/breakpoints-u
crbug.com/1032016 http/tests/devtools/sources/debugger/live-edit-breakpoints.js [ Pass Failure ] crbug.com/1032016 http/tests/devtools/sources/debugger/live-edit-breakpoints.js [ Pass Failure ]
crbug.com/1032016 http/tests/devtools/tracing/timeline-js/timeline-script-id.js [ Pass Failure ] crbug.com/1032016 http/tests/devtools/tracing/timeline-js/timeline-script-id.js [ Pass Failure ]
crbug.com/1032016 virtual/threaded/http/tests/devtools/tracing/timeline-js/timeline-script-id.js [ Pass Failure ] crbug.com/1032016 virtual/threaded/http/tests/devtools/tracing/timeline-js/timeline-script-id.js [ Pass Failure ]
crbug.com/1032016 http/tests/devtools/bindings/inline-styles-binding.js [ Pass Failure ]
crbug.com/1032016 http/tests/devtools/bindings/livelocation-main-frame-navigated.js [ Pass Failure ]
# We only want to run one of the web-animations-api tests in stable mode. # We only want to run one of the web-animations-api tests in stable mode.
crbug.com/441553 virtual/stable/web-animations-api/* [ Skip ] crbug.com/441553 virtual/stable/web-animations-api/* [ Skip ]
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
var i = 0; var i = 0;
for (var script of scripts) { for (var script of scripts) {
var rawLocation = TestRunner.debuggerModel.createRawLocation(script, script.lineOffset, script.columnOffset); var rawLocation = TestRunner.debuggerModel.createRawLocation(script, script.lineOffset, script.columnOffset);
Bindings.debuggerWorkspaceBinding.createLiveLocation( await Bindings.debuggerWorkspaceBinding.createLiveLocation(
rawLocation, updateDelegate.bind(null, 'script' + i), locationPool); rawLocation, updateDelegate.bind(null, 'script' + i), locationPool);
i++; i++;
} }
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
for (var styleSheetId of styleSheets) { for (var styleSheetId of styleSheets) {
var header = TestRunner.cssModel.styleSheetHeaderForId(styleSheetId); var header = TestRunner.cssModel.styleSheetHeaderForId(styleSheetId);
var rawLocation = new SDK.CSSLocation(header, header.startLine, header.startColumn); var rawLocation = new SDK.CSSLocation(header, header.startLine, header.startColumn);
Bindings.cssWorkspaceBinding.createLiveLocation( await Bindings.cssWorkspaceBinding.createLiveLocation(
rawLocation, updateDelegate.bind(null, 'style' + i), locationPool); rawLocation, updateDelegate.bind(null, 'style' + i), locationPool);
i++; i++;
} }
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
await TestRunner.cssModel.addRule(styleSheetId, `.new-rule { await TestRunner.cssModel.addRule(styleSheetId, `.new-rule {
--new: true; --new: true;
}`, TextUtils.TextRange.createFromLocation(0, 0)); }`, TextUtils.TextRange.createFromLocation(0, 0));
await Promise.resolve(); await TestRunner.waitForPendingLiveLocationUpdates();
i++; i++;
} }
function updateDelegate(name, location) { async function updateDelegate(name, location) {
var uiLocation = location.uiLocation(); var uiLocation = await location.uiLocation();
TestRunner.addResult(`LiveLocation '${name}' was updated ${uiLocation.lineNumber}:${uiLocation.columnNumber}`); TestRunner.addResult(`LiveLocation '${name}' was updated ${uiLocation.lineNumber}:${uiLocation.columnNumber}`);
} }
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
BindingsTestRunner.waitForSourceMap('sourcemap-style.css.map'), BindingsTestRunner.waitForSourceMap('sourcemap-style.css.map'),
]); ]);
var jsLiveLocation = BindingsTestRunner.createDebuggerLiveLocation('js', 'sourcemap-script.js'); const jsLiveLocation = await BindingsTestRunner.createDebuggerLiveLocation('js', 'sourcemap-script.js');
var cssLiveLocation = BindingsTestRunner.createCSSLiveLocation('css', 'sourcemap-style.css'); const cssLiveLocation = await BindingsTestRunner.createCSSLiveLocation('css', 'sourcemap-style.css');
TestRunner.markStep('navigateMainFrame'); TestRunner.markStep('navigateMainFrame');
var url = TestRunner.url('resources/empty-page.html'); const url = TestRunner.url('resources/empty-page.html');
await TestRunner.navigatePromise(url); await TestRunner.navigatePromise(url);
BindingsTestRunner.dumpLocation(jsLiveLocation); await BindingsTestRunner.dumpLocation(jsLiveLocation);
BindingsTestRunner.dumpLocation(cssLiveLocation); await BindingsTestRunner.dumpLocation(cssLiveLocation);
TestRunner.completeTest(); TestRunner.completeTest();
})(); })();
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