2011-01-04 06:56:09 +03:00
|
|
|
function paintCountIs(plugin, expected, msg) {
|
|
|
|
var count = plugin.getPaintCount();
|
|
|
|
var realExpected = expected;
|
2011-07-12 18:31:18 +04:00
|
|
|
var isAsync = SimpleTest.testPluginIsOOP();
|
2011-01-04 06:56:09 +03:00
|
|
|
if (isAsync) {
|
|
|
|
++realExpected; // extra paint at startup for all async-rendering plugins
|
|
|
|
} else {
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
try {
|
|
|
|
if (Components.classes["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).D2DEnabled) {
|
|
|
|
realExpected *= 2;
|
|
|
|
}
|
|
|
|
} catch (e) {}
|
|
|
|
}
|
|
|
|
ok(realExpected == count, msg + " (expected " + expected +
|
|
|
|
" independent paints, expected " + realExpected + " logged paints, got " +
|
|
|
|
count + " actual paints)");
|
|
|
|
}
|