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

Side by Side Diff: LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // A ScrollBehaviorTest runs a set of ScrollBehaviorTestCases. The only 1 // A ScrollBehaviorTest runs a set of ScrollBehaviorTestCases. The only
2 // ScrollBehaviorTest method that should be called by external code is run(). 2 // ScrollBehaviorTest method that should be called by external code is run().
3 3
4 // Creates a ScrollBehaviorTest with arguments: 4 // Creates a ScrollBehaviorTest with arguments:
5 // scrollElement - Element being scrolled. 5 // scrollElement - Element being scrolled.
6 // scrollEventTarget - Target for scroll events for |scrollElement|. 6 // scrollEventTarget - Target for scroll events for |scrollElement|.
7 // testsCases - Array of ScrollBehaviorTestCases. 7 // testsCases - Array of ScrollBehaviorTestCases.
8 // getEndPosition - Callback that takes a test case and start position, and 8 // getEndPosition - Callback that takes a test case and start position, and
9 // returns the corresponding end position (where positions 9 // returns the corresponding end position (where positions
10 // are dictionaries with x and y fields). 10 // are dictionaries with x and y fields).
(...skipping 29 matching lines...) Expand all
40 this.scrollElement.scrollTop = {y: testCase.endY, behavior: "instant"}; 40 this.scrollElement.scrollTop = {y: testCase.endY, behavior: "instant"};
41 this.testCaseComplete(); 41 this.testCaseComplete();
42 } 42 }
43 }; 43 };
44 44
45 ScrollBehaviorTest.prototype.startNextTestCase = function() { 45 ScrollBehaviorTest.prototype.startNextTestCase = function() {
46 if (this.currentTestCase >= this.testCases.length) { 46 if (this.currentTestCase >= this.testCases.length) {
47 this.allTestCasesComplete(); 47 this.allTestCasesComplete();
48 return; 48 return;
49 } 49 }
50
51 var testCase = this.testCases[this.currentTestCase]; 50 var testCase = this.testCases[this.currentTestCase];
52 var isSmoothTest = (testCase.js == "smooth" || (testCase.css == "smooth" && testCase.js != "instant")); 51 var isSmoothTest = (testCase.js == "smooth" || (testCase.css == "smooth" && testCase.js != "instant"));
53 52
54 this.asyncTest = async_test("Scroll x:" + testCase.x + ", y:" + testCase.y + ", smooth:" + isSmoothTest); 53 this.asyncTest = async_test("Scroll x:" + testCase.x + ", y:" + testCase.y + ", smooth:" + isSmoothTest);
55 54
56 var currentPosition = {}; 55 var currentPosition = {};
57 currentPosition.x = this.scrollElement.scrollLeft; 56 currentPosition.x = this.scrollElement.scrollLeft;
58 currentPosition.y = this.scrollElement.scrollTop; 57 currentPosition.y = this.scrollElement.scrollTop;
59 var endPosition = this.getEndPosition(testCase, currentPosition); 58 var endPosition = this.getEndPosition(testCase, currentPosition);
60 testCase.setStartPosition(currentPosition); 59 testCase.setStartPosition(currentPosition);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 124
126 ScrollBehaviorTestCase.prototype.setStartPosition = function(startPosition) { 125 ScrollBehaviorTestCase.prototype.setStartPosition = function(startPosition) {
127 this.startX = startPosition.x; 126 this.startX = startPosition.x;
128 this.startY = startPosition.y; 127 this.startY = startPosition.y;
129 } 128 }
130 129
131 ScrollBehaviorTestCase.prototype.setEndPosition = function(endPosition) { 130 ScrollBehaviorTestCase.prototype.setEndPosition = function(endPosition) {
132 this.endX = endPosition.x; 131 this.endX = endPosition.x;
133 this.endY = endPosition.y; 132 this.endY = endPosition.y;
134 } 133 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/scroll-behavior/listbox-scrollTop.html ('k') | LayoutTests/fast/text/international/listbox-width-rtl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698