Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: LayoutTests/fast/hidpi/resources/srcset-helper.js

Issue 25105004: Use srcset's resource pixel density to determine intrinsic size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cleantests
Patch Set: Fixed crash+rebased Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 testRunner.notifyDone(); 16 if (!window.manualNotifyDone)
17 testRunner.notifyDone();
17 } else { 18 } else {
18 // Right now there is a bug that srcset does not properly deal with dyna mic changes to the scale factor, 19 // Right now there is a bug that srcset does not properly deal with dyna mic changes to the scale factor,
19 // so to work around that, we must reload the page to get the new image. 20 // so to work around that, we must reload the page to get the new image.
20 sessionStorage.pageReloaded = true; 21 sessionStorage.pageReloaded = true;
21 document.location.reload(true); 22 document.location.reload(true);
22 } 23 }
23 } 24 }
24 25
25 function scaleFactorIsSet() { 26 function scaleFactorIsSet() {
26 sessionStorage.scaleFactorIsSet = true; 27 sessionStorage.scaleFactorIsSet = true;
27 } 28 }
28 29
29 window.addEventListener("load", runTest, false); 30 window.addEventListener("load", runTest, false);
OLDNEW
« no previous file with comments | « LayoutTests/fast/hidpi/resources/srcset.svg ('k') | LayoutTests/fast/hidpi/resources/svg_canvas_helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698