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:
Hemanth Kumar Veeranki 2018-06-16 15:45:58 +05:30
parent 51fdfe5279
commit 46eb6c4e9d
17 changed files with 141 additions and 128 deletions

View file

@ -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

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { window.onload = async function() {
try { try {
const container = document.getElementById("container"); const container = document.getElementById("container");
@ -52,7 +53,6 @@ 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 {

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { window.onload = async function() {
try { try {
const container = document.getElementById("container"); const container = document.getElementById("container");

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { 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,

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { 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,

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { 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,7 +65,6 @@ 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 {

View file

@ -15,6 +15,7 @@ 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">
"use strict";
window.onload = async function() { window.onload = async function() {
try { try {
ok(React, "Should get React"); ok(React, "Should get React");

View file

@ -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">
"use strict";
window.onload = async function() { 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.

View file

@ -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">
"use strict";
window.onload = async function() { 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);

View file

@ -14,6 +14,7 @@ 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">
"use strict";
window.onload = async function() { window.onload = async function() {
try { try {
const container = document.getElementById("container"); const container = document.getElementById("container");

View file

@ -14,6 +14,7 @@ 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">
"use strict";
window.onload = async function() { 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,7 +121,6 @@ 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 {

View file

@ -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">
"use strict";
window.onload = async function() { 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,8 +61,6 @@ 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 {

View file

@ -23,6 +23,7 @@ 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">
"use strict";
window.onload = async function() { 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,7 +100,6 @@ 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 {

View file

@ -23,6 +23,7 @@ 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">
"use strict";
window.onload = async function() { window.onload = async function() {
try { try {
const container = document.getElementById("container"); const container = document.getElementById("container");

View file

@ -16,6 +16,7 @@ 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">
"use strict";
window.onload = async function() { 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,9 +39,8 @@ 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 {

View file

@ -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">
"use strict";
window.onload = async function() { 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);

View file

@ -20,18 +20,18 @@ 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">
"use strict";
window.onload = async function() { 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 {