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

Side by Side Diff: LayoutTests/http/tests/inspector/appcache/appcache-test.js

Issue 268293003: DevTools: Get rid of WebInspector.panels (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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 = WebInspector.panels.resources.applicationC acheListTreeElement; 84 var applicationCacheTreeElement = WebInspector.inspectorView.panel("resource s").applicationCacheListTreeElement;
pfeldman 2014/05/06 19:57:14 I don't see how this is better. Lets keep it as is
apavlov 2014/05/07 10:26:13 There doesn't seem to be any point in keeping WebI
85 if (!applicationCacheTreeElement.children.length) { 85 if (!applicationCacheTreeElement.children.length) {
86 InspectorTest.addResult(" (empty)"); 86 InspectorTest.addResult(" (empty)");
87 return; 87 return;
88 } 88 }
89 for (var i = 0; i < applicationCacheTreeElement.children.length; ++i) { 89 for (var i = 0; i < applicationCacheTreeElement.children.length; ++i) {
90 var manifestTreeElement = applicationCacheTreeElement.children[i]; 90 var manifestTreeElement = applicationCacheTreeElement.children[i];
91 InspectorTest.addResult(" Manifest URL: " + manifestTreeElement.manif estURL); 91 InspectorTest.addResult(" Manifest URL: " + manifestTreeElement.manif estURL);
92 if (!manifestTreeElement.children.length) { 92 if (!manifestTreeElement.children.length) {
93 InspectorTest.addResult(" (no frames)"); 93 InspectorTest.addResult(" (no frames)");
94 continue; 94 continue;
(...skipping 25 matching lines...) Expand all
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 = WebInspector.panels.resources._applicationCacheModel; 130 var model = WebInspector.inspectorView.panel("resources")._applicationCacheM odel;
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 = WebInspector.panels.resources._applicationCacheMod el.frameManifestStatus(frameId); 157 var frameManifestStatus = WebInspector.inspectorView.panel("resources")._app licationCacheModel.frameManifestStatus(frameId);
158 var frameManifestURL = WebInspector.panels.resources._applicationCacheModel. frameManifestURL(frameId); 158 var frameManifestURL = WebInspector.inspectorView.panel("resources")._applic ationCacheModel.frameManifestURL(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(WebInspector.ApplicationCacheModel.prototype, "_fra meManifestUpdated", handler); 165 InspectorTest.addSniffer(WebInspector.ApplicationCacheModel.prototype, "_fra meManifestUpdated", 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698