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; |
+} |
+ |
+ |
} |