blob: f61a4e44b99f2d0ba2325561b79be6309cdc81ba [file] [log] [blame]
<head>
<script src="../../../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.testRunner) {
debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
return;
}
testRunner.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.
testRunner.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");
testRunner.notifyDone();
});
}
</script>
<script>
description("Tests that plug-ins can query for the contents scale factor")
</script>