forked from mirrors/gecko-dev
Bug 1344286 - Fix eslint errors from devtools files ignored previously; r=gregtatum,ntim
MozReview-Commit-ID: CXVyorSle4l --HG-- extra : rebase_source : e74c20b2eeeeaf082be073a36da3f6fc4b57ab43
This commit is contained in:
parent
51fdfe5279
commit
46eb6c4e9d
17 changed files with 141 additions and 128 deletions
|
|
@ -101,7 +101,6 @@ browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
|
||||||
# devtools/ exclusions
|
# devtools/ exclusions
|
||||||
devtools/client/inspector/markup/test/doc_markup_events_*.html
|
devtools/client/inspector/markup/test/doc_markup_events_*.html
|
||||||
devtools/client/inspector/rules/test/doc_media_queries.html
|
devtools/client/inspector/rules/test/doc_media_queries.html
|
||||||
devtools/client/memory/test/chrome/*.html
|
|
||||||
devtools/client/performance/components/test/test_jit_optimizations_01.html
|
devtools/client/performance/components/test/test_jit_optimizations_01.html
|
||||||
devtools/client/responsive.html/test/browser/touch.html
|
devtools/client/responsive.html/test/browser/touch.html
|
||||||
devtools/client/shared/components/test/mochitest/*.html
|
devtools/client/shared/components/test/mochitest/*.html
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Test that children pointers show up at the correct times.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -52,8 +53,7 @@ Test that children pointers show up at the correct times.
|
||||||
|
|
||||||
ok(container.querySelector(".children-pointer"),
|
ok(container.querySelector(".children-pointer"),
|
||||||
"Do show children pointer when non-inverted and have children");
|
"Do show children pointer when non-inverted and have children");
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Test that we don't display `JS::ubi::RootList` for the root, and instead show "G
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -33,7 +34,7 @@ Test that we don't display `JS::ubi::RootList` for the root, and instead show "G
|
||||||
"Should not display `JS::ubi::RootList`");
|
"Should not display `JS::ubi::RootList`");
|
||||||
ok(container.textContent.includes("GC Roots"),
|
ok(container.textContent.includes("GC Roots"),
|
||||||
"Should display `GC Roots` instead");
|
"Should display `GC Roots` instead");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Test that we show a place holder for a subtree we are lazily fetching.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -26,7 +27,8 @@ Test that we show a place holder for a subtree we are lazily fetching.
|
||||||
const expanded = new Set();
|
const expanded = new Set();
|
||||||
expanded.add(root.nodeId);
|
expanded.add(root.nodeId);
|
||||||
|
|
||||||
await renderComponent(DominatorTreeComponent(immutableUpdate(TEST_DOMINATOR_TREE_PROPS, {
|
await renderComponent(DominatorTreeComponent(immutableUpdate(
|
||||||
|
TEST_DOMINATOR_TREE_PROPS, {
|
||||||
dominatorTree: immutableUpdate(TEST_DOMINATOR_TREE_PROPS.dominatorTree, {
|
dominatorTree: immutableUpdate(TEST_DOMINATOR_TREE_PROPS.dominatorTree, {
|
||||||
expanded,
|
expanded,
|
||||||
root,
|
root,
|
||||||
|
|
@ -38,7 +40,7 @@ Test that we show a place holder for a subtree we are lazily fetching.
|
||||||
ok(container.querySelector(".subtree-fetching"),
|
ok(container.querySelector(".subtree-fetching"),
|
||||||
"Expanded nodes with more children available, but no children " +
|
"Expanded nodes with more children available, but no children " +
|
||||||
"loaded, should get a placeholder");
|
"loaded, should get a placeholder");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Test that we show a link to load more children when some (but not all) are loade
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -29,7 +30,8 @@ Test that we show a link to load more children when some (but not all) are loade
|
||||||
const expanded = new Set();
|
const expanded = new Set();
|
||||||
expanded.add(root.nodeId);
|
expanded.add(root.nodeId);
|
||||||
|
|
||||||
await renderComponent(DominatorTreeComponent(immutableUpdate(TEST_DOMINATOR_TREE_PROPS, {
|
await renderComponent(DominatorTreeComponent(immutableUpdate(
|
||||||
|
TEST_DOMINATOR_TREE_PROPS, {
|
||||||
dominatorTree: immutableUpdate(TEST_DOMINATOR_TREE_PROPS.dominatorTree, {
|
dominatorTree: immutableUpdate(TEST_DOMINATOR_TREE_PROPS.dominatorTree, {
|
||||||
expanded,
|
expanded,
|
||||||
root,
|
root,
|
||||||
|
|
@ -38,7 +40,7 @@ Test that we show a link to load more children when some (but not all) are loade
|
||||||
|
|
||||||
ok(container.querySelector(".more-children"),
|
ok(container.querySelector(".more-children"),
|
||||||
"Should get a link to load more children");
|
"Should get a link to load more children");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Test that expanded DominatorTreeItems are correctly rendered and updated
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -32,7 +33,7 @@ Test that expanded DominatorTreeItems are correctly rendered and updated
|
||||||
const expanded = new Set();
|
const expanded = new Set();
|
||||||
expanded.add(root.nodeId);
|
expanded.add(root.nodeId);
|
||||||
|
|
||||||
let component = await renderComponent(
|
await renderComponent(
|
||||||
DominatorTreeComponent(immutableUpdate(
|
DominatorTreeComponent(immutableUpdate(
|
||||||
TEST_DOMINATOR_TREE_PROPS,
|
TEST_DOMINATOR_TREE_PROPS,
|
||||||
{
|
{
|
||||||
|
|
@ -64,8 +65,7 @@ Test that expanded DominatorTreeItems are correctly rendered and updated
|
||||||
"Should display only one row");
|
"Should display only one row");
|
||||||
is(container.querySelectorAll(".arrow.open").length, 0,
|
is(container.querySelectorAll(".arrow.open").length, 0,
|
||||||
"Should display no expanded arrow");
|
"Should display no expanded arrow");
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ Test that rendering a dominator tree error is handled correctly.
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
ok(React, "Should get React");
|
ok(React, "Should get React");
|
||||||
ok(Heap, "Should get Heap");
|
ok(Heap, "Should get Heap");
|
||||||
|
|
@ -38,7 +39,7 @@ Test that rendering a dominator tree error is handled correctly.
|
||||||
ok(container.querySelector(".error"), "Should render an error view");
|
ok(container.querySelector(".error"), "Should render an error view");
|
||||||
ok(container.textContent.includes(errorMessage),
|
ok(container.textContent.includes(errorMessage),
|
||||||
"Should see our error message");
|
"Should see our error message");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ Test that the currently selected view is rendered.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
ok(React, "Should get React");
|
ok(React, "Should get React");
|
||||||
ok(Heap, "Should get Heap");
|
ok(Heap, "Should get Heap");
|
||||||
|
|
||||||
const errorMessage = "Something went wrong!";
|
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
// Dominator tree view.
|
// Dominator tree view.
|
||||||
|
|
@ -66,7 +66,7 @@ Test that the currently selected view is rendered.
|
||||||
|
|
||||||
ok(container.querySelector("[data-state=initial]"),
|
ok(container.querySelector("[data-state=initial]"),
|
||||||
"With no snapshot, nor a diffing, should render initial prompt.");
|
"With no snapshot, nor a diffing, should render initial prompt.");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,12 @@ but not in other dominator tree states.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
for (let state of [dominatorTreeState.COMPUTING, dominatorTreeState.FETCHING]) {
|
for (const state of [dominatorTreeState.COMPUTING, dominatorTreeState.FETCHING]) {
|
||||||
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
||||||
view: { state: viewState.DOMINATOR_TREE, },
|
view: { state: viewState.DOMINATOR_TREE, },
|
||||||
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
||||||
|
|
@ -35,13 +36,17 @@ but not in other dominator tree states.
|
||||||
`Should show a throbber for state = ${state}`);
|
`Should show a throbber for state = ${state}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let state of [dominatorTreeState.LOADED, dominatorTreeState.INCREMENTAL_FETCHING]) {
|
for (
|
||||||
|
const state of [
|
||||||
|
dominatorTreeState.LOADED, dominatorTreeState.INCREMENTAL_FETCHING
|
||||||
|
]) {
|
||||||
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
||||||
view: { state: viewState.DOMINATOR_TREE, },
|
view: { state: viewState.DOMINATOR_TREE, },
|
||||||
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
||||||
dominatorTree: immutableUpdate(TEST_HEAP_PROPS.snapshot.dominatorTree, {
|
dominatorTree: immutableUpdate(TEST_HEAP_PROPS.snapshot.dominatorTree, {
|
||||||
state,
|
state,
|
||||||
activeFetchRequestCount: state === dominatorTreeState.INCREMENTAL_FETCHING ? 1 : undefined,
|
activeFetchRequestCount:
|
||||||
|
state === dominatorTreeState.INCREMENTAL_FETCHING ? 1 : undefined,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
})), container);
|
})), container);
|
||||||
|
|
@ -62,7 +67,7 @@ but not in other dominator tree states.
|
||||||
|
|
||||||
ok(!container.querySelector(".devtools-throbber"),
|
ok(!container.querySelector(".devtools-throbber"),
|
||||||
`Should not show a throbber for ERROR state`);
|
`Should not show a throbber for ERROR state`);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ Test that we show the "hey you're not recording allocation stacks" message at th
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -109,7 +110,7 @@ Test that we show the "hey you're not recording allocation stacks" message at th
|
||||||
|
|
||||||
ok(!container.querySelector(".no-allocation-stacks"),
|
ok(!container.querySelector(".no-allocation-stacks"),
|
||||||
"When there isn't census data, we should not show the message");
|
"When there isn't census data, we should not show the message");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ Test that we show a message when the census results are empty.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -110,7 +111,8 @@ Test that we show a message when the census results are empty.
|
||||||
|
|
||||||
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
await renderComponent(Heap(immutableUpdate(TEST_HEAP_PROPS, {
|
||||||
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
snapshot: immutableUpdate(TEST_HEAP_PROPS.snapshot, {
|
||||||
census: immutableUpdate(TEST_HEAP_PROPS.snapshot.census, immutableUpdate(emptyCensus, {
|
census: immutableUpdate(
|
||||||
|
TEST_HEAP_PROPS.snapshot.census, immutableUpdate(emptyCensus, {
|
||||||
filter: "zzzz"
|
filter: "zzzz"
|
||||||
})),
|
})),
|
||||||
}),
|
}),
|
||||||
|
|
@ -119,8 +121,7 @@ Test that we show a message when the census results are empty.
|
||||||
ok(container.querySelector(".empty"),
|
ok(container.querySelector(".empty"),
|
||||||
"When the report is empty in census view w/ filter, we show the empty message");
|
"When the report is empty in census view w/ filter, we show the empty message");
|
||||||
ok(container.textContent.includes(L10N.getStr("heapview.none-match")));
|
ok(container.textContent.includes(L10N.getStr("heapview.none-match")));
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,14 @@ Test to verify the delete button calls the onDelete handler for an item
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
let deletedSnapshots = [];
|
const deletedSnapshots = [];
|
||||||
|
|
||||||
let snapshots = [ TEST_SNAPSHOT, TEST_SNAPSHOT, TEST_SNAPSHOT ]
|
const snapshots = [ TEST_SNAPSHOT, TEST_SNAPSHOT, TEST_SNAPSHOT ]
|
||||||
.map((snapshot, index) => immutableUpdate(snapshot, {
|
.map((snapshot, index) => immutableUpdate(snapshot, {
|
||||||
index: snapshot.index + index
|
index: snapshot.index + index
|
||||||
}));
|
}));
|
||||||
|
|
@ -36,9 +37,9 @@ Test to verify the delete button calls the onDelete handler for an item
|
||||||
container
|
container
|
||||||
);
|
);
|
||||||
|
|
||||||
let deleteButtons = container.querySelectorAll('.delete');
|
const deleteButtons = container.querySelectorAll(".delete");
|
||||||
|
|
||||||
is(container.querySelectorAll('.snapshot-list-item').length, 3,
|
is(container.querySelectorAll(".snapshot-list-item").length, 3,
|
||||||
"There are 3 list items\n");
|
"There are 3 list items\n");
|
||||||
is(deletedSnapshots.length, 0,
|
is(deletedSnapshots.length, 0,
|
||||||
"Not snapshots have been deleted\n");
|
"Not snapshots have been deleted\n");
|
||||||
|
|
@ -60,9 +61,7 @@ Test to verify the delete button calls the onDelete handler for an item
|
||||||
is(deletedSnapshots.length, 3, "Three snapshots were deleted\n");
|
is(deletedSnapshots.length, 3, "Three snapshots were deleted\n");
|
||||||
is(deletedSnapshots[2], snapshots[2],
|
is(deletedSnapshots[2], snapshots[2],
|
||||||
"Deleted snapshot was added to the deleted list\n");
|
"Deleted snapshot was added to the deleted list\n");
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ Test that the ShortestPaths component properly renders a graph of the merged sho
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -38,7 +39,7 @@ Test that the ShortestPaths component properly renders a graph of the merged sho
|
||||||
let found2to3 = false;
|
let found2to3 = false;
|
||||||
|
|
||||||
const tspans = [...container.querySelectorAll("tspan")];
|
const tspans = [...container.querySelectorAll("tspan")];
|
||||||
for (let el of tspans) {
|
for (const el of tspans) {
|
||||||
const text = el.textContent.trim();
|
const text = el.textContent.trim();
|
||||||
dumpn("tspan's text = " + text);
|
dumpn("tspan's text = " + text);
|
||||||
|
|
||||||
|
|
@ -99,8 +100,7 @@ Test that the ShortestPaths component properly renders a graph of the merged sho
|
||||||
ok(found1to2, "Should have rendered edge 1->2");
|
ok(found1to2, "Should have rendered edge 1->2");
|
||||||
ok(found1to3, "Should have rendered edge 1->3");
|
ok(found1to3, "Should have rendered edge 1->3");
|
||||||
ok(found2to3, "Should have rendered edge 2->3");
|
ok(found2to3, "Should have rendered edge 2->3");
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ Test that the ShortestPaths component renders a suggestion to select a node when
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -33,7 +34,7 @@ Test that the ShortestPaths component renders a suggestion to select a node when
|
||||||
|
|
||||||
ok(container.textContent.includes(L10N.getStr("shortest-paths.select-node")),
|
ok(container.textContent.includes(L10N.getStr("shortest-paths.select-node")),
|
||||||
"The node selection prompt is displayed");
|
"The node selection prompt is displayed");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ path.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
|
|
@ -25,7 +26,7 @@ path.
|
||||||
container
|
container
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(container.querySelector('.delete'),
|
ok(container.querySelector(".delete"),
|
||||||
"Should have delete button when there is a path");
|
"Should have delete button when there is a path");
|
||||||
|
|
||||||
const pathlessProps = immutableUpdate(
|
const pathlessProps = immutableUpdate(
|
||||||
|
|
@ -38,10 +39,9 @@ path.
|
||||||
container
|
container
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(!container.querySelector('.delete'),
|
ok(!container.querySelector(".delete"),
|
||||||
"No delete button should be found if there is no path\n");
|
"No delete button should be found if there is no path\n");
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,14 @@ Test that the Toolbar component shows the view switcher only at the appropriate
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
// Census and dominator tree views.
|
// Census and dominator tree views.
|
||||||
|
|
||||||
for (let view of [viewState.CENSUS, viewState.DOMINATOR_TREE]) {
|
for (const view of [viewState.CENSUS, viewState.DOMINATOR_TREE]) {
|
||||||
await renderComponent(Toolbar(immutableUpdate(TEST_TOOLBAR_PROPS, {
|
await renderComponent(Toolbar(immutableUpdate(TEST_TOOLBAR_PROPS, {
|
||||||
view: { state: view },
|
view: { state: view },
|
||||||
})), container);
|
})), container);
|
||||||
|
|
@ -35,7 +36,7 @@ Test that the Toolbar component shows the view switcher only at the appropriate
|
||||||
|
|
||||||
ok(!container.querySelector("#select-view"),
|
ok(!container.querySelector("#select-view"),
|
||||||
"The view selector is NOT shown in the DIFFING view");
|
"The view selector is NOT shown in the DIFFING view");
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,19 @@ Test that the Tree Map correctly renders onto 2 managed canvases.
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script src="head.js" type="application/javascript"></script>
|
<script src="head.js" type="application/javascript"></script>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
window.onload = async function () {
|
"use strict";
|
||||||
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
const container = document.getElementById("container");
|
const container = document.getElementById("container");
|
||||||
|
|
||||||
await renderComponent(TreeMap(TEST_TREE_MAP_PROPS), container);
|
await renderComponent(TreeMap(TEST_TREE_MAP_PROPS), container);
|
||||||
|
|
||||||
let treeMapContainer = container.querySelector(".tree-map-container");
|
const treeMapContainer = container.querySelector(".tree-map-container");
|
||||||
ok(treeMapContainer, "Component creates a container");
|
ok(treeMapContainer, "Component creates a container");
|
||||||
|
|
||||||
let canvases = treeMapContainer.querySelectorAll("canvas");
|
const canvases = treeMapContainer.querySelectorAll("canvas");
|
||||||
is(canvases.length, 2, "Creates 2 canvases");
|
is(canvases.length, 2, "Creates 2 canvases");
|
||||||
|
} catch (e) {
|
||||||
} catch(e) {
|
|
||||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||||
} finally {
|
} finally {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue