mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 657191 patch 2: mochitest. r=roc
--HG-- rename : modules/libpr0n/test/mochitest/bug496292-2.sjs => modules/libpr0n/test/mochitest/bug657191.sjs
This commit is contained in:
parent
a30612e2aa
commit
c92476439a
@ -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
|
||||
|
28
modules/libpr0n/test/mochitest/bug657191.sjs
Normal file
28
modules/libpr0n/test/mochitest/bug657191.sjs
Normal file
@ -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();
|
||||
}
|
34
modules/libpr0n/test/mochitest/test_bug657191.html
Normal file
34
modules/libpr0n/test/mochitest/test_bug657191.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=657191
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 657191</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=657191">Mozilla Bug 657191</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<!-- bug657191.sjs returns an SVG image with HTTP error code 500.
|
||||
As long as this doesn't crash, this test passes. -->
|
||||
<img src="bug657191.sjs">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 657191 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.onload = function() {
|
||||
ok(true, "test passed");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user