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

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

Issue 715863004: Update a couple more tests for load completion definition change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update srcset-helper.js instead of tests Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/resources/srcset-helper.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (!window.manualNotifyDone) 16 if (!window.manualNotifyDone) {
17 testRunner.notifyDone(); 17 setTimeout(function() {
18 testRunner.notifyDone();
19 }, 0);
20 }
18 } else { 21 } else {
19 // Right now there is a bug that srcset does not properly deal with dyna mic changes to the scale factor, 22 // 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. 23 // so to work around that, we must reload the page to get the new image.
21 sessionStorage.pageReloaded = true; 24 sessionStorage.pageReloaded = true;
22 document.location.reload(true); 25 document.location.reload(true);
23 } 26 }
24 } 27 }
25 28
26 function scaleFactorIsSet() { 29 function scaleFactorIsSet() {
27 sessionStorage.scaleFactorIsSet = true; 30 sessionStorage.scaleFactorIsSet = true;
28 } 31 }
29 32
30 window.addEventListener("load", runTest, false); 33 window.addEventListener("load", runTest, false);
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/resources/srcset-helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698