Bug 1231179 - Make sessionStorage entry rows editable via double-click in storage inspector r=pbro
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Tue, 22 Mar 2016 14:24:56 +0000
changeset 291349 527346010e0fabf5a754308560c276ef36e0d05c
parent 291348 7a71674ba4dd50bfaa2795bf2f7583ccf75a964c
child 291350 5174488b2a590ce8c6ba9bed2d8458252af3b282
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1231179
milestone48.0a1
Bug 1231179 - Make sessionStorage entry rows editable via double-click in storage inspector r=pbro MozReview-Commit-ID: 3DFu6fyEdOS
devtools/client/storage/test/browser.ini
devtools/client/storage/test/browser_storage_sessionstorage_edit.js
devtools/client/storage/test/storage-sessionstorage.html
devtools/client/storage/ui.js
--- a/devtools/client/storage/test/browser.ini
+++ b/devtools/client/storage/test/browser.ini
@@ -1,25 +1,27 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 support-files =
+  storage-complex-values.html
   storage-cookies.html
-  storage-complex-values.html
   storage-listings.html
   storage-localstorage.html
   storage-overflow.html
   storage-search.html
   storage-secured-iframe.html
+  storage-sessionstorage.html
   storage-unsecured-iframe.html
   storage-updates.html
   head.js
 
 [browser_storage_basic.js]
-[browser_storage_dynamic_updates.js]
 [browser_storage_cookies_edit.js]
 [browser_storage_cookies_edit_keyboard.js]
 [browser_storage_cookies_tab_navigation.js]
+[browser_storage_dynamic_updates.js]
 [browser_storage_localstorage_edit.js]
 [browser_storage_overflow.js]
 [browser_storage_search.js]
+[browser_storage_sessionstorage_edit.js]
 [browser_storage_sidebar.js]
 [browser_storage_values.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/storage/test/browser_storage_sessionstorage_edit.js
@@ -0,0 +1,25 @@
+/* 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/. */
+
+// Basic test to check the editing of localStorage.
+
+"use strict";
+
+add_task(function*() {
+  yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-sessionstorage.html");
+
+  yield selectTreeItem(["sessionStorage", "http://test1.example.org"]);
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
+
+  yield editCell("TestSS1", "name", "newTestSS1");
+  yield editCell("newTestSS1", "value", "newValueSS1");
+
+  yield editCell("TestSS3", "name", "newTestSS3");
+  yield editCell("newTestSS3", "value", "newValueSS3");
+
+  yield editCell("TestSS5", "name", "newTestSS5");
+  yield editCell("newTestSS5", "value", "newValueSS5");
+
+  yield finishTests();
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/storage/test/storage-sessionstorage.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+  <!--
+  Bug 1231179 - Storage inspector front end - tests
+  -->
+  <head>
+    <meta charset="utf-8" />
+    <title>Storage inspector sessionStorage test</title>
+    <script type="application/javascript;version=1.7">
+      "use strict";
+
+      function setup() {
+        sessionStorage.setItem("TestSS1", "ValueSS1");
+        sessionStorage.setItem("TestSS2", "ValueSS2");
+        sessionStorage.setItem("TestSS3", "ValueSS3");
+        sessionStorage.setItem("TestSS4", "ValueSS4");
+        sessionStorage.setItem("TestSS5", "ValueSS5");
+      }
+    </script>
+  </head>
+  <body onload="setup()">
+  </body>
+</html>
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -145,18 +145,17 @@ StorageUI.prototype = {
     let type = this.table.datatype;
 
     return this.storageTypes[type];
   },
 
   makeFieldsEditable: function() {
     let actor = this.getCurrentActor();
 
-    if (typeof actor.getEditableFields !== "undefined" &&
-        this.table.datatype !== "sessionStorage") {
+    if (typeof actor.getEditableFields !== "undefined") {
       actor.getEditableFields().then(fields => {
         this.table.makeFieldsEditable(fields);
       });
     } else if (this.table._editableFieldsEngine) {
       this.table._editableFieldsEngine.destroy();
     }
   },