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

Unified Diff: LayoutTests/fast/images/image-zoom-to-25.html

Issue 23242015: Deflake fast/images/image-zoom-to-{25,500}.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 4 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/images/image-zoom-to-500.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/images/image-zoom-to-25.html
diff --git a/LayoutTests/fast/images/image-zoom-to-25.html b/LayoutTests/fast/images/image-zoom-to-25.html
index 2280d3f60bf4ed69a54ca318b1a009c7af30c0d1..b6c001ddd4e6d264b4e40233f22d4cb0cabf5ff5 100644
--- a/LayoutTests/fast/images/image-zoom-to-25.html
+++ b/LayoutTests/fast/images/image-zoom-to-25.html
@@ -1,42 +1,49 @@
<!DOCTYPE html>
<html>
- <script>
- var count = 0;
+<script>
+var count = 0;
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.setCanOpenWindows();
- testRunner.waitUntilDone();
- }
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.setCanOpenWindows();
+ testRunner.waitUntilDone();
+}
- function log(message)
- {
- var console = document.getElementById("console");
- console.appendChild(document.createTextNode(message + "\n"));
- }
-
- function zoomPage()
- {
- var newwindow = window.open("resources/dice.png");
- newwindow.onload = function() {
- newwindow.onresize = function() {
-
- if (window.eventSender) {
- var image = newwindow.document.querySelector("img");
- eventSender.zoomPageOut();
- log("Size at zoom level" + (count) + " : " + image.clientWidth + "x" + image.clientHeight);
- ++count;
-
- if (count == 6)
- testRunner.notifyDone();
- }
- };
+function log(message)
+{
+ var console = document.getElementById("console");
+ console.appendChild(document.createTextNode(message + "\n"));
+}
+function zoomPage()
+{
+ var newwindow = window.open("resources/dice.png");
+ newwindow.onload = function() {
+ newwindow.onresize = function() {
+ var image = newwindow.document.querySelector("img");
+ if (image.clientWidth == 0) {
+ // On GTK+, sometimes the resize callback fires before the GTK
+ // window has finished resizing. If that happens, try to resize
+ // again.
+ setTimeout(function() {
newwindow.resizeTo(200, 200);
- };
+ }, 0);
+ return;
+ }
+
+ if (window.eventSender) {
+ eventSender.zoomPageOut();
+ log("Size at zoom level" + (count) + " : " + image.clientWidth + "x" + image.clientHeight);
+ ++count;
+ if (count == 6)
+ testRunner.notifyDone();
+ }
+ };
- }
- </script>
+ newwindow.resizeTo(200, 200);
+ };
+}
+</script>
<body onload="zoomPage()">
<p>This tests that page zoom and image auto-sizing interact well together. This test requires testRunner to run. To test manually, open <a href="resources/dice.png">this image</a> in a browser window, resize the window to 200px tall and zoom out 6 times. The image should get smaller at each step.</p>
<pre id="console"></pre>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/images/image-zoom-to-500.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698