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

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

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 24 matching lines...) Expand all
35 InspectorTest.evaluateInPage("createAndNavigateIFrame(unescape('" + escape(u rl) + "'))"); 35 InspectorTest.evaluateInPage("createAndNavigateIFrame(unescape('" + escape(u rl) + "'))");
36 36
37 function frameNavigated(frame) 37 function frameNavigated(frame)
38 { 38 {
39 callback(frame.id); 39 callback(frame.id);
40 } 40 }
41 } 41 }
42 42
43 InspectorTest.navigateIFrame = function(frameId, url, callback) 43 InspectorTest.navigateIFrame = function(frameId, url, callback)
44 { 44 {
45 var frame = WebInspector.resourceTreeModel.frameForId(frameId) 45 var frame = InspectorTest.resourceTreeModel.frameForId(frameId)
46 InspectorTest.evaluateInPage("navigateIFrame(unescape('" + escape(frame.name ) +"'), unescape('" + escape(url) + "'))"); 46 InspectorTest.evaluateInPage("navigateIFrame(unescape('" + escape(frame.name ) +"'), unescape('" + escape(url) + "'))");
47 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameNa vigated", frameNavigated); 47 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameNa vigated", frameNavigated);
48 48
49 function frameNavigated(frame) 49 function frameNavigated(frame)
50 { 50 {
51 callback(frame.id); 51 callback(frame.id);
52 } 52 }
53 } 53 }
54 54
55 InspectorTest.removeIFrame = function(frameId, callback) 55 InspectorTest.removeIFrame = function(frameId, callback)
56 { 56 {
57 var frame = WebInspector.resourceTreeModel.frameForId(frameId) 57 var frame = InspectorTest.resourceTreeModel.frameForId(frameId)
58 InspectorTest.evaluateInPage("removeIFrame(unescape('" + escape(frame.name) +"'))"); 58 InspectorTest.evaluateInPage("removeIFrame(unescape('" + escape(frame.name) +"'))");
59 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameDe tached", frameDetached); 59 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameDe tached", frameDetached);
60 60
61 function frameDetached(frame) 61 function frameDetached(frame)
62 { 62 {
63 callback(frame.id); 63 callback(frame.id);
64 } 64 }
65 } 65 }
66 66
67 InspectorTest.swapFrameCache = function(frameId) 67 InspectorTest.swapFrameCache = function(frameId)
68 { 68 {
69 var frame = WebInspector.resourceTreeModel.frameForId(frameId); 69 var frame = InspectorTest.resourceTreeModel.frameForId(frameId);
70 InspectorTest.evaluateInPage("swapFrameCache(unescape('" + escape(frame.name ) +"'))"); 70 InspectorTest.evaluateInPage("swapFrameCache(unescape('" + escape(frame.name ) +"'))");
71 } 71 }
72 72
73 73
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 }
(...skipping 17 matching lines...) Expand all
97 var frameTreeElement = manifestTreeElement.children[j]; 97 var frameTreeElement = manifestTreeElement.children[j];
98 InspectorTest.addResult(" Frame: " + frameTreeElement.display Name); 98 InspectorTest.addResult(" Frame: " + frameTreeElement.display Name);
99 } 99 }
100 } 100 }
101 } 101 }
102 102
103 InspectorTest.frameIdToString = function(frameId) 103 InspectorTest.frameIdToString = function(frameId)
104 { 104 {
105 if (!InspectorTest.framesByFrameId) 105 if (!InspectorTest.framesByFrameId)
106 InspectorTest.framesByFrameId = {}; 106 InspectorTest.framesByFrameId = {};
107 var frame = WebInspector.resourceTreeModel.frameForId(frameId); 107 var frame = InspectorTest.resourceTreeModel.frameForId(frameId);
108 if (!frame) 108 if (!frame)
109 frame = InspectorTest.framesByFrameId[frameId]; 109 frame = InspectorTest.framesByFrameId[frameId];
110 InspectorTest.framesByFrameId[frameId] = frame; 110 InspectorTest.framesByFrameId[frameId] = frame;
111 111
112 return frame.name; 112 return frame.name;
113 } 113 }
114 114
115 InspectorTest.applicationCacheStatusToString = function(status) 115 InspectorTest.applicationCacheStatusToString = function(status)
116 { 116 {
117 var statusInformation = {}; 117 var statusInformation = {};
(...skipping 83 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