OLD | NEW |
1 function runTest() { | 1 function runTest() { |
2 if (!window.testRunner || !window.sessionStorage) | 2 if (!window.testRunner || !window.sessionStorage) |
3 return; | 3 return; |
4 | 4 |
5 if (!window.targetScaleFactor) | 5 if (!window.targetScaleFactor) |
6 window.targetScaleFactor = 2; | 6 window.targetScaleFactor = 2; |
7 | 7 |
8 if (!sessionStorage.scaleFactorIsSet) { | 8 if (!sessionStorage.scaleFactorIsSet) { |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 testRunner.setBackingScaleFactor(targetScaleFactor, scaleFactorIsSet); | 10 testRunner.setBackingScaleFactor(targetScaleFactor, scaleFactorIsSet); |
11 } | 11 } |
12 | 12 |
13 if (sessionStorage.pageReloaded && sessionStorage.scaleFactorIsSet) { | 13 if (sessionStorage.pageReloaded && sessionStorage.scaleFactorIsSet) { |
14 delete sessionStorage.pageReloaded; | 14 delete sessionStorage.pageReloaded; |
15 delete sessionStorage.scaleFactorIsSet; | 15 delete sessionStorage.scaleFactorIsSet; |
16 if (!window.manualNotifyDone) | 16 testRunner.notifyDone(); |
17 testRunner.notifyDone(); | |
18 } else { | 17 } else { |
19 // Right now there is a bug that srcset does not properly deal with dyna
mic changes to the scale factor, | 18 // Right now there is a bug that srcset does not properly deal with dyna
mic changes to the scale factor, |
20 // so to work around that, we must reload the page to get the new image. | 19 // so to work around that, we must reload the page to get the new image. |
21 sessionStorage.pageReloaded = true; | 20 sessionStorage.pageReloaded = true; |
22 document.location.reload(true); | 21 document.location.reload(true); |
23 } | 22 } |
24 } | 23 } |
25 | 24 |
26 function scaleFactorIsSet() { | 25 function scaleFactorIsSet() { |
27 sessionStorage.scaleFactorIsSet = true; | 26 sessionStorage.scaleFactorIsSet = true; |
28 } | 27 } |
29 | 28 |
30 window.addEventListener("load", runTest, false); | 29 window.addEventListener("load", runTest, false); |
OLD | NEW |