Test case for bug 815359 - r=joe
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 27 Nov 2012 21:55:10 -0500
changeset 114320 109e402b0b246ce9ae9706547e0fc012a182a700
parent 114319 0db3b8d8ed8f4ea145f592cd30f9e5b00bfe792a
child 114321 11d3d401116b95fed0e0c41a1c9c57ef38534d3e
push id23913
push useremorley@mozilla.com
push dateWed, 28 Nov 2012 17:11:31 +0000
treeherdermozilla-central@17c267a881cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs815359
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Test case for bug 815359 - r=joe
image/test/unit/bug815359.ico
image/test/unit/test_imgtools.js
new file mode 100644
index 0000000000000000000000000000000000000000..a24b8fb6bbbfd8b683e89e09c924464254881f9a
GIT binary patch
literal 4286
zc%1E&F%H5o5CqpyAZSQMoswtpGx8js;ishF0hCl6YZMSlLhJ~gjnIv>Qgljg)-D1p
z;854V25X!uU<Y8&aD)Tn9#241!7vQtTV#wdFX_+J;iEf)f71O6e#H(+ZY6)RTcN{X
zZz+Gbv&bDhy<`4<M+N_@M~d@L{r$aDPW7`#{93&4&vE8CeGJ1eW+5@ITV^G4VcL+T
ah-VtdA72PpG)&vYbLRQpncv-x(e-zBzlBEt
--- a/image/test/unit/test_imgtools.js
+++ b/image/test/unit/test_imgtools.js
@@ -717,14 +717,35 @@ try {
   err = e;
   errsrc = "decode";
 }
 
 do_check_eq(errsrc, "decode");
 checkExpectedError(/NS_ERROR_FAILURE/, err);
 
 
+/* ========== bug 815359  ========== */
+testnum = 815359;
+testdesc = "test correct ico hotspots (bug 815359)";
+
+imgName = "bug815359.ico";
+inMimeType = "image/x-icon";
+imgFile = do_get_file(imgName);
+
+istream = getFileInputStream(imgFile);
+do_check_eq(istream.available(), 4286);
+
+outParam = { value: null };
+imgTools.decodeImageData(istream, inMimeType, outParam);
+container = outParam.value;
+
+var props = container.QueryInterface(Ci.nsIProperties);
+
+do_check_eq(props.get("hotspotX", Ci.nsISupportsPRUint32).data, 10);
+do_check_eq(props.get("hotspotY", Ci.nsISupportsPRUint32).data, 9);
+
+
 /* ========== end ========== */
 
 } catch (e) {
     throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
 }
 };