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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/zoom/page/zoom-get-screen-ctm.html

Issue 2708493003: Rewrite svg/zoom/page/zoom-get-screen-ctm.html to use testharness (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/zoom/page/zoom-get-screen-ctm-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>SVGGraphicsElement.getScreenCTM subject to page zoom</title>
3 <body style="margin: 0px; padding: 0px;"> 3 <script src="../../../resources/testharness.js"></script>
4 <div style="width: 100px; height: 100px;"></div> 4 <script src="../../../resources/testharnessreport.js"></script>
5 <svg id="svg1" xmlns="http://www.w3.org/2000/svg" width="400" height="400"> 5 <script src="../../../resources/run-after-layout-and-paint.js"></script>
6 <style>
7 body { margin: 0; padding: 0; }
8 </style>
9 <div style="width: 100px; height: 100px;"></div>
10 <svg id="svg1" width="400" height="400">
11 <rect width="100" height="100" fill="green"/>
12 <svg id="svg2" x="100" y="100" width="300" height="300">
6 <rect width="100" height="100" fill="green"/> 13 <rect width="100" height="100" fill="green"/>
7 <svg id="svg2" x="100" y="100" width="300" height="300"> 14 <svg id="svg3" x="100" y="100" width="200" height="200">
8 <rect width="100" height="100" fill="green"/> 15 <rect width="100" height="100" fill="green"/>
9 <svg id="svg3" x="100" y="100" width="200" height="200"> 16 <svg id="svg4" x="100" y="100" width="100" height="100">
10 <rect width="100" height="100" fill="green"/> 17 <rect width="100" height="100" fill="green"/>
11 <svg id="svg4" x="100" y="100" width="100" height="100">
12 <rect width="100" height="100" fill="green"/>
13 </svg>
14 </svg> 18 </svg>
15 </svg> 19 </svg>
16 </svg> 20 </svg>
21 </svg>
22 <script>
23 function assert_matrix_equals(actual, expected) {
24 for (let prop of [ 'a', 'b', 'c', 'd', 'e', 'f'])
25 assert_equals(actual[prop], expected[prop], prop);
26 }
17 27
18 <script src="../../../resources/js-test.js"></script> 28 async_test(t => {
19 <script src="../../../resources/run-after-layout-and-paint.js"></script> 29 runAfterLayoutAndPaint(t.step_func_done(() => {
20 <script src="../resources/testPageZoom.js"></script> 30 eventSender.zoomPageIn();
31 eventSender.zoomPageIn();
21 32
22 <script> 33 assert_matrix_equals(document.getElementById('svg1').getScreenCTM(),
23 var zoomCount = 2; 34 { a: 1, b: 0, c: 0, d: 1, e: 0, f: 100 });
24 35 assert_matrix_equals(document.getElementById('svg2').getScreenCTM(),
25 window.jsTestIsAsync = true; 36 { a: 1, b: 0, c: 0, d: 1, e: 100, f: 200 });
26 if (window.testRunner) { 37 assert_matrix_equals(document.getElementById('svg3').getScreenCTM(),
27 testRunner.waitUntilDone(); 38 { a: 1, b: 0, c: 0, d: 1, e: 200, f: 300 });
28 window.postZoomCallback = executeTest; 39 assert_matrix_equals(document.getElementById('svg4').getScreenCTM(),
29 runAfterLayoutAndPaint(repaintTest); 40 { a: 1, b: 0, c: 0, d: 1, e: 300, f: 400 });
30 } 41 }));
31 42 });
32 function ctmToString(ctm) {
33 return [ ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f ].join(', ');
34 }
35
36 function executeTest() {
37 CTM1 = ctmToString(document.getElementById('svg1').getScreenCTM());
38 CTM2 = ctmToString(document.getElementById('svg2').getScreenCTM());
39 CTM3 = ctmToString(document.getElementById('svg3').getScreenCTM());
40 CTM4 = ctmToString(document.getElementById('svg4').getScreenCTM());
41
42 description("This test checks getScreenCTM() on zoomed pages.");
43
44 shouldBeEqualToString('CTM1', '1, 0, 0, 1, 0, 100');
45 shouldBeEqualToString('CTM2', '1, 0, 0, 1, 100, 200');
46 shouldBeEqualToString('CTM3', '1, 0, 0, 1, 200, 300');
47 shouldBeEqualToString('CTM4', '1, 0, 0, 1, 300, 400');
48 debug('');
49 }
50
51 </script> 43 </script>
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/zoom/page/zoom-get-screen-ctm-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698