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

Side by Side Diff: LayoutTests/scrollingcoordinator/non-fast-scrollable-visibility-change.html

Issue 878573004: Increase reliablity of scorllingcoordinator layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectation Created 5 years, 11 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3 body { 3 body {
4 margin: 0; 4 margin: 0;
5 } 5 }
6 .container { 6 .container {
7 height: 250px; 7 height: 250px;
8 width: 250px; 8 width: 250px;
9 margin-top: 50px; 9 margin-top: 50px;
10 display: block; 10 display: block;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 var index = 0; 70 var index = 0;
71 function next(){ 71 function next(){
72 if (index < testCases.length) { 72 if (index < testCases.length) {
73 var type = testCases[index][0]; 73 var type = testCases[index][0];
74 debug('running tests for non-fast scrollable ' + type); 74 debug('running tests for non-fast scrollable ' + type);
75 runTest.apply(this, testCases[index]); 75 runTest.apply(this, testCases[index]);
76 } else { 76 } else {
77 // Next 3 statements have no functional impact just visual 77 // Next 3 statements have no functional impact just visual
78 showSectionIf(function(){return true;}); 78 showSectionIf(function(){return true;});
79 awaitCompsitingUpdate(function(){ 79 awaitCompsitingUpdate(function(){
80 runNonFastScrollableRegionTest(); 80 drawNonFastScrollableRegionOverlays();
81 81
82 finishJSTest(); 82 finishJSTest();
83 }); 83 });
84 } 84 }
85 85
86 index++; 86 index++;
87 } 87 }
88 88
89 // Execute tests for given non-fast scrollable type. 89 // Execute tests for given non-fast scrollable type.
90 function runTest(type, elemToShowExpected, elemToHideExpected) { 90 function runTest(type, elemToShowExpected, elemToHideExpected) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 container.innerHTML = inner; 151 container.innerHTML = inner;
152 } 152 }
153 153
154 // Shows sections that pass condition but hides others 154 // Shows sections that pass condition but hides others
155 function showSectionIf(condition) { 155 function showSectionIf(condition) {
156 var sections = document.querySelectorAll('section'); 156 var sections = document.querySelectorAll('section');
157 for (var i = 0; i < sections.length; i++) 157 for (var i = 0; i < sections.length; i++)
158 sections[i].style.display = condition(sections[i]) ? 'block' : 'none'; 158 sections[i].style.display = condition(sections[i]) ? 'block' : 'none';
159 } 159 }
160
161 // Waits for one RAF call to ensure compositing update has occurred and invoke s task.
162 function awaitCompsitingUpdate(task) {
163 window.requestAnimationFrame(task);
164 }
165
166 function rectToString(rect) {
167 return '[' + [rect.left, rect.top, rect.width, rect.height].join(', ') + ']' ;
168 }
169 </script> 160 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698