5 if (!window.layoutTestController || !window.sessionStorage)
8 if (!sessionStorage.scaleFactorIsSet) {
9 layoutTestController.waitUntilDone();
10 layoutTestController.setBackingScaleFactor(2, scaleFactorIsSet);
13 if (sessionStorage.pageReloaded && sessionStorage.scaleFactorIsSet) {
14 delete sessionStorage.pageReloaded;
15 delete sessionStorage.scaleFactorIsSet;
16 layoutTestController.notifyDone();
18 // Right now there is a bug that image-set does not properly deal with dynamic changes to the scale factor,
19 // so to work around that, we must reload the page to get the 2x image.
20 sessionStorage.pageReloaded = true;
21 document.location.reload(true);
25 function scaleFactorIsSet() {
26 sessionStorage.scaleFactorIsSet = true;
29 window.onload = runTest;
37 -webkit-border-image: -webkit-image-set(url('resources/blue-100-px-square.png') 1x, url('resources/green-200-px-square.png') 2x) 10 10 10 10 stretch stretch;
43 <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>