diff --git a/toolkit/content/tests/chrome/Makefile.in b/toolkit/content/tests/chrome/Makefile.in --- a/toolkit/content/tests/chrome/Makefile.in +++ b/toolkit/content/tests/chrome/Makefile.in @@ -57,16 +57,20 @@ _TEST_FILES = findbar_window.xul \ test_bug360437.xul \ bug366992_window.xul \ test_bug366992.xul \ test_bug418874.xul \ bug429723_window.xul \ test_bug429723.xul \ bug451286_window.xul \ test_bug451286.xul \ + bug471962_testpage_inner.sjs \ + bug471962_testpage_outer.sjs \ + bug471962_window.xul \ + test_bug471962.xul \ test_popup_preventdefault_chrome.xul \ window_popup_preventdefault_chrome.xul \ test_largemenu.xul \ window_largemenu.xul \ test_popup_anchor.xul \ window_popup_anchor.xul \ frame_popup_anchor.xul \ test_preferences.xul \ diff --git a/toolkit/content/tests/chrome/bug471962_testpage_inner.sjs b/toolkit/content/tests/chrome/bug471962_testpage_inner.sjs new file mode 100644 --- /dev/null +++ b/toolkit/content/tests/chrome/bug471962_testpage_inner.sjs @@ -0,0 +1,27 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream"); + +function handleRequest(request, response) +{ + var body = + '\ + \ + Inner POST data: '; + + var bodyStream = new BinaryInputStream(request.bodyInputStream); + var bytes = [], avail = 0; + while ((avail = bodyStream.available()) > 0) + body += String.fromCharCode.apply(String, bodyStream.readByteArray(avail)); + + body += + '
\ + \ + \ +
\ + \ + '; + + response.bodyOutputStream.write(body, body.length); +} diff --git a/toolkit/content/tests/chrome/bug471962_testpage_outer.sjs b/toolkit/content/tests/chrome/bug471962_testpage_outer.sjs new file mode 100644 --- /dev/null +++ b/toolkit/content/tests/chrome/bug471962_testpage_outer.sjs @@ -0,0 +1,30 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream"); + +function handleRequest(request, response) +{ + var body = + '\ + \ + Outer POST data: '; + + var bodyStream = new BinaryInputStream(request.bodyInputStream); + var bytes = [], avail = 0; + while ((avail = bodyStream.available()) > 0) + body += String.fromCharCode.apply(String, bodyStream.readByteArray(avail)); + + body += + '
\ + \ + \ +
\ + \ +