Add an acceleration test for Advanced Layers on Windows. (bug 1365879 part 25, r=milan)

--HG--
extra : rebase_source : 4f8844321fa74328c4c18bc1ba1abaaa56882df9
This commit is contained in:
David Anderson 2017-06-22 21:12:21 -07:00
Родитель a3a1ca6937
Коммит d20399cabd
1 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -31,6 +31,7 @@ var xr = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
var windows = SpecialPowers.Services.ww.getWindowEnumerator();
var windowutils;
var acceleratedWindows = 0;
var advancedLayersWindows = 0;
while (windows.hasMoreElements()) {
windowutils = windows.getNext().QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
@ -38,6 +39,9 @@ while (windows.hasMoreElements()) {
if (windowutils.layerManagerType != "Basic") {
acceleratedWindows++;
}
if (windowutils.usingAdvancedLayers) {
advancedLayersWindows++;
}
} catch (e) {
// The window may not have a layer manager, in which case we get an error.
// Don't count it as an accelerated window.
@ -77,6 +81,7 @@ switch(osName)
todo(false, "Acceleration not supported on Windows XP or newer" +
" (This is expected on SeaMonkey (tinderboxes).)");
break;
}
}
@ -91,6 +96,22 @@ switch(osName)
ok(gfxInfo.D2DEnabled, "Direct2D enabled on Windows 8 or newer");
ok(gfxInfo.DWriteEnabled, "DirectWrite enabled on Windows 8 or newer");
}
var advancedLayersEnabled = false;
var advancedLayersEnabledOnWin7 = false;
try {
advancedLayersEnabled = SpecialPowers.getBoolPref("layers.mlgpu.dev-enabled");
advancedLayersEnabledOnWin7 = SpecialPowers.getBoolPref("layers.mlgpu.enable-on-windows7");
} catch (e) {}
var shouldGetAL = advancedLayersEnabled;
if (version < 6.2) {
shouldGetAL &= advancedLayersEnabledOnWin7;
}
if (shouldGetAL) {
isnot(advancedLayersWindows, 0, "Advanced Layers enabled on Windows");
} else {
is(advancedLayersWindows, 0, "Advanced Layers disabled on Windows");
}
break;
case "Linux":