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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js

Issue 2731403009: DevTools: add tests to fixate sourcemap bindings behavior (Closed)
Patch Set: rebaseline Created 3 years, 9 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: third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
index 47dc100dd1332283e18a3d22ed6073a44d513816..9b49a18dadfc5b51cfcb1e700c50062219871bda 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
@@ -62,5 +62,26 @@ InspectorTest.markStep = function(title) {
InspectorTest.addResult('\nRunning: ' + title);
}
+InspectorTest.addSniffer(Bindings.CompilerScriptMapping.prototype, "_sourceMapAttachedForTest", onSourceMap, true);
+InspectorTest.addSniffer(Bindings.SASSSourceMapping.prototype, "_sourceMapAttachedForTest", onSourceMap, true);
+var sourceMapCallbacks = new Map();
+function onSourceMap(sourceMap) {
+ for (var urlSuffix of sourceMapCallbacks.keys()) {
+ if (sourceMap.url().endsWith(urlSuffix)) {
+ var callback = sourceMapCallbacks.get(urlSuffix);
+ callback.call(null);
+ sourceMapCallbacks.delete(urlSuffix);
+ }
+ }
+}
+
+InspectorTest.waitForSourceMap = function(sourceMapURLSuffix) {
+ var fulfill;
+ var promise = new Promise(x => fulfill = x);
+ sourceMapCallbacks.set(sourceMapURLSuffix, fulfill);
+ return promise;
+}
+
+
}

Powered by Google App Engine
This is Rietveld 408576698