Bug 471917 - fix PNG reftests to respect color-management settings, r=mfinkle, sr=dbaron a1.9.2.6=dvedit
authorBrian Crowder <crowderbt@gmail.com>
Mon, 29 Mar 2010 14:56:46 -0700
changeset 34383 43bf210715d20143fd552c8aa170ea5fc872e0e5
parent 34382 2a4412197a18246b3fbc53d23a9ba6b1bfbb16fe
child 34384 1fcff072ea163044f085200140e58ec29b21a634
push id1430
push usereakhgari@mozilla.com
push dateFri, 25 Jun 2010 20:52:55 +0000
reviewersmfinkle, dbaron
bugs471917
milestone1.9.2.6pre
Bug 471917 - fix PNG reftests to respect color-management settings, r=mfinkle, sr=dbaron a1.9.2.6=dvedit
layout/tools/reftest/reftest.js
modules/libpr0n/test/reftest/pngsuite-ancillary/reftest.list
--- 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