Bug 1171903 - Test for storage inspector endless scrolling. r=miker
☠☠ backed out by d429bacbed6c ☠ ☠
authorTim Nguyen <ntim.bugs@gmail.com>
Tue, 08 Sep 2015 10:38:13 +0530
changeset 293793 eb7ef800ed124c654c8096dd86ec300a12a1c2ce
parent 293792 78a423ab972e6a7de5effb903f49ac7a056d60d8
child 293794 0e678808452535a11c121f26430ec26ffd5ebef2
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker
bugs1171903
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1171903 - Test for storage inspector endless scrolling. r=miker
browser/devtools/storage/test/browser.ini
browser/devtools/storage/test/browser_storage_overflow.js
browser/devtools/storage/test/storage-overflow.html
--- a/browser/devtools/storage/test/browser.ini
+++ b/browser/devtools/storage/test/browser.ini
@@ -1,15 +1,17 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 support-files =
   storage-complex-values.html
   storage-listings.html
+  storage-overflow.html
   storage-secured-iframe.html
   storage-unsecured-iframe.html
   storage-updates.html
   head.js
 
 [browser_storage_basic.js]
 [browser_storage_dynamic_updates.js]
+[browser_storage_overflow.js]
 [browser_storage_sidebar.js]
 [browser_storage_values.js]
new file mode 100644
--- /dev/null
+++ b/browser/devtools/storage/test/browser_storage_overflow.js
@@ -0,0 +1,38 @@
+// Test endless scrolling when a lot of items are present in the storage
+// inspector table.
+"use strict";
+
+add_task(function*() {
+  yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-overflow.html");
+
+  let $ = id => gPanelWindow.document.querySelector(id);
+  let $$ = sel => gPanelWindow.document.querySelectorAll(sel);
+
+  gUI.tree.expandAll();
+  yield selectTreeItem(["localStorage", "http://test1.example.org"]);
+
+  let table = $("#storage-table .table-widget-body");
+  let cellHeight = $(".table-widget-cell").getBoundingClientRect().height;
+
+  is($$("#value .table-widget-cell").length, 50,
+     "Table should initially display 50 items");
+
+  table.scrollTop += cellHeight * 50;
+  yield gUI.once("store-objects-updated");
+
+  is($$("#value .table-widget-cell").length, 100,
+     "Table should display 100 items after scrolling");
+
+  table.scrollTop += cellHeight * 50;
+  yield gUI.once("store-objects-updated");
+
+  is($$("#value .table-widget-cell").length, 150,
+     "Table should display 150 items after scrolling");
+
+  table.scrollTop += cellHeight * 50;
+  yield gUI.once("store-objects-updated");
+
+  is($$("#value .table-widget-cell").length, 200,
+     "Table should display all 200 items after scrolling");
+  yield finishTests();
+});
new file mode 100644
--- /dev/null
+++ b/browser/devtools/storage/test/storage-overflow.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Bug 1171903 - Storage Inspector endless scrolling
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Storage inspector endless scrolling test</title>
+</head>
+<body>
+<script type="text/javascript;version=1.8">
+"use strict";
+window.clear = () => {
+  localStorage.clear();
+};
+
+let array = new Array(200);
+
+for (let i = 0; i < array.length; i++) {
+  localStorage.setItem(`item-${i}`, `value-${i}`);
+}
+</script>
+</body>
+</html>