Bug 865919 - Add INT32_MIN-height BMP test. r=joe, a=abillings
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 30 Jul 2013 16:46:08 -0700
changeset 148150 5f25b50252f2d8948710068eea5a940fcc7a7e28
parent 148149 3eae1636fa571fb5a360c863a54752826ee5ff77
child 148151 4a2ea5f0232193b27c1fcfa5710cb101a3dbb83b
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, abillings
bugs865919
milestone24.0a2
Bug 865919 - Add INT32_MIN-height BMP test. r=joe, a=abillings
image/test/mochitest/INT32_MIN.bmp
image/test/mochitest/Makefile.in
image/test/mochitest/test_bug865919.html
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a00161072ae6d3378dcaeea12079c873d4012d
GIT binary patch
literal 60
kc${<cwPAn&Ga%MrfP)4`1_>~O4Ty!fAs7Z~8JdA40AFzf0{{R3
--- a/image/test/mochitest/Makefile.in
+++ b/image/test/mochitest/Makefile.in
@@ -64,16 +64,18 @@ MOCHITEST_FILES =   imgutils.js \
                 test_bug767779.html \
                 bug767779.sjs \
                 animated-gif_trailing-garbage.gif \
 		test_error_events.html \
 		error-early.png \
 		test_drawDiscardedImage.html \
 		short_header.gif \
 		test_short_gif_header.html \
+                INT32_MIN.bmp \
+                test_bug865919.html \
                 $(NULL)
 
 # Tests disabled due to intermittent orange
 # test_bug435296.html disabled - See bug 578591
 # test_bug478398.html disabled - See bug 579139
 
 MOCHITEST_CHROME_FILES = imgutils.js \
                 animationPolling.js \
new file mode 100644
--- /dev/null
+++ b/image/test/mochitest/test_bug865919.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=865919
+-->
+<head>
+  <meta charset="UTF-8">
+  <title>Test for Bug 865919</title>
+  <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+/* Test for Bug 865919:
+ *  BMP with height of INT32_MIN should fail to decode.
+ */
+
+SimpleTest.waitForExplicitFinish();
+
+var req = new XMLHttpRequest();
+req.onload  = function() { CallbackAssert(true,  'Request for file succeeded.'); };
+req.onerror = function() { CallbackAssert(false, 'Request for file failed! Failed to test non-existent file.'); };
+req.open('GET', 'INT32_MIN.bmp');
+req.send(null);
+
+var outstandingCallbacks = 2;
+
+function CallbackAssert(assertVal, failText) {
+  ok(assertVal, failText);
+  
+  outstandingCallbacks--;
+  ok(outstandingCallbacks >= 0, '`outstandingCallbacks` should be non-negative.');
+  if (outstandingCallbacks)
+    return;
+
+  // No outstanding callbacks remain, so we're done.
+  SimpleTest.finish();
+}
+
+</script>
+
+<div id='content'>
+  <img src='INT32_MIN.bmp'
+       onerror='CallbackAssert(true, "Got expected onerror for INT32_MIN.bmp")'
+       onload='CallbackAssert(false, "Got unexpected onload for INT32_MIN.bmp")'>
+</div>
+
+</body>
+</html>
+