From 5f05dd6ee5eb905926dce1e9c81e5ab4d2155101 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 13 Aug 2010 11:44:21 -0400 Subject: [PATCH] Bug 583857. Expose whether D2D is enabled to reftests. r=roc --- layout/reftests/box-shadow/reftest.list | 4 ++-- layout/tools/reftest/reftest.js | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/layout/reftests/box-shadow/reftest.list b/layout/reftests/box-shadow/reftest.list index 62f9676c2998..d8f0d53fed81 100644 --- a/layout/reftests/box-shadow/reftest.list +++ b/layout/reftests/box-shadow/reftest.list @@ -11,7 +11,7 @@ == boxshadow-fileupload.html boxshadow-fileupload-ref.html == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg == boxshadow-mixed.html boxshadow-mixed-ref.html -== boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html +random-if(d2d) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html HTTP(..) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul -== boxshadow-onecorner.html boxshadow-onecorner-ref.html +random-if(d2d) == boxshadow-onecorner.html boxshadow-onecorner-ref.html == boxshadow-skiprect.html boxshadow-skiprect-ref.html diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index eca75f481b14..a6440daee6ed 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -43,6 +43,7 @@ const CR = Components.results; const XHTML_NS = "http://www.w3.org/1999/xhtml"; const NS_LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1"; +const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1"; const IO_SERVICE_CONTRACTID = "@mozilla.org/network/io-service;1"; const DEBUG_CONTRACTID = "@mozilla.org/xpcom/debug;1"; const NS_LOCALFILEINPUTSTREAM_CONTRACTID = @@ -334,7 +335,14 @@ function BuildConditionSandbox(aURL) { } catch(e) { sandbox.xulRuntime.XPCOMABI = ""; } - + + try { + // nsIGfxInfo is currently only implemented on Windows + sandbox.d2d = CC[NS_GFXINFO_CONTRACTID].getService(CI.nsIGfxInfo).D2DEnabled; + } catch(e) { + sandbox.d2d = false; + } + // Shortcuts for widget toolkits. sandbox.cocoaWidget = xr.widgetToolkit == "cocoa"; sandbox.gtk2Widget = xr.widgetToolkit == "gtk2";