Index: third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html |
index 8fd86316d006a89e59ba6192e8b96c5b67052a47..30314a0129ed1877c5a56c508fe5452e5a0c0b0c 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html |
@@ -170,65 +170,81 @@ function test() |
InspectorTest.addResult("Committing uiSourceCode with live edit failure:"); |
uiSourceCode.commitWorkingCopy(); |
- dumpUISourceCodeAndScriptContents(); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
- |
- InspectorTest.addResult("Reloading with saved but diverged uiSourceCode:"); |
- unloadScript(); |
- InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
- InspectorTest.addResult("Saved but diverged source frame should not be muted: " + !sourceFrame._muted); |
- |
- InspectorTest.addResult("Loading script."); |
- loadScript(); |
- dumpUISourceCodeAndScriptContents(); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
- |
- InspectorTest.addResult("Editing uiSourceCode again:"); |
- uiSourceCode.setWorkingCopy("<foo content edited again>"); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ resourceScriptMapping.scriptFile(uiSourceCode).checkMapping().then(onMappingChecked1); |
pfeldman
2016/01/20 19:23:51
What if checkMapping is not called in the non-test
lushnikov
2016/01/20 23:35:58
Rewrote using sniffers.
|
- function setScriptSourceOverrideSuccess(scriptId, newContent, callback) |
+ function onMappingChecked1() |
{ |
- scriptContent = newContent; |
- callback(); |
+ dumpUISourceCodeAndScriptContents(); |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ |
+ InspectorTest.addResult("Reloading with saved but diverged uiSourceCode:"); |
+ unloadScript(); |
+ InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
+ InspectorTest.addResult("Saved but diverged source frame should not be muted: " + !sourceFrame._muted); |
+ |
+ InspectorTest.addResult("Loading script."); |
+ loadScript(); |
+ resourceScriptMapping.scriptFile(uiSourceCode).checkMapping().then(onMappingChecked2); |
} |
- InspectorTest.override(WebInspector.DebuggerModel.prototype, "setScriptSource", setScriptSourceOverrideSuccess); |
- |
- InspectorTest.addResult("Committing uiSourceCode again (with live edit success now):"); |
- uiSourceCode.commitWorkingCopy(); |
- |
- dumpUISourceCodeAndScriptContents(); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
- InspectorTest.addResult("Reloading page:"); |
- unloadScript(); |
- InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
- InspectorTest.addResult("Saved and merged source frame should not be muted: " + !sourceFrame._muted); |
- InspectorTest.addResult("Loading script."); |
- loadScript(); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ function onMappingChecked2() |
+ { |
+ dumpUISourceCodeAndScriptContents(); |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ |
+ InspectorTest.addResult("Editing uiSourceCode again:"); |
+ uiSourceCode.setWorkingCopy("<foo content edited again>"); |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ |
+ function setScriptSourceOverrideSuccess(scriptId, newContent, callback) |
+ { |
+ scriptContent = newContent; |
+ callback(); |
+ } |
+ InspectorTest.override(WebInspector.DebuggerModel.prototype, "setScriptSource", setScriptSourceOverrideSuccess); |
+ |
+ InspectorTest.addResult("Committing uiSourceCode again (with live edit success now):"); |
+ uiSourceCode.commitWorkingCopy(); |
+ |
+ dumpUISourceCodeAndScriptContents(); |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ |
+ InspectorTest.addResult("Reloading page:"); |
+ unloadScript(); |
+ InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
+ InspectorTest.addResult("Saved and merged source frame should not be muted: " + !sourceFrame._muted); |
+ InspectorTest.addResult("Loading script."); |
+ loadScript(); |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ |
+ InspectorTest.addResult("Editing uiSourceCode again and reloading while it is dirty:"); |
+ uiSourceCode.setWorkingCopy("<foo content edited and dirty>"); |
+ unloadScript(); |
+ InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
+ InspectorTest.addResult("Dirty source frame should be muted: " + sourceFrame._muted); |
+ InspectorTest.addResult("Loading script."); |
+ loadScript(); |
+ |
+ resourceScriptMapping.scriptFile(uiSourceCode).checkMapping().then(onMappingChecked3); |
+ } |
- InspectorTest.addResult("Editing uiSourceCode again and reloading while it is dirty:"); |
- uiSourceCode.setWorkingCopy("<foo content edited and dirty>"); |
- unloadScript(); |
- InspectorTest.addResult("UISourceCode should not have script file after unloading scripts: " + !resourceScriptMapping.scriptFile(uiSourceCode)); |
- InspectorTest.addResult("Dirty source frame should be muted: " + sourceFrame._muted); |
- InspectorTest.addResult("Loading script."); |
- loadScript(); |
- InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
- InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
+ function onMappingChecked3() |
+ { |
+ InspectorTest.addResult(" - hasDivergedFromVM: " + !!resourceScriptMapping.scriptFile(uiSourceCode).hasDivergedFromVM()); |
+ InspectorTest.addResult(" - sourceFrame._muted: " + !!sourceFrame._muted); |
- unloadScript(); |
- loadScript; |
+ unloadScript(); |
+ loadScript; |
- WebInspector.debuggerWorkspaceBinding = InspectorTest._originalDebuggerBinding; |
- fs.reportRemoved(); |
- next(); |
+ WebInspector.debuggerWorkspaceBinding = InspectorTest._originalDebuggerBinding; |
+ fs.reportRemoved(); |
+ next(); |
+ } |
} |
}, |