| OLD | NEW |
| 1 var framesCount = 0; | 1 var framesCount = 0; |
| 2 | 2 |
| 3 function createAndNavigateIFrame(url) | 3 function createAndNavigateIFrame(url) |
| 4 { | 4 { |
| 5 var iframe = document.createElement("iframe"); | 5 var iframe = document.createElement("iframe"); |
| 6 iframe.src = url; | 6 iframe.src = url; |
| 7 iframe.name = "frame" + ++framesCount; | 7 iframe.name = "frame" + ++framesCount; |
| 8 iframe.id = iframe.name; | 8 iframe.id = iframe.name; |
| 9 document.body.appendChild(iframe); | 9 document.body.appendChild(iframe); |
| 10 } | 10 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 InspectorTest.dumpApplicationCache = function() | 74 InspectorTest.dumpApplicationCache = function() |
| 75 { | 75 { |
| 76 InspectorTest.dumpApplicationCacheTree(); | 76 InspectorTest.dumpApplicationCacheTree(); |
| 77 InspectorTest.dumpApplicationCacheModel(); | 77 InspectorTest.dumpApplicationCacheModel(); |
| 78 InspectorTest.addResult(""); | 78 InspectorTest.addResult(""); |
| 79 } | 79 } |
| 80 | 80 |
| 81 InspectorTest.dumpApplicationCacheTree = function() | 81 InspectorTest.dumpApplicationCacheTree = function() |
| 82 { | 82 { |
| 83 InspectorTest.addResult("Dumping application cache tree:"); | 83 InspectorTest.addResult("Dumping application cache tree:"); |
| 84 var applicationCacheTreeElement = UI.panels.resources.applicationCacheListTr
eeElement; | 84 var applicationCacheTreeElement = UI.panels.resources._sidebar.applicationCa
cheListTreeElement; |
| 85 if (!applicationCacheTreeElement.childCount()) { | 85 if (!applicationCacheTreeElement.childCount()) { |
| 86 InspectorTest.addResult(" (empty)"); | 86 InspectorTest.addResult(" (empty)"); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 for (var i = 0; i < applicationCacheTreeElement.childCount(); ++i) { | 89 for (var i = 0; i < applicationCacheTreeElement.childCount(); ++i) { |
| 90 var manifestTreeElement = applicationCacheTreeElement.childAt(i); | 90 var manifestTreeElement = applicationCacheTreeElement.childAt(i); |
| 91 InspectorTest.addResult(" Manifest URL: " + manifestTreeElement.manif
estURL); | 91 InspectorTest.addResult(" Manifest URL: " + manifestTreeElement.manif
estURL); |
| 92 if (!manifestTreeElement.childCount()) { | 92 if (!manifestTreeElement.childCount()) { |
| 93 InspectorTest.addResult(" (no frames)"); | 93 InspectorTest.addResult(" (no frames)"); |
| 94 continue; | 94 continue; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 120 statusInformation[applicationCache.CHECKING] = "CHECKING"; | 120 statusInformation[applicationCache.CHECKING] = "CHECKING"; |
| 121 statusInformation[applicationCache.DOWNLOADING] = "DOWNLOADING"; | 121 statusInformation[applicationCache.DOWNLOADING] = "DOWNLOADING"; |
| 122 statusInformation[applicationCache.UPDATEREADY] = "UPDATEREADY"; | 122 statusInformation[applicationCache.UPDATEREADY] = "UPDATEREADY"; |
| 123 statusInformation[applicationCache.OBSOLETE] = "OBSOLETE"; | 123 statusInformation[applicationCache.OBSOLETE] = "OBSOLETE"; |
| 124 return statusInformation[status] || statusInformation[applicationCache.UNCAC
HED]; | 124 return statusInformation[status] || statusInformation[applicationCache.UNCAC
HED]; |
| 125 } | 125 } |
| 126 | 126 |
| 127 InspectorTest.dumpApplicationCacheModel = function() | 127 InspectorTest.dumpApplicationCacheModel = function() |
| 128 { | 128 { |
| 129 InspectorTest.addResult("Dumping application cache model:"); | 129 InspectorTest.addResult("Dumping application cache model:"); |
| 130 var model = UI.panels.resources._applicationCacheModel; | 130 var model = UI.panels.resources._sidebar._applicationCacheModel; |
| 131 | 131 |
| 132 var frameIds = []; | 132 var frameIds = []; |
| 133 for (var frameId in model._manifestURLsByFrame) | 133 for (var frameId in model._manifestURLsByFrame) |
| 134 frameIds.push(frameId); | 134 frameIds.push(frameId); |
| 135 | 135 |
| 136 function compareFunc(a, b) { | 136 function compareFunc(a, b) { |
| 137 return InspectorTest.frameIdToString(a).localeCompare(InspectorTest.fram
eIdToString(b)); | 137 return InspectorTest.frameIdToString(a).localeCompare(InspectorTest.fram
eIdToString(b)); |
| 138 } | 138 } |
| 139 frameIds.sort(compareFunc); | 139 frameIds.sort(compareFunc); |
| 140 | 140 |
| 141 if (!frameIds.length) { | 141 if (!frameIds.length) { |
| 142 InspectorTest.addResult(" (empty)"); | 142 InspectorTest.addResult(" (empty)"); |
| 143 return; | 143 return; |
| 144 } | 144 } |
| 145 for (var i = 0; i < frameIds.length; ++i) { | 145 for (var i = 0; i < frameIds.length; ++i) { |
| 146 var frameId = frameIds[i]; | 146 var frameId = frameIds[i]; |
| 147 var manifestURL = model.frameManifestURL(frameId); | 147 var manifestURL = model.frameManifestURL(frameId); |
| 148 var status = model.frameManifestStatus(frameId); | 148 var status = model.frameManifestStatus(frameId); |
| 149 InspectorTest.addResult(" Frame: " + InspectorTest.frameIdToString(fr
ameId)); | 149 InspectorTest.addResult(" Frame: " + InspectorTest.frameIdToString(fr
ameId)); |
| 150 InspectorTest.addResult(" manifest url: " + manifestURL); | 150 InspectorTest.addResult(" manifest url: " + manifestURL); |
| 151 InspectorTest.addResult(" status: " + InspectorTest.applica
tionCacheStatusToString(status)); | 151 InspectorTest.addResult(" status: " + InspectorTest.applica
tionCacheStatusToString(status)); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 InspectorTest.waitForFrameManifestURLAndStatus = function(frameId, manifestURL,
status, callback) | 155 InspectorTest.waitForFrameManifestURLAndStatus = function(frameId, manifestURL,
status, callback) |
| 156 { | 156 { |
| 157 var frameManifestStatus = UI.panels.resources._applicationCacheModel.frameMa
nifestStatus(frameId); | 157 var frameManifestStatus = UI.panels.resources._sidebar._applicationCacheMode
l.frameManifestStatus(frameId); |
| 158 var frameManifestURL = UI.panels.resources._applicationCacheModel.frameManif
estURL(frameId); | 158 var frameManifestURL = UI.panels.resources._sidebar._applicationCacheModel.f
rameManifestURL(frameId); |
| 159 if (frameManifestStatus === status && frameManifestURL.indexOf(manifestURL)
!== -1) { | 159 if (frameManifestStatus === status && frameManifestURL.indexOf(manifestURL)
!== -1) { |
| 160 callback(); | 160 callback(); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 var handler = InspectorTest.waitForFrameManifestURLAndStatus.bind(this, fram
eId, manifestURL, status, callback); | 164 var handler = InspectorTest.waitForFrameManifestURLAndStatus.bind(this, fram
eId, manifestURL, status, callback); |
| 165 InspectorTest.addSniffer(Resources.ApplicationCacheModel.prototype, "_frameM
anifestUpdated", handler); | 165 InspectorTest.addSniffer(Resources.ApplicationCacheModel.prototype, "_frameM
anifestUpdated", handler); |
| 166 } | 166 } |
| 167 | 167 |
| 168 InspectorTest.startApplicationCacheStatusesRecording = function() | 168 InspectorTest.startApplicationCacheStatusesRecording = function() |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 return; | 201 return; |
| 202 } | 202 } |
| 203 | 203 |
| 204 if (!InspectorTest.awaitedFrameStatusEventsCount) | 204 if (!InspectorTest.awaitedFrameStatusEventsCount) |
| 205 InspectorTest.awaitedFrameStatusEventsCount = {}; | 205 InspectorTest.awaitedFrameStatusEventsCount = {}; |
| 206 InspectorTest.awaitedFrameStatusEventsCount[frameId] = { count: eventsLeft,
callback: callback }; | 206 InspectorTest.awaitedFrameStatusEventsCount[frameId] = { count: eventsLeft,
callback: callback }; |
| 207 } | 207 } |
| 208 | 208 |
| 209 }; | 209 }; |
| 210 | 210 |
| OLD | NEW |