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

Side by Side 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 unified diff | Download patch
OLDNEW
1 var initialize_BindingsTest = function() { 1 var initialize_BindingsTest = function() {
2 2
3 InspectorTest.preloadModule("sources"); 3 InspectorTest.preloadModule("sources");
4 4
5 InspectorTest.dumpWorkspace = function() { 5 InspectorTest.dumpWorkspace = function() {
6 var uiSourceCodes = Workspace.workspace.uiSourceCodes().slice(); 6 var uiSourceCodes = Workspace.workspace.uiSourceCodes().slice();
7 var urls = uiSourceCodes.map(code => code.url()); 7 var urls = uiSourceCodes.map(code => code.url());
8 urls = urls.map(url => { 8 urls = urls.map(url => {
9 if (!url.startsWith('debugger://')) 9 if (!url.startsWith('debugger://'))
10 return url; 10 return url;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 var frame = document.getElementById(frameId); 55 var frame = document.getElementById(frameId);
56 frame.src = url; 56 frame.src = url;
57 return new Promise(x => frame.onload = x); 57 return new Promise(x => frame.onload = x);
58 } 58 }
59 } 59 }
60 60
61 InspectorTest.markStep = function(title) { 61 InspectorTest.markStep = function(title) {
62 InspectorTest.addResult('\nRunning: ' + title); 62 InspectorTest.addResult('\nRunning: ' + title);
63 } 63 }
64 64
65 InspectorTest.addSniffer(Bindings.CompilerScriptMapping.prototype, "_sourceMapAt tachedForTest", onSourceMap, true);
66 InspectorTest.addSniffer(Bindings.SASSSourceMapping.prototype, "_sourceMapAttach edForTest", onSourceMap, true);
67 var sourceMapCallbacks = new Map();
68 function onSourceMap(sourceMap) {
69 for (var urlSuffix of sourceMapCallbacks.keys()) {
70 if (sourceMap.url().endsWith(urlSuffix)) {
71 var callback = sourceMapCallbacks.get(urlSuffix);
72 callback.call(null);
73 sourceMapCallbacks.delete(urlSuffix);
74 }
75 }
65 } 76 }
66 77
78 InspectorTest.waitForSourceMap = function(sourceMapURLSuffix) {
79 var fulfill;
80 var promise = new Promise(x => fulfill = x);
81 sourceMapCallbacks.set(sourceMapURLSuffix, fulfill);
82 return promise;
83 }
84
85
86 }
87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698