| Index: third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-grow.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-variable-height.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-grow.js
|
| similarity index 78%
|
| copy from third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-variable-height.js
|
| copy to third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-grow.js
|
| index bc49549bc6576d24c821225e0fddfeb71a6bf330..d0c19dc9692ceb4ce41166ae8a58e4a46419ce0c 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-variable-height.js
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-grow.js
|
| @@ -1,4 +1,4 @@
|
| -TestRunner.addResult('Test ListControl rendering for variable height case.');
|
| +TestRunner.addResult('Test ListControl rendering and selection for grow mode.');
|
|
|
| class Delegate {
|
| constructor() {
|
| @@ -7,13 +7,14 @@ class Delegate {
|
| createElementForItem(item) {
|
| TestRunner.addResult('Creating element for ' + item);
|
| var element = document.createElement('div');
|
| - element.style.height = this.heightForItem(item) + 'px';
|
| + element.style.height = (10 + item % 5) + 'px';
|
| element.textContent = item;
|
| return element;
|
| }
|
|
|
| heightForItem(item) {
|
| - return 7 + item % 10;
|
| + TestRunner.addResult('heightForItem should not be called');
|
| + return 10 + item % 5;
|
| }
|
|
|
| isItemSelectable(item) {
|
| @@ -30,9 +31,7 @@ class Delegate {
|
| }
|
|
|
| var delegate = new Delegate();
|
| -var list = new UI.ListControl(delegate);
|
| -list.setHeightMode(UI.ListHeightMode.Variable);
|
| -list.element.style.height = '73px';
|
| +var list = new UI.ListControl(delegate, UI.ListMode.Grow);
|
| UI.inspectorView.element.appendChild(list.element);
|
|
|
| function dumpList()
|
| @@ -48,7 +47,6 @@ function dumpList()
|
| var text = child === list._topElement ? 'top' : (child === list._bottomElement ? 'bottom' : child.textContent);
|
| TestRunner.addResult(`${visible}[${offsetTop}] ${text}${selected}`);
|
| }
|
| - TestRunner.addResult('offsets: ' + list._variableOffsets.join(' '));
|
| TestRunner.addResult('');
|
| }
|
|
|
| @@ -68,22 +66,10 @@ TestRunner.addResult('Adding 3-20');
|
| list.replaceItemsInRange(3, 3, [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]);
|
| dumpList();
|
|
|
| -TestRunner.addResult('Scrolling to 11');
|
| -list.scrollItemAtIndexIntoView(11);
|
| -dumpList();
|
| -
|
| TestRunner.addResult('Scrolling to 19');
|
| list.scrollItemAtIndexIntoView(19);
|
| dumpList();
|
|
|
| -TestRunner.addResult('Scrolling to 16');
|
| -list.scrollItemAtIndexIntoView(16);
|
| -dumpList();
|
| -
|
| -TestRunner.addResult('Scrolling to 3');
|
| -list.scrollItemAtIndexIntoView(3);
|
| -dumpList();
|
| -
|
| TestRunner.addResult('Replacing 0, 1 with 25-36');
|
| list.replaceItemsInRange(0, 2, [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36]);
|
| dumpList();
|
| @@ -108,9 +94,4 @@ TestRunner.addResult('Replacing 45 with 16-18');
|
| list.replaceItemsInRange(16, 17, [16, 17, 18]);
|
| dumpList();
|
|
|
| -TestRunner.addResult('Resizing');
|
| -list.element.style.height = '190px';
|
| -list.viewportResized();
|
| -dumpList();
|
| -
|
| TestRunner.completeTest();
|
|
|