Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / resources / srcset-helper.js
blobca2911f3fa84e5518b5e31bd96bf366f59df5c75
1 function runTest() {
2     if (!window.testRunner || !window.sessionStorage)
3         return;
5     if (!window.targetScaleFactor)
6         window.targetScaleFactor = 2;
8     if (!sessionStorage.scaleFactorIsSet) {
9         testRunner.waitUntilDone();
10         testRunner.setBackingScaleFactor(targetScaleFactor, scaleFactorIsSet);
11     }
13     if (sessionStorage.pageReloaded && sessionStorage.scaleFactorIsSet) {
14         delete sessionStorage.pageReloaded;
15         delete sessionStorage.scaleFactorIsSet;
16         if (!window.manualNotifyDone) {
17             setTimeout(function() {
18                 testRunner.notifyDone();
19             }, 0);
20         }
21     } else {
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);
26     }
29 function scaleFactorIsSet() {
30     sessionStorage.scaleFactorIsSet = true;
33 window.addEventListener("load", runTest, false);