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 h4 = document.createElement("h4");
19 h4.innerHTML = testCodes[index] + " redirect";
20 document.body.appendChild(h4);
21 var iframe = document.createElement("iframe");
22 iframe.setAttribute("testCode", testCodes[index]);
23 iframe.setAttribute("id", index);
24 iframe.setAttribute("height", "90px");
25 document.body.appendChild(iframe);
26 iframe.src="resources/redirect-methods-form.html";
27 iframe.setAttribute("onload", "iframeLoaded(" + index + ");");
30 function iframeLoaded(frameID)
32 var iframe = document.getElementById(frameID);
33 if (iframe.hasAttribute("submitted")) {
34 if (++frameID == testCodes.length) {
35 if (window.layoutTestController)
36 layoutTestController.notifyDone();
41 submitFormForFrame(iframe);
45 function submitFormForFrame(iframe)
47 var testInput = iframe.contentDocument.getElementById("testFormInput");
48 testInput.value = iframe.getAttribute("testCode");
49 var testForm = iframe.contentDocument.getElementById("testForm");
50 iframe.setAttribute("submitted", "true");
56 <body onload="startTest();">
57 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>
58 301, 302, 303, and 307 http redirects are all tested.<br>