eae@chromium.org | 2ec8228 | 2012-02-28 05:42:45 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <body> |
| 3 | <pre id="console"> |
| 4 | test |
| 5 | </pre> |
| 6 | <script> |
rniwa@webkit.org | 5cf7fa8 | 2012-06-15 07:38:37 +0000 | [diff] [blame] | 7 | if (window.testRunner) { |
| 8 | testRunner.dumpAsText(); |
eae@chromium.org | 2ec8228 | 2012-02-28 05:42:45 +0000 | [diff] [blame] | 9 | |
| 10 | var msg = 'Document zoom should not apply when printing.'; |
| 11 | var pass = true; |
eae@chromium.org | d1e7d8e | 2012-02-28 19:24:26 +0000 | [diff] [blame] | 12 | |
| 13 | // Determine minium page size height where text fits on a single page. |
| 14 | var height; |
| 15 | for (var i = 10; i < 100; i += 5) { |
kaustubh@motorola.com | 478c509 | 2012-09-05 11:36:03 +0000 | [diff] [blame] | 16 | if (internals.numberOfPages(100, i) == 1) { |
eae@chromium.org | d1e7d8e | 2012-02-28 19:24:26 +0000 | [diff] [blame] | 17 | height = i; |
| 18 | break; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | // Zoom in and verify that page count does not change. |
eae@chromium.org | 2ec8228 | 2012-02-28 05:42:45 +0000 | [diff] [blame] | 23 | for (var i = 0; i < 10; i++) { |
kaustubh@motorola.com | 478c509 | 2012-09-05 11:36:03 +0000 | [diff] [blame] | 24 | var numberOfPages = internals.numberOfPages(100, height); |
eae@chromium.org | 2ec8228 | 2012-02-28 05:42:45 +0000 | [diff] [blame] | 25 | if (numberOfPages != 1) { |
| 26 | pass = false; |
eae@chromium.org | d1e7d8e | 2012-02-28 19:24:26 +0000 | [diff] [blame] | 27 | msg += 'Got ' + numberOfPages + ' pages, expected 1 page.\n'; |
eae@chromium.org | 2ec8228 | 2012-02-28 05:42:45 +0000 | [diff] [blame] | 28 | } |
| 29 | eventSender.zoomPageIn(); |
| 30 | } |
| 31 | |
| 32 | msg = (pass ? 'PASS' : 'FAIL') + ' ' + msg; |
| 33 | document.querySelector('#console').textContent = msg; |
| 34 | } |
| 35 | </script> |
| 36 | </body> |
| 37 | </html> |