Bug 1469533 - Remove sorting parameters r=Honza
authorAmir Sabbaghi <asaba90@gmail.com>
Wed, 04 Jul 2018 00:02:53 -0700
changeset 438306 f5baad77e684203185b7cc17e60aaf794058d7bb
parent 438305 9fcae361b33721545cf4355f678ee06d644ed212
child 438307 5b7e939320afea6d684f01db96d9dfa262fb7e4a
push id108279
push usernerli@mozilla.com
push dateWed, 26 Sep 2018 14:39:23 +0000
treeherdermozilla-inbound@f5baad77e684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1469533
milestone64.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 1469533 - Remove sorting parameters r=Honza
devtools/client/netmonitor/src/components/ParamsPanel.js
devtools/client/netmonitor/test/browser_net_post-data-01.js
devtools/client/netmonitor/test/browser_net_post-data-02.js
devtools/client/netmonitor/test/browser_net_post-data-03.js
--- a/devtools/client/netmonitor/src/components/ParamsPanel.js
+++ b/devtools/client/netmonitor/src/components/ParamsPanel.js
@@ -68,32 +68,35 @@ class ParamsPanel extends Component {
   }
 
   /**
    * Mapping array to dict for TreeView usage.
    * Since TreeView only support Object(dict) format.
    * This function also deal with duplicate key case
    * (for multiple selection and query params with same keys)
    *
+   * This function is not sorting result properties since it can
+   * results in unexpected order of params. See bug 1469533
+   *
    * @param {Object[]} arr - key-value pair array like query or form params
    * @returns {Object} Rep compatible object
    */
   getProperties(arr) {
-    return sortObjectKeys(arr.reduce((map, obj) => {
+    return arr.reduce((map, obj) => {
       const value = map[obj.name];
       if (value) {
         if (typeof value !== "object") {
           map[obj.name] = [value];
         }
         map[obj.name].push(obj.value);
       } else {
         map[obj.name] = obj.value;
       }
       return map;
-    }, {}));
+    }, {});
   }
 
   render() {
     const {
       openLink,
       request
     } = this.props;
     const {
--- a/devtools/client/netmonitor/test/browser_net_post-data-01.js
+++ b/devtools/client/netmonitor/test/browser_net_post-data-01.js
@@ -112,30 +112,30 @@ add_task(async function() {
       L10N.getStr(type == "urlencoded" ? "paramsFormData" : "paramsPostPayload"),
       "The post section doesn't have the correct title.");
 
     const labels = tabpanel
       .querySelectorAll("tr:not(.tree-section) .treeLabelCell .treeLabel");
     const values = tabpanel
       .querySelectorAll("tr:not(.tree-section) .treeValueCell .objectBox");
 
-    is(labels[0].textContent, "baz", "The first query param name was incorrect.");
-    is(values[0].textContent, "42", "The first query param value was incorrect.");
-    is(labels[1].textContent, "foo", "The second query param name was incorrect.");
-    is(values[1].textContent, "bar", "The second query param value was incorrect.");
+    is(labels[0].textContent, "foo", "The first query param name was incorrect.");
+    is(values[0].textContent, "bar", "The first query param value was incorrect.");
+    is(labels[1].textContent, "baz", "The second query param name was incorrect.");
+    is(values[1].textContent, "42", "The second query param value was incorrect.");
     is(labels[2].textContent, "type", "The third query param name was incorrect.");
     is(values[2].textContent, type, "The third query param value was incorrect.");
 
     if (type == "urlencoded") {
       checkVisibility("params");
       is(labels.length, 5, "There should be 5 param values displayed in this tabpanel.");
-      is(labels[3].textContent, "baz", "The first post param name was incorrect.");
-      is(values[3].textContent, "123", "The first post param value was incorrect.");
-      is(labels[4].textContent, "foo", "The second post param name was incorrect.");
-      is(values[4].textContent, "bar", "The second post param value was incorrect.");
+      is(labels[3].textContent, "foo", "The first post param name was incorrect.");
+      is(values[3].textContent, "bar", "The first post param value was incorrect.");
+      is(labels[4].textContent, "baz", "The second post param name was incorrect.");
+      is(values[4].textContent, "123", "The second post param value was incorrect.");
     } else {
       checkVisibility("params editor");
 
       is(labels.length, 3, "There should be 3 param values displayed in this tabpanel.");
 
       // Collect code lines and combine into one text for checking
       let text = "";
       const lines = [...document.querySelectorAll(".CodeMirror-line")];
--- a/devtools/client/netmonitor/test/browser_net_post-data-02.js
+++ b/devtools/client/netmonitor/test/browser_net_post-data-02.js
@@ -46,15 +46,15 @@ add_task(async function() {
     L10N.getStr("paramsFormData"),
     "The post section doesn't have the correct title.");
 
   const labels = tabpanel
     .querySelectorAll("tr:not(.tree-section) .treeLabelCell .treeLabel");
   const values = tabpanel
     .querySelectorAll("tr:not(.tree-section) .treeValueCell .objectBox");
 
-  is(labels[0].textContent, "baz", "The first query param name was incorrect.");
-  is(values[0].textContent, "123", "The first query param value was incorrect.");
-  is(labels[1].textContent, "foo", "The second query param name was incorrect.");
-  is(values[1].textContent, "bar", "The second query param value was incorrect.");
+  is(labels[0].textContent, "foo", "The first query param name was incorrect.");
+  is(values[0].textContent, "bar", "The first query param value was incorrect.");
+  is(labels[1].textContent, "baz", "The second query param name was incorrect.");
+  is(values[1].textContent, "123", "The second query param value was incorrect.");
 
   return teardown(monitor);
 });
--- a/devtools/client/netmonitor/test/browser_net_post-data-03.js
+++ b/devtools/client/netmonitor/test/browser_net_post-data-03.js
@@ -69,15 +69,15 @@ add_task(async function() {
     L10N.getStr("paramsFormData"),
     "The form data section doesn't have the correct title.");
 
   labels = tabpanel
     .querySelectorAll("tr:not(.tree-section) .treeLabelCell .treeLabel");
   values = tabpanel
     .querySelectorAll("tr:not(.tree-section) .treeValueCell .objectBox");
 
-  is(labels[0].textContent, "baz", "The first payload param name was incorrect.");
-  is(values[0].textContent, "123", "The first payload param value was incorrect.");
-  is(labels[1].textContent, "foo", "The second payload param name was incorrect.");
-  is(values[1].textContent, "bar", "The second payload param value was incorrect.");
+  is(labels[0].textContent, "foo", "The first payload param name was incorrect.");
+  is(values[0].textContent, "bar", "The first payload param value was incorrect.");
+  is(labels[1].textContent, "baz", "The second payload param name was incorrect.");
+  is(values[1].textContent, "123", "The second payload param value was incorrect.");
 
   return teardown(monitor);
 });