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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js

Issue 2863763003: Remove EventSender from ImageLoader (Closed)
Patch Set: fix tests Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js b/third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js
index 90b869a404b3f219a2b3e349f5f8476888a1555e..3e5bc9fb9ee86362540a099f60164cdba59249dc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js
+++ b/third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js
@@ -21,11 +21,17 @@ function runTest() {
} else {
// Right now there is a bug that srcset does not properly deal with dynamic changes to the scale factor,
// so to work around that, we must reload the page to get the new image.
- sessionStorage.pageReloaded = true;
- if (window.internals) {
- internals.evictAllResources();
- }
- document.location.reload(true);
+ //
+ // At the time of the Document load event, there might be other
+ // ongoing tasks that can cause new images to be loaded. To evict
+ // those images, we delay evictAllResources() call a little.
+ setTimeout(function() {
+ sessionStorage.pageReloaded = true;
+ if (window.internals) {
+ internals.evictAllResources();
+ }
+ document.location.reload(true);
+ }, 300);
kinuko 2017/05/08 09:24:24 This intuitively feels a bit sketchy, is 300 chose
kouhei (in TOK) 2017/05/08 11:54:25 Tip: use requestAnimationFrame?
hiroshige 2017/05/08 19:23:10 I think we can make this deterministic by using if
}
}

Powered by Google App Engine
This is Rietveld 408576698