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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/images/force-reload-image-document.html

Issue 2874073003: Add layout tests for ImageLoader::UpdateFromElement(kUpdateForcedReload) (Closed)
Patch Set: comment 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script>
5 var t = async_test("ForceReload should get a new image for an image document");
6
7 function triggerReload() {
8 // This depends on how image documents are implemented by Blink.
9 var iframe = document.getElementById('iframe');
10 var img = iframe.contentDocument.body.getElementsByTagName('img')[0];
11 var originalWidth = img.width;
12 var originalHeight = img.height;
13
14 img.onerror = t.unreached_func();
15 img.onload = t.step_func_done(function() {
16 assert_not_equals(originalWidth, img.width, "Should be reloaded: width");
17 assert_not_equals(originalHeight, img.height, "Should be reloaded: height");
18 });
19
20 if (window.internals) {
21 internals.forceImageReload(img);
22 }
23 }
24 </script>
25
26 <!-- We call triggerReload() strictly after document load event,
27 because reloading is not enforced until document load event is finished. -->
28 <body onload="setTimeout(t.step_func(triggerReload), 0)">
29 <iframe id="iframe" src="../cache/resources/random-cached-image.php?id=force-rel oad-image-document"></iframe>
30 </body>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/images/force-reload.html ('k') | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698