Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/content/tests/test_requestList.html

Issue 29329486: Issue 3208 - Adjust unit tests for the content policy changes (Closed)
Patch Set: Created Oct. 29, 2015, 1:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/tests/policy.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Tests for request data</title> 4 <title>Tests for request data</title>
5 5
6 <link rel="stylesheet" type="text/css" href="/content/tests/SimpleTest/test.cs s" /> 6 <link rel="stylesheet" type="text/css" href="/content/tests/SimpleTest/test.cs s" />
7 7
8 <script type="text/javascript" src="/content/MochiKit/MochiKit.js"></script> 8 <script type="text/javascript" src="/content/MochiKit/MochiKit.js"></script>
9 <script type="application/x-javascript;version=1.7" src="../httpd.js"></script > 9 <script type="application/x-javascript;version=1.7" src="../httpd.js"></script >
10 <script type="text/javascript; version=1.7" src="/content/tests/SimpleTest/spe cialpowersAPI.js"></script> 10 <script type="text/javascript; version=1.7" src="/content/tests/SimpleTest/spe cialpowersAPI.js"></script>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 is(wndData[1].entry.toSource(), imageNodeData.toSource(), "Data received for the image should be identical to the result of getDataForNode"); 163 is(wndData[1].entry.toSource(), imageNodeData.toSource(), "Data received for the image should be identical to the result of getDataForNode");
164 } 164 }
165 165
166 is(frameData.length, 1, "Number of entries in the frame data"); 166 is(frameData.length, 1, "Number of entries in the frame data");
167 if (frameData.length > 0) 167 if (frameData.length > 0)
168 { 168 {
169 is(frameData[0].node, $("frame").contentDocument.getElementById("image") , "Only entry in the frame data should be the image"); 169 is(frameData[0].node, $("frame").contentDocument.getElementById("image") , "Only entry in the frame data should be the image");
170 is(frameData[0].entry.toSource(), imageNodeData.toSource(), "Data receiv ed for the image should be identical to the result of getDataForNode"); 170 is(frameData[0].entry.toSource(), imageNodeData.toSource(), "Data receiv ed for the image should be identical to the result of getDataForNode");
171 } 171 }
172 172
173 is(frameNodeData.type, Policy.type.SUBDOCUMENT, "Frame node data: type pro perty"); 173 is(frameNodeData.type, "SUBDOCUMENT", "Frame node data: type property");
174 is(frameNodeData.typeDescr, "SUBDOCUMENT", "Frame node data: typeDescr pro perty");
175 is(frameNodeData.docDomain, "mochikit", "Frame node data: docDomain proper ty"); 174 is(frameNodeData.docDomain, "mochikit", "Frame node data: docDomain proper ty");
176 is(frameNodeData.thirdParty, true, "Frame node data: thirdParty property") ; 175 is(frameNodeData.thirdParty, true, "Frame node data: thirdParty property") ;
177 is(frameNodeData.location, "http://127.0.0.1:1234/test1", "Frame node data : location property"); 176 is(frameNodeData.location, "http://127.0.0.1:1234/test1", "Frame node data : location property");
178 is(frameNodeData.filter, null, "Frame node data: filter property"); 177 is(frameNodeData.filter, null, "Frame node data: filter property");
179 178
180 is(imageNodeData.type, Policy.type.IMAGE, "Image node data: type property" ); 179 is(imageNodeData.type, "IMAGE", "Image node data: type property");
181 is(imageNodeData.typeDescr, "IMAGE", "Image node data: typeDescr property" );
182 is(imageNodeData.docDomain, "127.0.0.1", "Image node data: docDomain prope rty"); 180 is(imageNodeData.docDomain, "127.0.0.1", "Image node data: docDomain prope rty");
183 is(imageNodeData.thirdParty, false, "Image node data: thirdParty property" ); 181 is(imageNodeData.thirdParty, false, "Image node data: thirdParty property" );
184 is(imageNodeData.location, "http://127.0.0.1:1234/test.png", "Image node d ata: location property"); 182 is(imageNodeData.location, "http://127.0.0.1:1234/test.png", "Image node d ata: location property");
185 is(imageNodeData.filter, null, "Image node data: filter property"); 183 is(imageNodeData.filter, null, "Image node data: filter property");
186 184
187 top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowU tils).garbageCollect(); 185 top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowU tils).garbageCollect();
188 ok(RequestNotifier.getDataForNode($("frame"), true), "Frame node still has data associated with it after garbage collection"); 186 ok(RequestNotifier.getDataForNode($("frame"), true), "Frame node still has data associated with it after garbage collection");
189 ok(RequestNotifier.getDataForNode($("frame").contentDocument.getElementByI d("image"), true), "Image node still has data associated with it after garbage c ollection"); 187 ok(RequestNotifier.getDataForNode($("frame").contentDocument.getElementByI d("image"), true), "Image node still has data associated with it after garbage c ollection");
190 } 188 }
191 189
(...skipping 22 matching lines...) Expand all
214 is(wndData[2].entry.toSource(), scriptNodeData.toSource(), "Data receive d for the script should be identical to the result of getDataForNode"); 212 is(wndData[2].entry.toSource(), scriptNodeData.toSource(), "Data receive d for the script should be identical to the result of getDataForNode");
215 } 213 }
216 214
217 is(frameData.length, 1, "Number of entries in the frame data"); 215 is(frameData.length, 1, "Number of entries in the frame data");
218 if (frameData.length > 0) 216 if (frameData.length > 0)
219 { 217 {
220 is(frameData[0].node, $("frame").contentDocument.getElementById("script" ), "Only entry in the frame data should be the script"); 218 is(frameData[0].node, $("frame").contentDocument.getElementById("script" ), "Only entry in the frame data should be the script");
221 is(frameData[0].entry.toSource(), scriptNodeData.toSource(), "Data recei ved for the script should be identical to the result of getDataForNode"); 219 is(frameData[0].entry.toSource(), scriptNodeData.toSource(), "Data recei ved for the script should be identical to the result of getDataForNode");
222 } 220 }
223 221
224 is(frameNodeData.type, Policy.type.SUBDOCUMENT, "Frame node data: type pro perty"); 222 is(frameNodeData.type, "SUBDOCUMENT", "Frame node data: type property");
225 is(frameNodeData.typeDescr, "SUBDOCUMENT", "Frame node data: typeDescr pro perty");
226 is(frameNodeData.docDomain, "mochikit", "Frame node data: docDomain proper ty"); 223 is(frameNodeData.docDomain, "mochikit", "Frame node data: docDomain proper ty");
227 is(frameNodeData.thirdParty, true, "Frame node data: thirdParty property") ; 224 is(frameNodeData.thirdParty, true, "Frame node data: thirdParty property") ;
228 is(frameNodeData.location, "http://127.0.0.1:1234/test2", "Frame node data : location property"); 225 is(frameNodeData.location, "http://127.0.0.1:1234/test2", "Frame node data : location property");
229 is(frameNodeData.filter, null, "Frame node data: filter property"); 226 is(frameNodeData.filter, null, "Frame node data: filter property");
230 227
231 is(scriptNodeData.type, Policy.type.SCRIPT, "Script node data: type proper ty"); 228 is(scriptNodeData.type, "SCRIPT", "Script node data: type property");
232 is(scriptNodeData.typeDescr, "SCRIPT", "Script node data: typeDescr proper ty");
233 is(scriptNodeData.docDomain, "127.0.0.1", "Script node data: docDomain pro perty"); 229 is(scriptNodeData.docDomain, "127.0.0.1", "Script node data: docDomain pro perty");
234 is(scriptNodeData.thirdParty, false, "Script node data: thirdParty propert y"); 230 is(scriptNodeData.thirdParty, false, "Script node data: thirdParty propert y");
235 is(scriptNodeData.location, "http://127.0.0.1:1234/test.js", "Script node data: location property"); 231 is(scriptNodeData.location, "http://127.0.0.1:1234/test.js", "Script node data: location property");
236 is(scriptNodeData.filter, null, "Script node data: filter property"); 232 is(scriptNodeData.filter, null, "Script node data: filter property");
237 233
238 top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowU tils).garbageCollect(); 234 top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowU tils).garbageCollect();
239 ok(RequestNotifier.getDataForNode($("frame"), true), "Frame node still has data associated with it after garbage collection"); 235 ok(RequestNotifier.getDataForNode($("frame"), true), "Frame node still has data associated with it after garbage collection");
240 ok(RequestNotifier.getDataForNode($("frame").contentDocument.getElementByI d("script"), true), "Script node still has data associated with it after garbage collection"); 236 ok(RequestNotifier.getDataForNode($("frame").contentDocument.getElementByI d("script"), true), "Script node still has data associated with it after garbage collection");
241 } 237 }
242 238
243 function stop() 239 function stop()
244 { 240 {
245 server.stop(); 241 server.stop();
246 } 242 }
247 243
248 let server = new nsHttpServer(); 244 let server = new nsHttpServer();
249 SimpleTest.waitForExplicitFinish(); 245 SimpleTest.waitForExplicitFinish();
250 addLoadEvent(start); 246 addLoadEvent(start);
251 </script> 247 </script>
252 </pre> 248 </pre>
253 </body> 249 </body>
254 </html> 250 </html>
OLDNEW
« no previous file with comments | « chrome/content/tests/policy.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld