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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/static-viewport-control.html

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 <html> 1 <html>
2 <head> 2 <head>
3 <base href="/inspector-debug/"></base> 3 <base href="/inspector-debug/"></base>
4 <script src="/inspector-debug/Runtime.js"></script> 4 <script src="/inspector-debug/Runtime.js"></script>
5 <script src="/inspector-unit/inspector-unit-test.js"></script> 5 <script src="/inspector-unit/inspector-unit-test.js"></script>
6 <script> 6 <script>
7 function test() { 7 function test() {
8 var items = []; 8 var items = [];
9 var heights = []; 9 var heights = [];
10 for (var i = 0; i < 100; i++){ 10 for (var i = 0; i < 100; i++){
11 items[i] = document.createElement("div"); 11 items[i] = document.createElement("div");
12 items[i].style.height = (heights[i] = (i % 4) ? 50 : 28) + "px"; 12 items[i].style.height = (heights[i] = (i % 4) ? 50 : 28) + "px";
13 items[i].textContent = i; 13 items[i].textContent = i;
14 } 14 }
15 var viewport = new WebInspector.StaticViewportControl({ 15 var viewport = new UI.StaticViewportControl({
16 fastItemHeight: i => heights[i], 16 fastItemHeight: i => heights[i],
17 itemCount: _ => items.length, 17 itemCount: _ => items.length,
18 itemElement: i => items[i] 18 itemElement: i => items[i]
19 }); 19 });
20 viewport.element.style.height = "300px"; 20 viewport.element.style.height = "300px";
21 WebInspector.inspectorView.element.appendChild(viewport.element); 21 UI.inspectorView.element.appendChild(viewport.element);
22 22
23 viewport.refresh(); 23 viewport.refresh();
24 dumpViewport(); 24 dumpViewport();
25 25
26 viewport.forceScrollItemToBeFirst(26); 26 viewport.forceScrollItemToBeFirst(26);
27 dumpViewport(); 27 dumpViewport();
28 28
29 viewport.scrollItemIntoView(33); 29 viewport.scrollItemIntoView(33);
30 dumpViewport(); 30 dumpViewport();
31 31
(...skipping 21 matching lines...) Expand all
53 UnitTest.addResult("Active Items:" + viewport._innerElement.children.len gth); 53 UnitTest.addResult("Active Items:" + viewport._innerElement.children.len gth);
54 UnitTest.addResult(""); 54 UnitTest.addResult("");
55 } 55 }
56 } 56 }
57 </script> 57 </script>
58 </head> 58 </head>
59 <body> 59 <body>
60 This tests if the StaticViewportControl works properly. 60 This tests if the StaticViewportControl works properly.
61 </body> 61 </body>
62 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698