зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1311196 - Part 1: Add isOMTAEnabled() in testcommon.js. r=boris
MozReview-Commit-ID: FtJTXlsTACn --HG-- extra : rebase_source : fe2a1df9c8edf3315d77b1f4070852234f2df070
This commit is contained in:
Родитель
5d51f47dfb
Коммит
d51fb9dbcc
|
@ -64,9 +64,7 @@ function ensureElementRemoval(aElement) {
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
|
||||
var omtaEnabled = SpecialPowers.DOMWindowUtils.layerManagerRemote &&
|
||||
SpecialPowers.getBoolPref(OMTAPrefKey);
|
||||
var omtaEnabled = isOMTAEnabled();
|
||||
|
||||
var isAndroid = !!navigator.userAgent.includes("Android");
|
||||
|
||||
|
|
|
@ -50,9 +50,7 @@ div {
|
|||
/** Test for bug 1045994 - Add a chrome-only property to inspect if an
|
||||
animation is running on the compositor or not **/
|
||||
|
||||
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
|
||||
var omtaEnabled = SpecialPowers.DOMWindowUtils.layerManagerRemote &&
|
||||
SpecialPowers.getBoolPref(OMTAPrefKey);
|
||||
var omtaEnabled = isOMTAEnabled();
|
||||
|
||||
function assert_animation_is_running_on_compositor(animation, desc) {
|
||||
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
|
||||
|
|
|
@ -81,10 +81,7 @@ async_test(function(t) {
|
|||
// us through a different code path.
|
||||
async_test(function(t) {
|
||||
// This test only applies to compositor animations
|
||||
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
|
||||
var omtaEnabled = SpecialPowers.DOMWindowUtils.layerManagerRemote &&
|
||||
opener.SpecialPowers.getBoolPref(OMTAPrefKey);
|
||||
if (!omtaEnabled) {
|
||||
if (!isOMTAEnabled()) {
|
||||
t.done();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -206,3 +206,11 @@ function setupSynchronousObserver(t, target, subtree) {
|
|||
return observer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if off-main-thread animations.
|
||||
*/
|
||||
function isOMTAEnabled() {
|
||||
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
|
||||
return SpecialPowers.DOMWindowUtils.layerManagerRemote &&
|
||||
SpecialPowers.getBoolPref(OMTAPrefKey);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче