Bug 1311248 - Fix eslint 'linebreak-style' errors in devtools inspector tests to unhide eslint, r?jryans draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 24 Oct 2016 09:48:21 -0400
changeset 428643 ad2bc8779682285eec1149f682edeefd3c586cef
parent 428642 e66a1c116d1c2cb7ba35ee260d44eab2947455b1
child 534801 56d59b6a6bdc328b0b45191aa4eac3cbfbae89c0
push id33383
push userahalberstadt@mozilla.com
push dateMon, 24 Oct 2016 13:53:37 +0000
reviewersjryans
bugs1311248
milestone52.0a1
Bug 1311248 - Fix eslint 'linebreak-style' errors in devtools inspector tests to unhide eslint, r?jryans MozReview-Commit-ID: JHdWYFcK3pt
devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
devtools/client/inspector/test/browser_inspector_highlighter-cancel.js
--- a/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
+++ b/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
@@ -1,44 +1,44 @@
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that when a source map is missing/invalid, the rule view still loads
-// correctly.
-
-const TESTCASE_URI = URL_ROOT + "doc_invalid_sourcemap.html";
-const PREF = "devtools.styleeditor.source-maps-enabled";
-const CSS_LOC = "doc_invalid_sourcemap.css:1";
-
-add_task(function* () {
-  Services.prefs.setBoolPref(PREF, true);
-
-  yield addTab(TESTCASE_URI);
-  let {inspector, view} = yield openRuleView();
-
-  yield selectNode("div", inspector);
-
-  let ruleEl = getRuleViewRule(view, "div");
-  ok(ruleEl, "The 'div' rule exists in the rule-view");
-
-  let prop = getRuleViewProperty(view, "div", "color");
-  ok(prop, "The 'color' property exists in this rule");
-
-  let value = getRuleViewPropertyValue(view, "div", "color");
-  is(value, "gold", "The 'color' property has the right value");
-
-  yield verifyLinkText(view, CSS_LOC);
-
-  Services.prefs.clearUserPref(PREF);
-});
-
-function verifyLinkText(view, text) {
-  info("Verifying that the rule-view stylesheet link is " + text);
-  let label = getRuleViewLinkByIndex(view, 1)
-    .querySelector(".ruleview-rule-source-label");
-  return waitForSuccess(
-    () => label.textContent == text,
-    "Link text changed to display correct location: " + text
-  );
-}
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test that when a source map is missing/invalid, the rule view still loads
+// correctly.
+
+const TESTCASE_URI = URL_ROOT + "doc_invalid_sourcemap.html";
+const PREF = "devtools.styleeditor.source-maps-enabled";
+const CSS_LOC = "doc_invalid_sourcemap.css:1";
+
+add_task(function* () {
+  Services.prefs.setBoolPref(PREF, true);
+
+  yield addTab(TESTCASE_URI);
+  let {inspector, view} = yield openRuleView();
+
+  yield selectNode("div", inspector);
+
+  let ruleEl = getRuleViewRule(view, "div");
+  ok(ruleEl, "The 'div' rule exists in the rule-view");
+
+  let prop = getRuleViewProperty(view, "div", "color");
+  ok(prop, "The 'color' property exists in this rule");
+
+  let value = getRuleViewPropertyValue(view, "div", "color");
+  is(value, "gold", "The 'color' property has the right value");
+
+  yield verifyLinkText(view, CSS_LOC);
+
+  Services.prefs.clearUserPref(PREF);
+});
+
+function verifyLinkText(view, text) {
+  info("Verifying that the rule-view stylesheet link is " + text);
+  let label = getRuleViewLinkByIndex(view, 1)
+    .querySelector(".ruleview-rule-source-label");
+  return waitForSuccess(
+    () => label.textContent == text,
+    "Link text changed to display correct location: " + text
+  );
+}
--- a/devtools/client/inspector/test/browser_inspector_highlighter-cancel.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-cancel.js
@@ -1,52 +1,52 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-// Test that canceling the element picker zooms back on the focused element. Bug 1224304.
-
-const TEST_URL = URL_ROOT + "doc_inspector_long-divs.html";
-
-add_task(function* () {
-  let {inspector, toolbox, testActor} = yield openInspectorForURL(TEST_URL);
-
-  yield selectAndHighlightNode("#focus-here", inspector);
-  ok((yield testActor.assertHighlightedNode("#focus-here")),
-     "The highlighter focuses on div#focus-here");
-  ok(isSelectedMarkupNodeInView(),
-     "The currently selected node is on the screen.");
-
-  // Start the picker but skip focusing manually focusing on the target, let the element
-  // picker do the focusing.
-  yield startPicker(toolbox, true);
-  yield moveMouseOver("#zoom-here");
-  ok(!isSelectedMarkupNodeInView(),
-     "The currently selected node is off the screen.");
-
-  yield cancelPickerByShortcut();
-  ok(isSelectedMarkupNodeInView(),
-     "The currently selected node is focused back on the screen.");
-
-  function cancelPickerByShortcut() {
-    info("Key pressed. Waiting for picker to be canceled.");
-    testActor.synthesizeKey({key: "VK_ESCAPE", options: {}});
-    return inspector.toolbox.once("picker-canceled");
-  }
-
-  function moveMouseOver(selector) {
-    info(`Waiting for element ${selector} to be hovered in the markup view`);
-    testActor.synthesizeMouse({
-      options: {type: "mousemove"},
-      center: true,
-      selector: selector
-    });
-    return inspector.markup.once("showcontainerhovered");
-  }
-
-  function isSelectedMarkupNodeInView() {
-    const selectedNodeContainer = inspector.markup._selectedContainer.elt;
-    const bounds = selectedNodeContainer.getBoundingClientRect();
-    return bounds.top > 0 && bounds.bottom > 0;
-  }
-});
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// Test that canceling the element picker zooms back on the focused element. Bug 1224304.
+
+const TEST_URL = URL_ROOT + "doc_inspector_long-divs.html";
+
+add_task(function* () {
+  let {inspector, toolbox, testActor} = yield openInspectorForURL(TEST_URL);
+
+  yield selectAndHighlightNode("#focus-here", inspector);
+  ok((yield testActor.assertHighlightedNode("#focus-here")),
+     "The highlighter focuses on div#focus-here");
+  ok(isSelectedMarkupNodeInView(),
+     "The currently selected node is on the screen.");
+
+  // Start the picker but skip focusing manually focusing on the target, let the element
+  // picker do the focusing.
+  yield startPicker(toolbox, true);
+  yield moveMouseOver("#zoom-here");
+  ok(!isSelectedMarkupNodeInView(),
+     "The currently selected node is off the screen.");
+
+  yield cancelPickerByShortcut();
+  ok(isSelectedMarkupNodeInView(),
+     "The currently selected node is focused back on the screen.");
+
+  function cancelPickerByShortcut() {
+    info("Key pressed. Waiting for picker to be canceled.");
+    testActor.synthesizeKey({key: "VK_ESCAPE", options: {}});
+    return inspector.toolbox.once("picker-canceled");
+  }
+
+  function moveMouseOver(selector) {
+    info(`Waiting for element ${selector} to be hovered in the markup view`);
+    testActor.synthesizeMouse({
+      options: {type: "mousemove"},
+      center: true,
+      selector: selector
+    });
+    return inspector.markup.once("showcontainerhovered");
+  }
+
+  function isSelectedMarkupNodeInView() {
+    const selectedNodeContainer = inspector.markup._selectedContainer.elt;
+    const bounds = selectedNodeContainer.getBoundingClientRect();
+    return bounds.top > 0 && bounds.bottom > 0;
+  }
+});