Bug 399925 - "GIF decoder needs to allow its data to be discarded" (mochitest for the bug earlier patches caused) [p=joe@drew.ca (Joe Drew [JOEDREW!]) r=stuart]
authorreed@reedloden.com
Fri, 28 Mar 2008 23:53:25 -0700
changeset 13699 57eda7b89481efebe7598e89b49ec655de5280f9
parent 13698 9fbdfc6a273e9299795b750bb7fc03629751af33
child 13700 934723a49a6751dfcb5edf5001131e3c76d7cc04
push id5
push userjorendorff@mozilla.com
push dateWed, 02 Apr 2008 23:04:51 +0000
treeherdermozilla-central@5cb5ebda3312 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstuart
bugs399925
milestone1.9pre
Bug 399925 - "GIF decoder needs to allow its data to be discarded" (mochitest for the bug earlier patches caused) [p=joe@drew.ca (Joe Drew [JOEDREW!]) r=stuart]
modules/libpr0n/test/Makefile.in
modules/libpr0n/test/mochitest/Makefile.in
modules/libpr0n/test/mochitest/bug399925.gif
modules/libpr0n/test/mochitest/test_bug399925.html
--- a/modules/libpr0n/test/Makefile.in
+++ b/modules/libpr0n/test/Makefile.in
@@ -43,13 +43,17 @@ relativesrcdir  = modules/libpr0n/test
 
 include $(DEPTH)/config/autoconf.mk
 
 # Module name for xpcshell tests.
 MODULE		= test_libpr0n
 
 XPCSHELL_TESTS  = unit
 
+ifdef MOZ_MOCHITEST
+DIRS            += mochitest
+endif
+
 include $(topsrcdir)/config/rules.mk
 
 # Note: Invoke any additional (non-xpcshell) test programs here.
 check::
 
new file mode 100644
--- /dev/null
+++ b/modules/libpr0n/test/mochitest/Makefile.in
@@ -0,0 +1,52 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either of the GNU General Public License Version 2 or later (the "GPL"),
+# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH		= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = modules/libpr0n/test/mochitest
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_TEST_FILES = 	test_bug399925.html \
+		bug399925.gif \
+		$(NULL)
+
+libs:: $(_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
index 0000000000000000000000000000000000000000..fc1c8f3af060adc2adf2b8a045256749b3e91874
GIT binary patch
literal 1645
zc%1Fi>o?m60LJlOez{0O)5IlIf*=fy+s00;Y;K82*r8>#I*nVYiY7sbwkAnwnHt%`
zsiRb@>Jn{ItXgxHP)$_3j$`I}rY>FR9G6mtrtAKPz1-*h^X56{8xl&V`XnR+PQag)
zzy}Zr1O!1S6bggE;BdHsfdLYUM4?b<G}_S6(8$Q>z<~o83<itE;&3=)V`CE&6H`-D
zGcz+h9&c`LZed|zX=zCy5Qs#gm6esXwY80njh&sHqobpXiwlK9adma|^z`)h_I?il
zR4Uc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&bMVQUZc&8Ri$-7RhG%it@7Q@VUGR{E`=bxAs$_B
z?|yY6=@u?9-CnL3vm9xvVlw}bgYd)hc6C9zjl$#h?(khGXR<|z5$sAkf4oUfx?kzi
zCJ%8Iml|IS^=adD!Jmx{Ko4e%2v{ULG6;+e-hjgmJpz91S+7F*V^P!w_n-Bk2doI>
z468EG$B>1Pz}eFhFpjdRljus~Dh%xMaDz~uY8}YTn6~vN<WjIDu+R_FLB}klKSAKM
z#(&n`u&(vT{FESj5$U^61bB~aML{3U2u2@)uEtNY$QmC1;Tsy8E`~;5<O9*Nwj6N_
zqWvX=-wol7u)c_ji`X>t4<esb9d;k<C{e1T8gn#+5<{-6ZTo0TrW$w*{>@b##7<Qd
z;<4U_l&kmMdaw^FbtfJ!A`<R;3a{~}$q~N1OkC5v^vl*I+|{MZSAM-Uj~-Igjdxi`
Ol=}RYJ_HOng8m1djf0#3
new file mode 100644
--- /dev/null
+++ b/modules/libpr0n/test/mochitest/test_bug399925.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=399925
+-->
+<head>
+  <title>Test for Bug 399925</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 onload="drawCanvas(); setTimeout('drawCanvas(); allDone();', 20000)">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=399925">Mozilla Bug 399925</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+<img src="bug399925.gif" id="gif" />
+<canvas id="canvas" width="100" height="100"> </canvas>  
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+/** Test for Bug 399925 **/
+SimpleTest.waitForExplicitFinish();
+
+var pngResults = new Array();
+
+function drawCanvas()
+{
+    var canvas = document.getElementById('canvas');
+    var context = canvas.getContext('2d');
+    var gif = document.getElementById('gif');
+
+    context.drawImage(gif, 0, 0);
+    ok(true, "we got through the drawImage call without an exception being thrown");
+    pngResults.push(canvas.toDataURL);
+}
+
+function allDone()
+{
+    is(pngResults[0], pngResults[1], "got different rendered results");
+    SimpleTest.finish();
+}
+
+</script>
+</pre>
+</body>
+</html>
+