summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/test/browser_net_charts-03.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/netmonitor/test/browser_net_charts-03.js')
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-03.js45
1 files changed, 29 insertions, 16 deletions
diff --git a/devtools/client/netmonitor/test/browser_net_charts-03.js b/devtools/client/netmonitor/test/browser_net_charts-03.js
index c7d9b0c1a..4a655a8ca 100644
--- a/devtools/client/netmonitor/test/browser_net_charts-03.js
+++ b/devtools/client/netmonitor/test/browser_net_charts-03.js
@@ -33,6 +33,10 @@ add_task(function* () {
totals: {
label1: value => "Hello " + L10N.numberWithDecimals(value, 2),
label2: value => "World " + L10N.numberWithDecimals(value, 2)
+ },
+ header: {
+ label1: "label1header",
+ label2: "label2header",
}
});
@@ -51,39 +55,48 @@ add_task(function* () {
is(title.getAttribute("value"), "Table title",
"The title node displays the correct text.");
- is(rows.length, 3, "There should be 3 table chart rows created.");
+ is(rows.length, 4, "There should be 3 table chart rows and a header created.");
- ok(rows[0].querySelector(".table-chart-row-box.chart-colored-blob"),
- "A colored blob exists for the firt row.");
is(rows[0].querySelectorAll("label")[0].getAttribute("name"), "label1",
- "The first column of the first row exists.");
+ "The first column of the header exists.");
is(rows[0].querySelectorAll("label")[1].getAttribute("name"), "label2",
+ "The second column of the header exists.");
+ is(rows[0].querySelectorAll("span")[0].textContent, "label1header",
+ "The first column of the header displays the correct text.");
+ is(rows[0].querySelectorAll("span")[1].textContent, "label2header",
+ "The second column of the header displays the correct text.");
+
+ ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"),
+ "A colored blob exists for the firt row.");
+ is(rows[1].querySelectorAll("span")[0].getAttribute("name"), "label1",
+ "The first column of the first row exists.");
+ is(rows[1].querySelectorAll("span")[1].getAttribute("name"), "label2",
"The second column of the first row exists.");
- is(rows[0].querySelectorAll("label")[0].getAttribute("value"), "1",
+ is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "1",
"The first column of the first row displays the correct text.");
- is(rows[0].querySelectorAll("label")[1].getAttribute("value"), "11.1foo",
+ is(rows[1].querySelectorAll("label")[1].getAttribute("value"), "11.1foo",
"The second column of the first row displays the correct text.");
- ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"),
+ ok(rows[2].querySelector(".table-chart-row-box.chart-colored-blob"),
"A colored blob exists for the second row.");
- is(rows[1].querySelectorAll("label")[0].getAttribute("name"), "label1",
+ is(rows[2].querySelectorAll("label")[0].getAttribute("name"), "label1",
"The first column of the second row exists.");
- is(rows[1].querySelectorAll("label")[1].getAttribute("name"), "label2",
+ is(rows[2].querySelectorAll("label")[1].getAttribute("name"), "label2",
"The second column of the second row exists.");
- is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "2",
+ is(rows[2].querySelectorAll("label")[0].getAttribute("value"), "2",
"The first column of the second row displays the correct text.");
- is(rows[1].querySelectorAll("label")[1].getAttribute("value"), "12.2bar",
+ is(rows[2].querySelectorAll("label")[1].getAttribute("value"), "12.2bar",
"The second column of the first row displays the correct text.");
- ok(rows[2].querySelector(".table-chart-row-box.chart-colored-blob"),
+ ok(rows[3].querySelector(".table-chart-row-box.chart-colored-blob"),
"A colored blob exists for the third row.");
- is(rows[2].querySelectorAll("label")[0].getAttribute("name"), "label1",
+ is(rows[3].querySelectorAll("label")[0].getAttribute("name"), "label1",
"The first column of the third row exists.");
- is(rows[2].querySelectorAll("label")[1].getAttribute("name"), "label2",
+ is(rows[3].querySelectorAll("label")[1].getAttribute("name"), "label2",
"The second column of the third row exists.");
- is(rows[2].querySelectorAll("label")[0].getAttribute("value"), "3",
+ is(rows[3].querySelectorAll("label")[0].getAttribute("value"), "3",
"The first column of the third row displays the correct text.");
- is(rows[2].querySelectorAll("label")[1].getAttribute("value"), "13.3baz",
+ is(rows[3].querySelectorAll("label")[1].getAttribute("value"), "13.3baz",
"The second column of the third row displays the correct text.");
is(sums.length, 2, "There should be 2 total summaries created.");