| OLD | NEW |
| 1 var initialize_PersistenceTest = function() { | 1 var initialize_PersistenceTest = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadModule("persistence"); | 3 InspectorTest.preloadModule("persistence"); |
| 4 InspectorTest.preloadModule("sources"); | 4 InspectorTest.preloadModule("sources"); |
| 5 | 5 |
| 6 WebInspector.PersistenceBinding.prototype.toString = function() | 6 WebInspector.PersistenceBinding.prototype.toString = function() |
| 7 { | 7 { |
| 8 var lines = [ | 8 var lines = [ |
| 9 "{", | 9 "{", |
| 10 " network: " + this.network.url(), | 10 " network: " + this.network.url(), |
| 11 " fileSystem: " + this.fileSystem.url(), | 11 " fileSystem: " + this.fileSystem.url(), |
| 12 "}" | 12 "}" |
| 13 ]; | 13 ]; |
| 14 return lines.join("\n"); | 14 return lines.join("\n"); |
| 15 } | 15 } |
| 16 | 16 |
| 17 InspectorTest.waitForBinding = function(fileName) | 17 InspectorTest.waitForBinding = function(fileName) |
| 18 { | 18 { |
| 19 var bindings = WebInspector.persistence._bindings.valuesArray(); | 19 var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); |
| 20 for (var binding of bindings) { | 20 for (var uiSourceCode of uiSourceCodes) { |
| 21 if (binding.network.name() === fileName || binding.fileSystem.name() ===
fileName) | 21 var binding = WebInspector.persistence.binding(uiSourceCode); |
| 22 if (!binding) |
| 23 continue; |
| 24 if (uiSourceCode.name() === fileName) |
| 22 return Promise.resolve(binding); | 25 return Promise.resolve(binding); |
| 23 } | 26 } |
| 24 var fulfill; | 27 var fulfill; |
| 25 var promise = new Promise(x => fulfill = x); | 28 var promise = new Promise(x => fulfill = x); |
| 26 WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.Bi
ndingCreated, onBindingCreated); | 29 WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.Bi
ndingCreated, onBindingCreated); |
| 27 return promise; | 30 return promise; |
| 28 | 31 |
| 29 function onBindingCreated(event) | 32 function onBindingCreated(event) |
| 30 { | 33 { |
| 31 var binding = event.data; | 34 var binding = event.data; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 return uiSourceCode.name() === name && uiSourceCode.project().type() ===
projectType; | 65 return uiSourceCode.name() === name && uiSourceCode.project().type() ===
projectType; |
| 63 } | 66 } |
| 64 } | 67 } |
| 65 | 68 |
| 66 InspectorTest.addFooJSFile = function(fs) | 69 InspectorTest.addFooJSFile = function(fs) |
| 67 { | 70 { |
| 68 return fs.root.mkdir("inspector").mkdir("persistence").mkdir("resources").ad
dFile("foo.js", "window.foo = ()=>'foo';"); | 71 return fs.root.mkdir("inspector").mkdir("persistence").mkdir("resources").ad
dFile("foo.js", "window.foo = ()=>'foo';"); |
| 69 } | 72 } |
| 70 | 73 |
| 71 } | 74 } |
| OLD | NEW |