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

Side by Side Diff: LayoutTests/perf/compositor-touch-hit-rects.html

Issue 540613004: Fix compositor-touch-hit-rects.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <style> 3 <style>
4 #test { 4 #test {
5 height: 0px; 5 height: 0px;
6 } 6 }
7 .child { 7 .child {
8 height: 5px; 8 height: 5px;
9 width: 5px; 9 width: 5px;
10 margin: 5px; 10 margin: 5px;
11 } 11 }
12 .layer { 12 .layer {
13 -webkit-transform: translateZ(0); 13 -webkit-transform: translateZ(0);
14 } 14 }
15 </style> 15 </style>
16 </head> 16 </head>
17 <body> 17 <body>
18 <pre id='log'>
19 </pre>
20 <div id='test'> 18 <div id='test'>
21 </div> 19 </div>
22 <script src="../resources/magnitude-perf.js"></script> 20 <script src="../resources/magnitude-perf.js"></script>
23 <script> 21 <script>
24 22
25 function log(msg) 23 function log(msg)
26 { 24 {
27 document.getElementById('log').innerText += msg + '\n'; 25 Magnitude._log(msg);
28 } 26 }
29 27
30 var testNode; 28 var testNode;
31 29
32 function setupFunction(magnitude, className) 30 function setupFunction(magnitude, className)
33 { 31 {
34 testNode = document.getElementById('test'); 32 testNode = document.getElementById('test');
35 testNode.innerHTML = ''; 33 testNode.innerHTML = '';
36 for(var i = 0; i < magnitude; i++) { 34 for(var i = 0; i < magnitude; i++) {
37 var child = document.createElement('div'); 35 var child = document.createElement('div');
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // For example, run in content_shell with --expose-internals-for-testing. 74 // For example, run in content_shell with --expose-internals-for-testing.
77 testNode.removeEventListener('touchstart', touchHandler); 75 testNode.removeEventListener('touchstart', touchHandler);
78 } 76 }
79 77
80 Magnitude.description('Tests that compositor touch hit rect calculation is ' + 78 Magnitude.description('Tests that compositor touch hit rect calculation is ' +
81 'linear in the number of rects and in the number of layers .'); 79 'linear in the number of rects and in the number of layers .');
82 80
83 // Wait for first layout. 81 // Wait for first layout.
84 document.body.getBoundingClientRect(); 82 document.body.getBoundingClientRect();
85 83
86 // Verify that compositor touch hit testing is properly enabled. 84 function main()
87 if (window.internals) { 85 {
86 // Verify that compositor touch hit testing is properly enabled.
87 if (!window.internals) {
88 log("WARNING - missing windows.internals, can't verify hit testing is en abled.");
89 return;
90 }
88 var testNode = document.getElementById('test'); 91 var testNode = document.getElementById('test');
89 r = testNode.getBoundingClientRect(); 92 r = testNode.getBoundingClientRect();
90 93
91 testNode.addEventListener('touchstart', touchHandler); 94 testNode.addEventListener('touchstart', touchHandler);
92 var rects = window.internals.touchEventTargetLayerRects(document); 95 var rects = window.internals.touchEventTargetLayerRects(document);
93 if (!rects) { 96 if (!rects) {
94 log("FAIL - no hit test rects exist, is compositing enabled?"); 97 log("FAIL - no hit test rects exist, is compositing enabled?");
95 return; 98 return;
96 } 99 }
97 if (!rects.length) { 100 if (!rects.length) {
98 log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTest ingEnabled false?"); 101 log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTest ingEnabled false?");
102 return;
99 } 103 }
100 testNode.removeEventListener('touchstart', touchHandler); 104 testNode.removeEventListener('touchstart', touchHandler);
101 } else {
102 log("WARNING - missing windows.internals, can't verify hit testing is enable d.");
103 }
104 105
105 106
106 Magnitude.trim = 1; 107 Magnitude.trim = 1;
107 Magnitude.tolerance = 0.80; 108 Magnitude.tolerance = 0.80;
108 109
109 Magnitude.initialExponent = 7; 110 Magnitude.initialExponent = 7;
110 Magnitude.numPoints = 5; 111 Magnitude.numPoints = 5;
111 Magnitude.run(setupFunction1, test, Magnitude.LINEAR); 112 Magnitude.run(setupFunction1, test, Magnitude.LINEAR);
112 113
113 Magnitude.initialExponent = 4; 114 Magnitude.initialExponent = 4;
114 Magnitude.numPoints = 5; 115 Magnitude.numPoints = 5;
115 Magnitude.run(setupFunction2, test, Magnitude.LINEAR); 116 Magnitude.run(setupFunction2, test, Magnitude.LINEAR);
117 }
118 main();
116 119
117 </script> 120 </script>
118 </body> 121 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698