2 if (!window.testRunner || !window.sessionStorage)
5 if (!window.targetScaleFactor)
6 window.targetScaleFactor = 2;
8 if (!sessionStorage.scaleFactorIsSet) {
9 testRunner.waitUntilDone();
10 testRunner.setBackingScaleFactor(targetScaleFactor, scaleFactorIsSet);
13 if (sessionStorage.pageReloaded && sessionStorage.scaleFactorIsSet) {
14 delete sessionStorage.pageReloaded;
15 delete sessionStorage.scaleFactorIsSet;
16 if (!window.manualNotifyDone) {
17 setTimeout(function() {
18 testRunner.notifyDone();
22 // Right now there is a bug that srcset does not properly deal with dynamic changes to the scale factor,
23 // so to work around that, we must reload the page to get the new image.
24 sessionStorage.pageReloaded = true;
25 document.location.reload(true);
29 function scaleFactorIsSet() {
30 sessionStorage.scaleFactorIsSet = true;
33 window.addEventListener("load", runTest, false);