Bug 471917 - fix PNG reftests to respect color-management settings, r=mfinkle, sr=dbaron a1.9.2.6=dvedit
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -51,17 +51,16 @@ const NS_SCRIPTSECURITYMANAGER_CONTRACTI
"@mozilla.org/scriptsecuritymanager;1";
const NS_REFTESTHELPER_CONTRACTID =
"@mozilla.org/reftest-helper;1";
const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX =
"@mozilla.org/network/protocol;1?name=";
const NS_XREAPPINFO_CONTRACTID =
"@mozilla.org/xre/app-info;1";
-
var gLoadTimeout = 0;
// "<!--CLEAR-->"
const BLANK_URL_FOR_CLEARING = "data:text/html,%3C%21%2D%2DCLEAR%2D%2D%3E";
var gBrowser;
var gCanvas1, gCanvas2;
// gCurrentCanvas is non-null between InitCurrentCanvasWithSnapshot and the next
@@ -302,16 +301,24 @@ function ReadManifest(aURL)
new XPCSafeJSObjectWrapper(sandbox).prefs = {
__exposedProps__: {
getBoolPref: 'r',
},
_prefs: prefs,
getBoolPref: function(p) { return this._prefs.getBoolPref(p); }
}
+ new XPCSafeJSObjectWrapper(sandbox).prefs = {
+ __exposedProps__: {
+ getIntPref: 'r',
+ },
+ _prefs: prefs,
+ getIntPref: function(p) { return this._prefs.getIntPref(p) }
+ }
+
var line = {value:null};
var lineNo = 0;
var urlprefix = "";
do {
var more = lis.readLine(line);
++lineNo;
var str = line.value;
if (str.charAt(0) == "#")
--- a/modules/libpr0n/test/reftest/pngsuite-ancillary/reftest.list
+++ b/modules/libpr0n/test/reftest/pngsuite-ancillary/reftest.list
@@ -1,16 +1,16 @@
# PngSuite - Ancillary chunks
# cHRM chunks
#
# ccwn2c08 - gamma 1.0000 chunk, chroma chunk w:0.3127,0.3290 r:0.64,0.33 g:0.30,0.60 b:0.15,0.06
-== ccwn2c08.png ccwn2c08.html
+fails-if(prefs.getIntPref("gfx.color_management.mode")!=2) == ccwn2c08.png ccwn2c08.html
# ccwn3p08 - gamma 1.0000 chunk, chroma chunk w:0.3127,0.3290 r:0.64,0.33 g:0.30,0.60 b:0.15,0.06
-== ccwn3p08.png ccwn3p08.html
+fails-if(prefs.getIntPref("gfx.color_management.mode")!=2) == ccwn3p08.png ccwn3p08.html
# pHYs chunks
#
# PngSuite implies these first 3 should end up as 32x32 bitmaps, but
# per discussion in bug 408622 that's not actually true.
#
# cdfn2c08 - physical pixel dimensions, 8x32 flat pixels
== cdfn2c08.png cdfn2c08.html