From c92476439aad4c924041c94bb349e8cdbb8d66f4 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Sun, 22 May 2011 19:22:20 -0700 Subject: [PATCH] Bug 657191 patch 2: mochitest. r=roc --HG-- rename : modules/libpr0n/test/mochitest/bug496292-2.sjs => modules/libpr0n/test/mochitest/bug657191.sjs --- modules/libpr0n/test/mochitest/Makefile.in | 2 ++ modules/libpr0n/test/mochitest/bug657191.sjs | 28 +++++++++++++++ .../test/mochitest/test_bug657191.html | 34 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 modules/libpr0n/test/mochitest/bug657191.sjs create mode 100644 modules/libpr0n/test/mochitest/test_bug657191.html diff --git a/modules/libpr0n/test/mochitest/Makefile.in b/modules/libpr0n/test/mochitest/Makefile.in index 3ee2385baa98..764e15de5013 100644 --- a/modules/libpr0n/test/mochitest/Makefile.in +++ b/modules/libpr0n/test/mochitest/Makefile.in @@ -74,6 +74,8 @@ _TEST_FILES = imgutils.js \ test_bug553982.html \ test_bug601470.html \ test_bug614392.html \ + test_bug657191.html \ + bug657191.sjs \ $(NULL) # Tests disabled due to intermittent orange diff --git a/modules/libpr0n/test/mochitest/bug657191.sjs b/modules/libpr0n/test/mochitest/bug657191.sjs new file mode 100644 index 000000000000..77b8e8c7137f --- /dev/null +++ b/modules/libpr0n/test/mochitest/bug657191.sjs @@ -0,0 +1,28 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("modules"); + file.append("libpr0n"); + file.append("test"); + file.append("mochitest"); + file.append('lime100x100.svg'); + + response.setStatusLine("1.1", 500, "Internal Server Error"); + response.setHeader("Content-Type", "image/svg+xml", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/modules/libpr0n/test/mochitest/test_bug657191.html b/modules/libpr0n/test/mochitest/test_bug657191.html new file mode 100644 index 000000000000..ccc4fd7bca2c --- /dev/null +++ b/modules/libpr0n/test/mochitest/test_bug657191.html @@ -0,0 +1,34 @@ + + + + + Test for Bug 657191 + + + + + +Mozilla Bug 657191 +

+ +
+
+
+ +