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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js

Issue 2916743002: [DevTools] Introduce Common.List used as a backend for list controls (Closed)
Patch Set: addressed comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js
index 85d24f255ea4b8c72e84978a733e97b7308aad62..763d01ef7d613773cec7c376b9f1d1d572a3f60a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/list-control-various-height.js
@@ -30,14 +30,15 @@ class Delegate {
}
var delegate = new Delegate();
-var list = new UI.ListControl(delegate, UI.ListMode.VariousHeightItems);
+var model = new UI.ListModel();
+var list = new UI.ListControl(model, delegate, UI.ListMode.VariousHeightItems);
list.element.style.height = '73px';
UI.inspectorView.element.appendChild(list.element);
function dumpList()
{
var height = list.element.offsetHeight;
- TestRunner.addResult(`----list[length=${list.length()}][height=${height}]----`);
+ TestRunner.addResult(`----list[length=${model.length()}][height=${height}]----`);
for (var child of list.element.children) {
var offsetTop = child.getBoundingClientRect().top - list.element.getBoundingClientRect().top;
var offsetBottom = child.getBoundingClientRect().bottom - list.element.getBoundingClientRect().top;
@@ -52,7 +53,7 @@ function dumpList()
}
TestRunner.addResult('Adding 0, 1, 2');
-list.replaceAllItems([0, 1, 2]);
+model.replaceAllItems([0, 1, 2]);
dumpList();
TestRunner.addResult('Scrolling to 0');
@@ -64,7 +65,7 @@ list.scrollItemIntoView(2);
dumpList();
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]);
+model.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');
@@ -84,7 +85,7 @@ list.scrollItemIntoView(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]);
+model.replaceItemsInRange(0, 2, [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36]);
dumpList();
TestRunner.addResult('Scrolling to 18');
@@ -92,11 +93,11 @@ list.scrollItemIntoView(18);
dumpList();
TestRunner.addResult('Replacing 25-36 with 0-1');
-list.replaceItemsInRange(0, 12, [0, 1]);
+model.replaceItemsInRange(0, 12, [0, 1]);
dumpList();
TestRunner.addResult('Replacing 16-18 with 45');
-list.replaceItemsInRange(16, 19, [45]);
+model.replaceItemsInRange(16, 19, [45]);
dumpList();
TestRunner.addResult('Scrolling to 4');
@@ -104,7 +105,7 @@ list.scrollItemIntoView(4);
dumpList();
TestRunner.addResult('Replacing 45 with 16-18');
-list.replaceItemsInRange(16, 17, [16, 17, 18]);
+model.replaceItemsInRange(16, 17, [16, 17, 18]);
dumpList();
TestRunner.addResult('Resizing');

Powered by Google App Engine
This is Rietveld 408576698