blob: b363156564fbc50035bcb3780f51e6110139dd70 [file] [log] [blame]
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body onload="runTest()">
<p id="description"></p>
<div id="console"></div>
<script>
function createTestPlugin(testName)
{
var plugin = document.createElement("embed");
plugin.type = "application/x-webkit-test-netscape";
plugin.setAttribute('test', testName);
return plugin;
}
function runTest()
{
if (!window.layoutTestController) {
debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
return;
}
layoutTestController.waitUntilDone();
plugin1 = createTestPlugin('contents-scale-factor');
document.body.appendChild(plugin1);
shouldBe("plugin1.contentsScaleFactor", "1.0");
shouldBe("plugin1.cachedContentsScaleFactor", "1.0");
// Now change the backing scale factor.
layoutTestController.setBackingScaleFactor(2, function() {
shouldBe("plugin1.contentsScaleFactor", "2.0");
shouldBe("plugin1.cachedContentsScaleFactor", "2.0");
plugin2 = createTestPlugin('contents-scale-factor');
document.body.appendChild(plugin2);
shouldBe("plugin2.contentsScaleFactor", "2.0");
shouldBe("plugin2.cachedContentsScaleFactor", "2.0");
layoutTestController.notifyDone();
});
}
</script>
<script>
description("Tests that plug-ins can query for the contents scale factor")
</script>