3 if (window.layoutTestController) {
4 layoutTestController.dumpAsText();
5 layoutTestController.dumpResourceLoadCallbacks();
6 layoutTestController.waitUntilDone();
11 window.setTimeout("createFrame(0);", 0);
14 var testCodes = [301, 302, 303, 307];
16 function createFrame(index)
18 var iframe = document.createElement("iframe");
19 iframe.setAttribute("testCode", testCodes[index]);
20 iframe.setAttribute("id", index);
21 document.body.appendChild(iframe);
22 iframe.src="resources/redirect-methods-form.html";
23 iframe.setAttribute("onload", "iframeLoaded(" + index + ");");
26 function iframeLoaded(frameID)
28 var iframe = document.getElementById(frameID);
29 if (iframe.hasAttribute("submitted")) {
30 if (++frameID == testCodes.length) {
31 if (window.layoutTestController)
32 layoutTestController.notifyDone();
37 submitFormForFrame(iframe);
41 function submitFormForFrame(iframe)
43 var testInput = iframe.contentDocument.getElementById("testFormInput");
44 testInput.value = iframe.getAttribute("testCode");
45 var testForm = iframe.contentDocument.getElementById("testForm");
46 iframe.setAttribute("submitted", "true");
52 <body onload="startTest();">
53 This test checks to see what HTTP method is used to fetch the final resource in the case where the first request results in a redirect.<br>
54 301, 302, 303, and 307 http redirects are all tested.<br>