Loading devtools/client/jsonview/test/browser_jsonview_valid_json.js +13 −8 Original line number Diff line number Diff line Loading @@ -14,20 +14,25 @@ add_task(function* () { ok(tab.linkedBrowser.contentPrincipal.isNullPrincipal, "Should have null principal"); let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow"); ok(countBefore == 3, "There must be three rows"); is(yield countRows(), 3, "There must be three rows"); let objectCellCount = yield getElementCount( ".jsonPanelBox .treeTable .objectCell"); ok(objectCellCount == 1, "There must be one object cell"); is(objectCellCount, 1, "There must be one object cell"); let objectCellText = yield getElementText( ".jsonPanelBox .treeTable .objectCell"); ok(objectCellText == "", "The summary is hidden when object is expanded"); is(objectCellText, "", "The summary is hidden when object is expanded"); // Collapsed auto-expanded node. yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel"); // Clicking the value does not collapse it (so that it can be selected and copied). yield clickJsonNode(".jsonPanelBox .treeTable .treeValueCell"); is(yield countRows(), 3, "There must still be three rows"); let countAfter = yield getElementCount(".jsonPanelBox .treeTable .treeRow"); ok(countAfter == 1, "There must be one row"); // Clicking the label collapses the auto-expanded node. yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel"); is(yield countRows(), 1, "There must be one row"); }); function countRows() { return getElementCount(".jsonPanelBox .treeTable .treeRow"); } devtools/client/shared/components/tree/tree-view.js +4 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,10 @@ define(function (require, exports, module) { onClickRow: function (nodePath, event) { event.stopPropagation(); let cell = event.target.closest("td"); if (cell && cell.classList.contains("treeLabelCell")) { this.toggle(nodePath); } this.selectRow(nodePath); }, Loading Loading
devtools/client/jsonview/test/browser_jsonview_valid_json.js +13 −8 Original line number Diff line number Diff line Loading @@ -14,20 +14,25 @@ add_task(function* () { ok(tab.linkedBrowser.contentPrincipal.isNullPrincipal, "Should have null principal"); let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow"); ok(countBefore == 3, "There must be three rows"); is(yield countRows(), 3, "There must be three rows"); let objectCellCount = yield getElementCount( ".jsonPanelBox .treeTable .objectCell"); ok(objectCellCount == 1, "There must be one object cell"); is(objectCellCount, 1, "There must be one object cell"); let objectCellText = yield getElementText( ".jsonPanelBox .treeTable .objectCell"); ok(objectCellText == "", "The summary is hidden when object is expanded"); is(objectCellText, "", "The summary is hidden when object is expanded"); // Collapsed auto-expanded node. yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel"); // Clicking the value does not collapse it (so that it can be selected and copied). yield clickJsonNode(".jsonPanelBox .treeTable .treeValueCell"); is(yield countRows(), 3, "There must still be three rows"); let countAfter = yield getElementCount(".jsonPanelBox .treeTable .treeRow"); ok(countAfter == 1, "There must be one row"); // Clicking the label collapses the auto-expanded node. yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel"); is(yield countRows(), 1, "There must be one row"); }); function countRows() { return getElementCount(".jsonPanelBox .treeTable .treeRow"); }
devtools/client/shared/components/tree/tree-view.js +4 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,10 @@ define(function (require, exports, module) { onClickRow: function (nodePath, event) { event.stopPropagation(); let cell = event.target.closest("td"); if (cell && cell.classList.contains("treeLabelCell")) { this.toggle(nodePath); } this.selectRow(nodePath); }, Loading