39 lines
1.1 KiB
HTML
39 lines
1.1 KiB
HTML
<html>
|
|
<head>
|
|
<script>
|
|
function runTest() {
|
|
if (!window.testRunner || !window.sessionStorage)
|
|
return;
|
|
|
|
if (sessionStorage.pageReloaded) {
|
|
delete sessionStorage.pageReloaded;
|
|
testRunner.notifyDone();
|
|
} else {
|
|
testRunner.waitUntilDone();
|
|
testRunner.setBackingScaleFactor(2, scaleFactorIsSet);
|
|
}
|
|
}
|
|
|
|
function scaleFactorIsSet() {
|
|
// Right now there is a bug that image-set does not properly deal with dynamic changes to the scale factor,
|
|
// so to work around that, we must reload the page to get the 2x image.
|
|
sessionStorage.pageReloaded = true;
|
|
document.location.reload(true);
|
|
}
|
|
|
|
window.onload = runTest;
|
|
</script>
|
|
|
|
<style>
|
|
#foo {
|
|
content: -webkit-image-set(url('resources/blue-100-px-square.png') 1x, url('resources/green-200-px-square.png') 2x);
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body id="body">
|
|
<div>This test passes if the div below is a blue 100px square when the deviceScaleFactor is 1, and if it is a 100px green square when the deviceScaleFactor is 2.</div>
|
|
<div id=foo></div>
|
|
</body>
|
|
</html>
|