Loading devtools/client/storage/test/browser.ini +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ support-files = storage-cache-basic-iframe.html storage-cache-basic.html storage-cache-error.html storage-cache-overflow.html storage-complex-keys.html storage-complex-values.html storage-cookies.html Loading Loading @@ -47,6 +48,7 @@ tags = usercontextid skip-if = !fission # Bug 1685474 win10_2004 # Bug 1723573 [browser_storage_cache_overflow.js] [browser_storage_cookies_add.js] [browser_storage_cookies_delete_all.js] [browser_storage_cookies_domain.js] Loading devtools/client/storage/test/browser_storage_cache_overflow.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Test endless scrolling when a lot of items are present in the storage // inspector table for Cache storage. "use strict"; const ITEMS_PER_PAGE = 50; add_task(async function() { await openTabAndSetupStorage( URL_ROOT_COM_SSL + "storage-cache-overflow.html" ); gUI.tree.expandAll(); await selectTreeItem(["Cache", "https://example.com", "lorem"]); checkCellLength(ITEMS_PER_PAGE); await scroll(); checkCellLength(ITEMS_PER_PAGE * 2); info("Close Toolbox"); await gDevTools.closeToolboxForTab(gBrowser.selectedTab); }); devtools/client/storage/test/head.js +7 −4 Original line number Diff line number Diff line Loading @@ -1059,10 +1059,13 @@ async function performAdd(store) { is(rowId, value, `Row '${rowId}' was successfully added.`); } // Cell css selector that can be used to count or select cells. // The selector is restricted to a single column to avoid counting duplicates. const CELL_SELECTOR = "#storage-table .table-widget-wrapper:first-child .table-widget-cell"; function checkCellLength(len) { const cells = gPanelWindow.document.querySelectorAll( "#name .table-widget-cell" ); const cells = gPanelWindow.document.querySelectorAll(CELL_SELECTOR); const msg = `Table should initially display ${len} items`; is(cells.length, len, msg); Loading @@ -1071,7 +1074,7 @@ function checkCellLength(len) { async function scroll() { const $ = id => gPanelWindow.document.querySelector(id); const table = $("#storage-table .table-widget-body"); const cell = $("#name .table-widget-cell"); const cell = $(CELL_SELECTOR); const cellHeight = cell.getBoundingClientRect().height; const onStoresUpdate = gUI.once("store-objects-updated"); Loading devtools/client/storage/test/storage-cache-overflow.html 0 → 100644 +24 −0 Original line number Diff line number Diff line <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Storage inspector test for Cache</title> </head> <body> <h1>Cache overflow</h1> <script> "use strict"; async function setup() { // eslint-disable-line no-unused-vars caches.open("lorem").then(cache => { for (let i = 0; i < 100; i++) { cache.add(`storage-blank.html?${i}`); } }); } function clear() { // eslint-disable-line no-unused-vars caches.delete("lorem"); } </script> </body> </html> devtools/server/actors/storage.js +8 −1 Original line number Diff line number Diff line Loading @@ -439,7 +439,14 @@ StorageActors.defaults = function(typeName, observationTopics) { } } if (this.typeName === "Cache") { // Cache storage contains several items per name but misses a custom // `getObjectsSize` implementation, as implemented for IndexedDB. // See Bug 1745242. toReturn.total = toReturn.data.length; } else { toReturn.total = this.getObjectsSize(host, names, options); } } else { let obj = await this.getValuesForHost( host, Loading Loading
devtools/client/storage/test/browser.ini +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ support-files = storage-cache-basic-iframe.html storage-cache-basic.html storage-cache-error.html storage-cache-overflow.html storage-complex-keys.html storage-complex-values.html storage-cookies.html Loading Loading @@ -47,6 +48,7 @@ tags = usercontextid skip-if = !fission # Bug 1685474 win10_2004 # Bug 1723573 [browser_storage_cache_overflow.js] [browser_storage_cookies_add.js] [browser_storage_cookies_delete_all.js] [browser_storage_cookies_domain.js] Loading
devtools/client/storage/test/browser_storage_cache_overflow.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Test endless scrolling when a lot of items are present in the storage // inspector table for Cache storage. "use strict"; const ITEMS_PER_PAGE = 50; add_task(async function() { await openTabAndSetupStorage( URL_ROOT_COM_SSL + "storage-cache-overflow.html" ); gUI.tree.expandAll(); await selectTreeItem(["Cache", "https://example.com", "lorem"]); checkCellLength(ITEMS_PER_PAGE); await scroll(); checkCellLength(ITEMS_PER_PAGE * 2); info("Close Toolbox"); await gDevTools.closeToolboxForTab(gBrowser.selectedTab); });
devtools/client/storage/test/head.js +7 −4 Original line number Diff line number Diff line Loading @@ -1059,10 +1059,13 @@ async function performAdd(store) { is(rowId, value, `Row '${rowId}' was successfully added.`); } // Cell css selector that can be used to count or select cells. // The selector is restricted to a single column to avoid counting duplicates. const CELL_SELECTOR = "#storage-table .table-widget-wrapper:first-child .table-widget-cell"; function checkCellLength(len) { const cells = gPanelWindow.document.querySelectorAll( "#name .table-widget-cell" ); const cells = gPanelWindow.document.querySelectorAll(CELL_SELECTOR); const msg = `Table should initially display ${len} items`; is(cells.length, len, msg); Loading @@ -1071,7 +1074,7 @@ function checkCellLength(len) { async function scroll() { const $ = id => gPanelWindow.document.querySelector(id); const table = $("#storage-table .table-widget-body"); const cell = $("#name .table-widget-cell"); const cell = $(CELL_SELECTOR); const cellHeight = cell.getBoundingClientRect().height; const onStoresUpdate = gUI.once("store-objects-updated"); Loading
devtools/client/storage/test/storage-cache-overflow.html 0 → 100644 +24 −0 Original line number Diff line number Diff line <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Storage inspector test for Cache</title> </head> <body> <h1>Cache overflow</h1> <script> "use strict"; async function setup() { // eslint-disable-line no-unused-vars caches.open("lorem").then(cache => { for (let i = 0; i < 100; i++) { cache.add(`storage-blank.html?${i}`); } }); } function clear() { // eslint-disable-line no-unused-vars caches.delete("lorem"); } </script> </body> </html>
devtools/server/actors/storage.js +8 −1 Original line number Diff line number Diff line Loading @@ -439,7 +439,14 @@ StorageActors.defaults = function(typeName, observationTopics) { } } if (this.typeName === "Cache") { // Cache storage contains several items per name but misses a custom // `getObjectsSize` implementation, as implemented for IndexedDB. // See Bug 1745242. toReturn.total = toReturn.data.length; } else { toReturn.total = this.getObjectsSize(host, names, options); } } else { let obj = await this.getValuesForHost( host, Loading