Bug 583857. Expose whether D2D is enabled to reftests. r=roc

This commit is contained in:
Jeff Muizelaar 2010-08-13 11:44:21 -04:00
parent 31b63faa71
commit 5f05dd6ee5
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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";