Bug 1256757 - Add tests. r=jryans
authorJan Odvarko <odvarko@gmail.com>
Thu, 17 Mar 2016 12:49:56 +0100
changeset 289598 3ce5d23d337f45ae96100c00ab994b53d202d7c4
parent 289597 f450e16672e4abfa30e9b9f9b764d8d9ca7f7bcc
child 289599 4eea3b603b0aca9c157dc2e9f3bb3c0d9f23b1c3
push id30107
push usercbook@mozilla.com
push dateTue, 22 Mar 2016 10:00:23 +0000
treeherdermozilla-central@3587b25bae30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1256757
milestone48.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 1256757 - Add tests. r=jryans
devtools/client/jsonview/test/browser_jsonview_copy_json.js
devtools/client/jsonview/test/browser_jsonview_filter.js
devtools/client/jsonview/test/browser_jsonview_invalid_json.js
devtools/client/jsonview/test/browser_jsonview_valid_json.js
devtools/client/jsonview/test/doc_frame_script.js
--- a/devtools/client/jsonview/test/browser_jsonview_copy_json.js
+++ b/devtools/client/jsonview/test/browser_jsonview_copy_json.js
@@ -7,20 +7,20 @@
 
 const TEST_JSON_URL = URL_ROOT + "simple_json.json";
 
 add_task(function* () {
   info("Test copy JSON started");
 
   yield addJsonViewTab(TEST_JSON_URL);
 
-  let countBefore = yield getElementCount(".jsonPanelBox .domTable .memberRow");
+  let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
   ok(countBefore == 1, "There must be one row");
 
-  let text = yield getElementText(".jsonPanelBox .domTable .memberRow");
+  let text = yield getElementText(".jsonPanelBox .treeTable .treeRow");
   is(text, "name\"value\"", "There must be proper JSON displayed");
 
   // Verify JSON copy into the clipboard.
   let value = "{\"name\": \"value\"}\n";
   let browser = gBrowser.selectedBrowser;
   let selector = ".jsonPanelBox .toolbar button.copy";
   yield waitForClipboardPromise(function setup() {
     BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
--- a/devtools/client/jsonview/test/browser_jsonview_filter.js
+++ b/devtools/client/jsonview/test/browser_jsonview_filter.js
@@ -7,22 +7,22 @@
 
 const TEST_JSON_URL = URL_ROOT + "array_json.json";
 
 add_task(function* () {
   info("Test valid JSON started");
 
   yield addJsonViewTab(TEST_JSON_URL);
 
-  let count = yield getElementCount(".jsonPanelBox .domTable .memberRow");
+  let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
   is(count, 3, "There must be three rows");
 
   // XXX use proper shortcut to focus the filter box
   // as soon as bug Bug 1178771 is fixed.
   yield sendString("h", ".jsonPanelBox .searchBox");
 
   // The filtering is done asynchronously so, we need to wait.
   yield waitForFilter();
 
   let hiddenCount = yield getElementCount(
-    ".jsonPanelBox .domTable .memberRow.hidden");
+    ".jsonPanelBox .treeTable .treeRow.hidden");
   is(hiddenCount, 2, "There must be two hidden rows");
 });
--- a/devtools/client/jsonview/test/browser_jsonview_invalid_json.js
+++ b/devtools/client/jsonview/test/browser_jsonview_invalid_json.js
@@ -7,14 +7,14 @@
 
 const TEST_JSON_URL = URL_ROOT + "invalid_json.json";
 
 add_task(function* () {
   info("Test invalid JSON started");
 
   yield addJsonViewTab(TEST_JSON_URL);
 
-  let count = yield getElementCount(".jsonPanelBox .domTable .memberRow");
+  let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
   ok(count == 0, "There must be no row");
 
   let text = yield getElementText(".jsonPanelBox .jsonParseError");
   ok(text, "There must be an error description");
 });
--- a/devtools/client/jsonview/test/browser_jsonview_valid_json.js
+++ b/devtools/client/jsonview/test/browser_jsonview_valid_json.js
@@ -7,16 +7,16 @@
 
 const TEST_JSON_URL = URL_ROOT + "valid_json.json";
 
 add_task(function* () {
   info("Test valid JSON started");
 
   yield addJsonViewTab(TEST_JSON_URL);
 
-  let countBefore = yield getElementCount(".jsonPanelBox .domTable .memberRow");
+  let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
   ok(countBefore == 1, "There must be one row");
 
-  yield expandJsonNode(".jsonPanelBox .domTable .memberLabel");
+  yield expandJsonNode(".jsonPanelBox .treeTable .treeLabel");
 
-  let countAfter = yield getElementCount(".jsonPanelBox .domTable .memberRow");
+  let countAfter = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
   ok(countAfter == 3, "There must be three rows");
 });
--- a/devtools/client/jsonview/test/doc_frame_script.js
+++ b/devtools/client/jsonview/test/doc_frame_script.js
@@ -67,17 +67,17 @@ addMessageListener("Test:JsonView:SendSt
 
   EventUtils.sendString(str, content);
 
   sendAsyncMessage(msg.name);
 });
 
 addMessageListener("Test:JsonView:WaitForFilter", function(msg) {
   let firstRow = content.document.querySelector(
-    ".jsonPanelBox .domTable .memberRow");
+    ".jsonPanelBox .treeTable .treeRow");
 
   // Check if the filter is already set.
   if (firstRow.classList.contains("hidden")) {
     sendAsyncMessage(msg.name);
     return;
   }
 
   // Wait till the first row has 'hidden' class set.