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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/server-side-imagemap.html

Issue 2253513005: Use testharness.js instead of js-test.js in fast/images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change test as per the comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/images/server-side-imagemap-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 <script src="../../resources/js-test.js"></script> 2 <title>Tests that server-side image maps with zooms and transforms produce the r ight click coordinates.</title>
3 <script> 3 <script src="../../resources/testharness.js"></script>
4 description('Tests that server-side image maps with zooms and transforms produce the right click coordinates.'); 4 <script src="../../resources/testharnessreport.js"></script>
5
6 function testClick(x, y, expectedHash)
7 {
8 location.hash = '#';
9 eventSender.mouseMoveTo(x, y);
10 eventSender.mouseDown();
11 eventSender.mouseUp();
12 shouldBeEqualToString('location.hash', expectedHash);
13 }
14
15 onload = function()
16 {
17 if (window.testRunner && window.eventSender && window.internals) {
18 internals.setPageScaleFactor(1.25); // pinch scale
19 eventSender.setPageZoomFactor(1.5, 0, 0); // browser zoom
20 testClick(402, 122, '#?0,0'); // top left border
21 testClick(407, 204, '#?0,0'); // top left padding
22 testClick(517, 562, '#?82,39'); // content area
23 testClick(539, 662, '#?105,54'); // lower right padding
24 testClick(540, 714, '#?115,63'); // lower right border
25 testClick(179, 350, '#?0,63'); // lower left border
26 testClick(248, 362, '#?0,52'); // lower left padding
27 testClick(695, 488, '#?102,0'); // upper right padding
28 testClick(759, 479, '#?112,0'); // upper right border
29 }
30 };
31 </script>
32
33 <style> 5 <style>
34 img { 6 img {
35 position: absolute; 7 position: absolute;
36 left: 50px; 8 left: 50px;
37 top: 60px; 9 top: 60px;
38 width: 100px; 10 width: 100px;
39 height: 50px; 11 height: 50px;
40 border-left: 13px solid; 12 border-left: 13px solid;
41 border-top: 13px solid; 13 border-top: 13px solid;
42 border-right: 10px solid; 14 border-right: 10px solid;
43 border-bottom: 10px solid; 15 border-bottom: 10px solid;
44 padding-left: 17px; 16 padding-left: 17px;
45 padding-top: 17px; 17 padding-top: 17px;
46 padding-right: 10px; 18 padding-right: 10px;
47 padding-bottom: 10px; 19 padding-bottom: 10px;
48 transform: rotate(45deg); 20 transform: rotate(45deg);
49 } 21 }
50 </style> 22 </style>
51
52 <div style="zoom: 2;"><a href="#"><img src="data:image/gif;base64,R0lGODlhAQABAI AAAP///wAAACwAAAAAAQABAAACAkQBADs=" ismap></a></div> 23 <div style="zoom: 2;"><a href="#"><img src="data:image/gif;base64,R0lGODlhAQABAI AAAP///wAAACwAAAAAAQABAAACAkQBADs=" ismap></a></div>
53 24 <script>
54 <div id="description"></div> 25 async_test(function(t) {
55 <div id="console"></div> 26 window.onload = t.step_func_done(function() {
27 function testClick(x, y, expectedHash) {
28 location.hash = '#';
29 eventSender.mouseMoveTo(x, y);
30 eventSender.mouseDown();
31 eventSender.mouseUp();
32 assert_equals(location.hash, expectedHash);
33 }
34 if (window.eventSender && window.internals) {
35 internals.setPageScaleFactor(1.25); // pinch scale
36 eventSender.setPageZoomFactor(1.5, 0, 0); // browser zoom
37 testClick(402, 122, '#?0,0'); // top left border
38 testClick(407, 204, '#?0,0'); // top left padding
39 testClick(517, 562, '#?82,39'); // content area
40 testClick(539, 662, '#?105,54'); // lower right padding
41 testClick(540, 714, '#?115,63'); // lower right border
42 testClick(179, 350, '#?0,63'); // lower left border
43 testClick(248, 362, '#?0,52'); // lower left padding
44 testClick(695, 488, '#?102,0'); // upper right padding
45 testClick(759, 479, '#?112,0'); // upper right border
46 }
47 });
48 });
49 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/images/server-side-imagemap-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698