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

Side by Side Diff: LayoutTests/http/tests/security/xssAuditor/resources/utilities.js

Issue 196523007: Revert of id of iframe incorrectly sets window name (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 function checkIfFrameLocationMatchesSrcAndCallDone(frameId) 1 function checkIfFrameLocationMatchesSrcAndCallDone(frameId)
2 { 2 {
3 if (!window.testRunner) 3 if (!window.testRunner)
4 return; 4 return;
5 5
6 var actualURL = 'unavailable', frame = document.getElementById(frameId); 6 var actualURL = 'unavailable', frame = document.getElementById(frameId);
7 try { 7 try {
8 actualURL = frame.contentWindow.location.href; 8 actualURL = frame.contentWindow.location.href;
9 } 9 }
10 catch (e) { 10 catch (e) {
(...skipping 10 matching lines...) Expand all
21 { 21 {
22 if (!params || !params.length) 22 if (!params || !params.length)
23 return; 23 return;
24 24
25 if (!HTTPMethod) 25 if (!HTTPMethod)
26 HTTPMethod = 'GET'; 26 HTTPMethod = 'GET';
27 27
28 if (document.getElementById('frame')) 28 if (document.getElementById('frame'))
29 document.body.removeChild(document.getElementById('frame')); 29 document.body.removeChild(document.getElementById('frame'));
30 var iFrameObj = document.createElement('iframe'); 30 var iFrameObj = document.createElement('iframe');
31 iFrameObj.name = 'frame'; 31 iFrameObj.id = 'frame';
32 document.body.appendChild(iFrameObj); 32 document.body.appendChild(iFrameObj);
33 var frameContent = iFrameObj.contentDocument; 33 var frameContent = iFrameObj.contentDocument;
34 frameContent.open(); 34 frameContent.open();
35 frameContent.write('<form method="' + HTTPMethod + '" name="form" id="form" action="' + url + '">'); 35 frameContent.write('<form method="' + HTTPMethod + '" name="form" id="form" action="' + url + '">');
36 if (params.length > 0) { 36 if (params.length > 0) {
37 var paramArray = params.split('&'); 37 var paramArray = params.split('&');
38 for (var i = 0; i < paramArray.length; ++i) { 38 for (var i = 0; i < paramArray.length; ++i) {
39 var paramElement = paramArray[i].split('=', 2); 39 var paramElement = paramArray[i].split('=', 2);
40 frameContent.write('<input type="text" name="' + paramElement[0] + ' " value="' + paramElement[1] + '">'); 40 frameContent.write('<input type="text" name="' + paramElement[0] + ' " value="' + paramElement[1] + '">');
41 } 41 }
(...skipping 13 matching lines...) Expand all
55 var index = ids.indexOf(event.data); 55 var index = ids.indexOf(event.data);
56 if (index == -1) 56 if (index == -1)
57 return; 57 return;
58 58
59 loadAttempted = loadAttempted | (1 << index); 59 loadAttempted = loadAttempted | (1 << index);
60 if (loadAttempted == (1 << ids.length) - 1) 60 if (loadAttempted == (1 << ids.length) - 1)
61 testRunner.notifyDone(); 61 testRunner.notifyDone();
62 }, false); 62 }, false);
63 } 63 }
64 64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698