<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", "undefined");
    shouldBe("plugin1.cachedContentsScaleFactor", "undefined");

    // Now change the backing scale factor.
    testRunner.setBackingScaleFactor(2, function() {
        shouldBe("plugin1.contentsScaleFactor", "undefined");
        shouldBe("plugin1.cachedContentsScaleFactor", "undefined");
    
        plugin2 = createTestPlugin('contents-scale-factor');
        document.body.appendChild(plugin2);
    
        shouldBe("plugin2.contentsScaleFactor", "undefined");
        shouldBe("plugin2.cachedContentsScaleFactor", "undefined");

        testRunner.notifyDone();
    });
}
</script>

<script>
description("Tests that plug-ins can query for the contents scale factor")


</script>
