--- a/devtools/.eslintrc
+++ b/devtools/.eslintrc
@@ -66,17 +66,17 @@
// Allow trailing commas for easy list extension. Having them does not
// impair readability, but also not required either.
"comma-dangle": 0,
// Enforce spacing before and after comma
"comma-spacing": [2, {"before": false, "after": true}],
// Enforce one true comma style.
"comma-style": [2, "last"],
// Warn about cyclomatic complexity in functions.
- "complexity": 2,
+ "complexity": [2, 35],
// Require return statements to either always or never specify values.
"consistent-return": 2,
// Don't warn for inconsistent naming when capturing this (not so important
// with auto-binding fat arrow functions).
"consistent-this": 0,
// Enforce curly brace conventions for all control statements.
"curly": 2,
// Don't require a default case in switch statements. Avoid being forced to
@@ -172,18 +172,16 @@
// Disallow empty statements. This will report an error for:
// try { something(); } catch (e) {}
// but will not report it for:
// try { something(); } catch (e) { /* Silencing the error because ...*/ }
// which is a valid use case.
"no-empty": 2,
// Disallow the use of empty character classes in regular expressions.
"no-empty-character-class": 2,
- // Disallow use of labels for anything other then loops and switches.
- "no-empty-label": 2,
// Disallow use of eval(). We have other APIs to evaluate code in content.
"no-eval": 2,
// Disallow assigning to the exception in a catch block.
"no-ex-assign": 2,
// Disallow adding to native types
"no-extend-native": 2,
// Disallow unnecessary function binding.
"no-extra-bind": 2,
@@ -319,34 +317,32 @@
"semi": [2, "always"],
// Enforce spacing after semicolons.
"semi-spacing": [2, {"before": false, "after": true}],
// Don't require to sort variables within the same declaration block.
// Anyway, one-var is disabled.
"sort-vars": 0,
// Deprecated, will be removed in 1.0.
"space-after-function-name": 0,
- // Require a space after keywords.
- "space-after-keywords": [2, "always"],
+ // Require a space around all keywords.
+ "keyword-spacing": 2,
// Require a space before the start brace of a block.
"space-before-blocks": [2, "always"],
// Deprecated, will be removed in 1.0.
"space-before-function-parentheses": 0,
// Disallow space before function opening parenthesis.
"space-before-function-paren": [2, "never"],
// Disable the rule that checks if spaces inside {} and [] are there or not.
// Our code is split on conventions, and it'd be nice to have 2 rules
// instead, one for [] and one for {}. So, disabling until we write them.
"space-in-brackets": 0,
// Disallow spaces inside parentheses.
"space-in-parens": [2, "never"],
// Require spaces around operators, except for a|0.
"space-infix-ops": [2, {"int32Hint": true}],
- // Require a space after return, throw, and case.
- "space-return-throw-case": 2,
// Require spaces before/after unary operators (words on by default,
// nonwords off by default).
"space-unary-ops": [2, { "words": true, "nonwords": false }],
// Deprecated, will be removed in 1.0.
"space-unary-word-ops": 0,
// Require a space immediately following the // in a line comment.
"spaced-comment": [2, "always"],
// Require "use strict" to be defined globally in the script.
@@ -391,17 +387,17 @@
"no-invalid-regexp": 0,
// disallow irregular whitespace outside of strings and comments
"no-irregular-whitespace": 0,
// disallow usage of __iterator__ property
"no-iterator": 0,
// disallow labels that share a name with a variable
"no-label-var": 0,
// disallow use of labeled statements
- "no-labels": 0,
+ "no-labels": 2,
// disallow unnecessary nested blocks
"no-lone-blocks": 0,
// disallow creation of functions within loops
"no-loop-func": 0,
// disallow negation of the left operand of an in expression
"no-negated-in-lhs": 0,
// disallow use of new operator when not part of the assignment or
// comparison
--- a/devtools/client/aboutdebugging/modules/worker.js
+++ b/devtools/client/aboutdebugging/modules/worker.js
@@ -37,17 +37,17 @@ exports.debugWorker = function(client, w
*
* @param {DebuggerClient} client
* @return {Object}
* - {Array} registrations
* Array of ServiceWorkerRegistrationActor forms
* - {Array} workers
* Array of WorkerActor forms
*/
-exports.getWorkerForms = Task.async(function*(client) {
+exports.getWorkerForms = Task.async(function* (client) {
let registrations = [];
let workers = [];
try {
// List service worker registrations
({ registrations } =
yield client.mainRoot.listServiceWorkerRegistrations());
--- a/devtools/client/animationinspector/animation-controller.js
+++ b/devtools/client/animationinspector/animation-controller.js
@@ -30,17 +30,17 @@ const L10N = new LocalizationHelper(STRI
// Global toolbox/inspector, set when startup is called.
var gToolbox, gInspector;
/**
* Startup the animationinspector controller and view, called by the sidebar
* widget when loading/unloading the iframe into the tab.
*/
-var startup = Task.async(function*(inspector) {
+var startup = Task.async(function* (inspector) {
gInspector = inspector;
gToolbox = inspector.toolbox;
// Don't assume that AnimationsPanel is defined here, it's in another file.
if (!typeof AnimationsPanel === "undefined") {
throw new Error("AnimationsPanel was not loaded in the " +
"animationinspector window");
}
@@ -51,17 +51,17 @@ var startup = Task.async(function*(inspe
yield AnimationsController.initialize();
yield AnimationsPanel.initialize();
});
/**
* Shutdown the animationinspector controller and view, called by the sidebar
* widget when loading/unloading the iframe into the tab.
*/
-var shutdown = Task.async(function*() {
+var shutdown = Task.async(function* () {
yield AnimationsController.destroy();
// Don't assume that AnimationsPanel is defined here, it's in another file.
if (typeof AnimationsPanel !== "undefined") {
yield AnimationsPanel.destroy();
}
gToolbox = gInspector = null;
});
@@ -74,17 +74,17 @@ function destroy() {
}
/**
* Get all the server-side capabilities (traits) so the UI knows whether or not
* features should be enabled/disabled.
* @param {Target} target The current toolbox target.
* @return {Object} An object with boolean properties.
*/
-var getServerTraits = Task.async(function*(target) {
+var getServerTraits = Task.async(function* (target) {
let config = [
{ name: "hasToggleAll", actor: "animations",
method: "toggleAll" },
{ name: "hasToggleSeveral", actor: "animations",
method: "toggleSeveral" },
{ name: "hasSetCurrentTime", actor: "animationplayer",
method: "setCurrentTime" },
{ name: "hasMutationEvents", actor: "animations",
@@ -130,17 +130,17 @@ var getServerTraits = Task.async(functio
* // do something with player
* }
* }
*/
var AnimationsController = {
PLAYERS_UPDATED_EVENT: "players-updated",
ALL_ANIMATIONS_TOGGLED_EVENT: "all-animations-toggled",
- initialize: Task.async(function*() {
+ initialize: Task.async(function* () {
if (this.initialized) {
yield this.initialized.promise;
return;
}
this.initialized = promise.defer();
this.onPanelVisibilityChange = this.onPanelVisibilityChange.bind(this);
this.onNewNodeFront = this.onNewNodeFront.bind(this);
@@ -164,17 +164,17 @@ var AnimationsController = {
}
this.startListeners();
yield this.onNewNodeFront();
this.initialized.resolve();
}),
- destroy: Task.async(function*() {
+ destroy: Task.async(function* () {
if (!this.initialized) {
return;
}
if (this.destroyed) {
yield this.destroyed.promise;
return;
}
@@ -210,23 +210,23 @@ var AnimationsController = {
},
isPanelVisible: function() {
return gToolbox.currentToolId === "inspector" &&
gInspector.sidebar &&
gInspector.sidebar.getCurrentTabID() == "animationinspector";
},
- onPanelVisibilityChange: Task.async(function*() {
+ onPanelVisibilityChange: Task.async(function* () {
if (this.isPanelVisible()) {
this.onNewNodeFront();
}
}),
- onNewNodeFront: Task.async(function*() {
+ onNewNodeFront: Task.async(function* () {
// Ignore if the panel isn't visible or the node selection hasn't changed.
if (!this.isPanelVisible() ||
this.nodeFront === gInspector.selection.nodeFront) {
return;
}
this.nodeFront = gInspector.selection.nodeFront;
let done = gInspector.updating("animationscontroller");
@@ -260,17 +260,17 @@ var AnimationsController = {
/**
* Similar to toggleAll except that it only plays/pauses the currently known
* animations (those listed in this.animationPlayers).
* @param {Boolean} shouldPause True if the animations should be paused, false
* if they should be played.
* @return {Promise} Resolves when the playState has been changed.
*/
- toggleCurrentAnimations: Task.async(function*(shouldPause) {
+ toggleCurrentAnimations: Task.async(function* (shouldPause) {
if (this.traits.hasToggleSeveral) {
yield this.animationsFront.toggleSeveral(this.animationPlayers,
shouldPause);
} else {
// Fall back to pausing/playing the players one by one, which is bound to
// introduce some de-synchronization.
for (let player of this.animationPlayers) {
if (shouldPause) {
@@ -283,17 +283,17 @@ var AnimationsController = {
}),
/**
* Set all known animations' currentTimes to the provided time.
* @param {Number} time.
* @param {Boolean} shouldPause Should the animations be paused too.
* @return {Promise} Resolves when the current time has been set.
*/
- setCurrentTimeAll: Task.async(function*(time, shouldPause) {
+ setCurrentTimeAll: Task.async(function* (time, shouldPause) {
if (this.traits.hasSetCurrentTimes) {
yield this.animationsFront.setCurrentTimes(this.animationPlayers, time,
shouldPause);
} else {
// Fall back to pausing and setting the current time on each player, one
// by one, which is bound to introduce some de-synchronization.
for (let animation of this.animationPlayers) {
if (shouldPause) {
@@ -304,17 +304,17 @@ var AnimationsController = {
}
}),
/**
* Set all known animations' playback rates to the provided rate.
* @param {Number} rate.
* @return {Promise} Resolves when the rate has been set.
*/
- setPlaybackRateAll: Task.async(function*(rate) {
+ setPlaybackRateAll: Task.async(function* (rate) {
if (this.traits.hasSetPlaybackRates) {
// If the backend can set all playback rates at the same time, use that.
yield this.animationsFront.setPlaybackRates(this.animationPlayers, rate);
} else if (this.traits.hasSetPlaybackRate) {
// Otherwise, fall back to setting each rate individually.
for (let animation of this.animationPlayers) {
yield animation.setPlaybackRate(rate);
}
@@ -322,17 +322,17 @@ var AnimationsController = {
}),
// AnimationPlayerFront objects are managed by this controller. They are
// retrieved when refreshAnimationPlayers is called, stored in the
// animationPlayers array, and destroyed when refreshAnimationPlayers is
// called again.
animationPlayers: [],
- refreshAnimationPlayers: Task.async(function*(nodeFront) {
+ refreshAnimationPlayers: Task.async(function* (nodeFront) {
this.destroyAnimationPlayers();
this.animationPlayers = yield this.animationsFront
.getAnimationPlayersForNode(nodeFront);
// Start listening for animation mutations only after the first method call
// otherwise events won't be sent.
if (!this.isListeningToMutations && this.traits.hasMutationEvents) {
--- a/devtools/client/animationinspector/animation-panel.js
+++ b/devtools/client/animationinspector/animation-panel.js
@@ -17,17 +17,17 @@ var $ = (selector, target = document) =>
/**
* The main animations panel UI.
*/
var AnimationsPanel = {
UI_UPDATED_EVENT: "ui-updated",
PANEL_INITIALIZED: "panel-initialized",
- initialize: Task.async(function*() {
+ initialize: Task.async(function* () {
if (AnimationsController.destroyed) {
console.warn("Could not initialize the animation-panel, controller " +
"was destroyed");
return;
}
if (this.initialized) {
yield this.initialized.promise;
return;
@@ -74,17 +74,17 @@ var AnimationsPanel = {
this.startListeners();
yield this.refreshAnimationsUI();
this.initialized.resolve();
this.emit(this.PANEL_INITIALIZED);
}),
- destroy: Task.async(function*() {
+ destroy: Task.async(function* () {
if (!this.initialized) {
return;
}
if (this.destroyed) {
yield this.destroyed.promise;
return;
}
@@ -200,17 +200,17 @@ var AnimationsPanel = {
onToggleAllClicked: function() {
this.toggleAll().catch(ex => console.error(ex));
},
/**
* Toggle (pause/play) all animations in the current target
* and update the UI the toggleAll button.
*/
- toggleAll: Task.async(function*() {
+ toggleAll: Task.async(function* () {
this.toggleAllButtonEl.classList.toggle("paused");
yield AnimationsController.toggleAll();
}),
onTimelinePlayClicked: function() {
this.playPauseTimeline().catch(ex => console.error(ex));
},
@@ -275,44 +275,46 @@ var AnimationsPanel = {
// If the timeline data changed as a result of the user dragging the
// scrubber, then pause all animations and set their currentTimes.
// (Note that we want server-side requests to be sequenced, so we only do
// this after the previous currentTime setting was done).
if (isUserDrag && !this.setCurrentTimeAllPromise) {
this.setCurrentTimeAllPromise =
AnimationsController.setCurrentTimeAll(time, true)
.catch(error => console.error(error))
- .then(() => this.setCurrentTimeAllPromise = null);
+ .then(() => {
+ this.setCurrentTimeAllPromise = null;
+ });
}
this.displayTimelineCurrentTime();
},
displayTimelineCurrentTime: function() {
let {time} = this.timelineData;
this.timelineCurrentTimeEl.textContent = formatStopwatchTime(time);
},
/**
* Make sure all known animations have their states up to date (which is
* useful after the playState or currentTime has been changed and in case the
* animations aren't auto-refreshing), and then refresh the UI.
*/
- refreshAnimationsStateAndUI: Task.async(function*() {
+ refreshAnimationsStateAndUI: Task.async(function* () {
for (let player of AnimationsController.animationPlayers) {
yield player.refreshState();
}
yield this.refreshAnimationsUI();
}),
/**
* Refresh the list of animations UI. This will empty the panel and re-render
* the various components again.
*/
- refreshAnimationsUI: Task.async(function*() {
+ refreshAnimationsUI: Task.async(function* () {
// Empty the whole panel first.
this.togglePlayers(true);
// Re-render the timeline component.
this.animationsTimelineComponent.render(
AnimationsController.animationPlayers,
AnimationsController.documentCurrentTime);
--- a/devtools/client/animationinspector/components/animation-details.js
+++ b/devtools/client/animationinspector/components/animation-details.js
@@ -57,17 +57,17 @@ AnimationDetails.prototype = {
}
},
/**
* Get a list of the tracks of the animation actor
* @return {Object} A list of tracks, one per animated property, each
* with a list of keyframes
*/
- getTracks: Task.async(function*() {
+ getTracks: Task.async(function* () {
let tracks = {};
/*
* getFrames is a AnimationPlayorActor method that returns data about the
* keyframes of the animation.
* In FF48, the data it returns change, and will hold only longhand
* properties ( e.g. borderLeftWidth ), which does not match what we
* want to display in the animation detail.
@@ -107,17 +107,17 @@ AnimationDetails.prototype = {
});
}
}
}
return tracks;
}),
- render: Task.async(function*(animation) {
+ render: Task.async(function* (animation) {
this.unrender();
if (!animation) {
return;
}
this.animation = animation;
// We might have been destroyed in the meantime, or the component might
--- a/devtools/client/animationinspector/components/animation-target-node.js
+++ b/devtools/client/animationinspector/components/animation-target-node.js
@@ -36,17 +36,17 @@ AnimationTargetNode.prototype = {
},
destroy: function() {
this.previewer.destroy();
this.inspector = null;
this.isDestroyed = true;
},
- render: Task.async(function*(playerFront) {
+ render: Task.async(function* (playerFront) {
// Get the nodeFront from the cache if it was stored previously.
let nodeFront = nodeFronts.get(playerFront);
// Try and get it from the playerFront directly next.
if (!nodeFront) {
nodeFront = playerFront.animationTargetNodeFront;
}
--- a/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js
+++ b/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js
@@ -16,17 +16,17 @@ const EXPECTED_PROPERTIES = [
"border-top-left-radius",
"border-top-right-radius",
"filter",
"height",
"transform",
"width"
].sort();
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_keyframes.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let propertiesList = timeline.rootWrapperEl
.querySelector(".animated-properties");
ok(!isNodeVisible(propertiesList),
"The list of properties panel is hidden by default");
--- a/devtools/client/animationinspector/test/browser_animation_click_selects_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_click_selects_animation.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check that animations displayed in the timeline can be selected by clicking
// them, and that this emits the right events and adds the right classes.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let selected = timeline.rootWrapperEl.querySelectorAll(".animation.selected");
ok(!selected.length, "There are no animations selected by default");
info("Click on the first animation, expect the right event and right class");
--- a/devtools/client/animationinspector/test/browser_animation_controller_exposes_document_currentTime.js
+++ b/devtools/client/animationinspector/test/browser_animation_controller_exposes_document_currentTime.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the controller provides the document.timeline currentTime (at least
// the last known version since new animations were added).
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, controller} = yield openAnimationInspector();
ok(controller.documentCurrentTime, "The documentCurrentTime getter exists");
checkDocumentTimeIsCorrect(controller);
let time1 = controller.documentCurrentTime;
yield startNewAnimation(controller, panel);
--- a/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js
+++ b/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js
@@ -7,17 +7,17 @@ requestLongerTimeout(2);
// Test that the panel shows no animation data for invalid or not animated nodes
const { LocalizationHelper } = require("devtools/client/shared/l10n");
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel, window} = yield openAnimationInspector();
let {document} = window;
info("Select node .still and check that the panel is empty");
let stillNode = yield getNodeFront(".still", inspector);
let onUpdated = panel.once(panel.UI_UPDATED_EVENT);
yield selectNodeAndWaitForAnimations(stillNode, inspector);
--- a/devtools/client/animationinspector/test/browser_animation_keyframe_click_to_set_time.js
+++ b/devtools/client/animationinspector/test/browser_animation_keyframe_click_to_set_time.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that animated properties' keyframes can be clicked, and that doing so
// sets the current time in the timeline.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_keyframes.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let {scrubberEl} = timeline;
// XXX: The scrollbar is placed in the timeline in such a way that it causes
// the animations to be slightly offset with the header when it appears.
// So for now, let's hide the scrollbar. Bug 1229340 should fix this.
--- a/devtools/client/animationinspector/test/browser_animation_keyframe_markers.js
+++ b/devtools/client/animationinspector/test/browser_animation_keyframe_markers.js
@@ -16,17 +16,17 @@ const EXPECTED_PROPERTIES = [
"borderTopLeftRadius",
"borderTopRightRadius",
"filter",
"height",
"transform",
"width"
];
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_keyframes.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
info("Expand the animation");
yield clickOnAnimation(panel, 0);
ok(timeline.rootWrapperEl.querySelectorAll(".frames .keyframes").length,
--- a/devtools/client/animationinspector/test/browser_animation_mutations_with_same_names.js
+++ b/devtools/client/animationinspector/test/browser_animation_mutations_with_same_names.js
@@ -4,17 +4,17 @@
"use strict";
// Check that when animations are added later (through animation mutations) and
// if these animations have the same names, then all of them are still being
// displayed (which should be true as long as these animations apply to
// different nodes).
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_negative_animation.html");
let {controller, panel} = yield openAnimationInspector();
info("Wait until all animations have been added " +
"(they're added with setTimeout)");
while (controller.animationPlayers.length < 3) {
yield controller.once(controller.PLAYERS_UPDATED_EVENT);
}
--- a/devtools/client/animationinspector/test/browser_animation_panel_exists.js
+++ b/devtools/client/animationinspector/test/browser_animation_panel_exists.js
@@ -1,17 +1,17 @@
/* vim: set 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 the animation panel sidebar exists
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8,welcome to the animation panel");
let {panel, controller} = yield openAnimationInspector();
ok(controller,
"The animation controller exists");
ok(controller.animationsFront,
"The animation controller has been initialized");
ok(panel,
--- a/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
+++ b/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
@@ -5,17 +5,17 @@
"use strict";
requestLongerTimeout(2);
// Test that the update of the animation panel participate in the
// inspector-updated event. This means that the test verifies that the
// inspector-updated event is emitted *after* the animation panel is ready.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel, controller} = yield openAnimationInspector();
info("Listen for the players-updated, ui-updated and " +
"inspector-updated events");
let receivedEvents = [];
controller.once(controller.PLAYERS_UPDATED_EVENT, () => {
receivedEvents.push(controller.PLAYERS_UPDATED_EVENT);
--- a/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js
+++ b/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Check that the AnimationPlayerFront objects lifecycle is managed by the
// AnimationController.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {controller, inspector} = yield openAnimationInspector();
info("Selecting an animated node");
// selectNode waits for the inspector-updated event before resolving, which
// means the controller.PLAYERS_UPDATED_EVENT event has been emitted before
// and players are ready.
yield selectNodeAndWaitForAnimations(".animated", inspector);
--- a/devtools/client/animationinspector/test/browser_animation_playerWidgets_appear_on_panel_init.js
+++ b/devtools/client/animationinspector/test/browser_animation_playerWidgets_appear_on_panel_init.js
@@ -4,17 +4,17 @@
"use strict";
// Test that player widgets are displayed right when the animation panel is
// initialized, if the selected node (<body> by default) is animated.
const { ANIMATION_TYPES } = require("devtools/server/actors/animation");
-add_task(function*() {
+add_task(function* () {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["dom.animations-api.core.enabled", true]
]}, resolve);
});
yield addTab(URL_ROOT + "doc_multiple_animation_types.html");
--- a/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js
+++ b/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Test that player widgets display information about target nodes
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Select the simple animated node");
yield selectNodeAndWaitForAnimations(".animated", inspector);
let targetNodeComponent = panel.animationsTimelineComponent.targetNodes[0];
let {previewer} = targetNodeComponent;
--- a/devtools/client/animationinspector/test/browser_animation_pseudo_elements.js
+++ b/devtools/client/animationinspector/test/browser_animation_pseudo_elements.js
@@ -1,17 +1,17 @@
/* vim: set 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 animated pseudo-elements do show in the timeline.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_pseudo_elements.html");
let {inspector, panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
info("With <body> selected by default check the content of the timeline");
is(timeline.timeBlocks.length, 3, "There are 3 animations in the timeline");
let getTargetNodeText = index => {
--- a/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Test that the panel content refreshes when new animations are added.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Select a non animated node");
yield selectNodeAndWaitForAnimations(".still", inspector);
assertAnimationsDisplayed(panel, 0);
--- a/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Test that the panel content refreshes when animations are removed.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
yield testRefreshOnRemove(inspector, panel);
});
function* testRefreshOnRemove(inspector, panel) {
info("Select a animated node");
--- a/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Test that the panel only refreshes when it is visible in the sidebar.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
yield testRefresh(inspector, panel);
});
function* testRefresh(inspector, panel) {
info("Select a non animated node");
--- a/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js
+++ b/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js
@@ -9,17 +9,17 @@ requestLongerTimeout(2);
// Test that when animations displayed in the timeline are running on the
// compositor, they get a special icon and information in the tooltip.
const { LocalizationHelper } = require("devtools/client/shared/l10n");
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
info("Select a test node we know has an animation running on the compositor");
yield selectNodeAndWaitForAnimations(".animated", inspector);
let animationEl = timeline.animationsEl.querySelector(".animation");
--- a/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js
+++ b/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Check that when playerFronts are updated, the same number of playerWidgets
// are created in the panel.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel, controller} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
info("Selecting the test animated node again");
yield selectNodeAndWaitForAnimations(".multi", inspector);
is(controller.animationPlayers.length,
--- a/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js
+++ b/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Test that the panel shows an animation player when an animated node is
// selected.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Select node .animated and check that the panel is not empty");
let node = yield getNodeFront(".animated", inspector);
yield selectNodeAndWaitForAnimations(node, inspector);
assertAnimationsDisplayed(panel, 1);
--- a/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_animations.js
+++ b/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_animations.js
@@ -5,17 +5,17 @@
"use strict";
// Test that the spacebar key press toggles the toggleAll button state
// when a node with no animation is selected.
// This test doesn't need to test if animations actually pause/resume
// because there's an other test that does this :
// browser_animation_toggle_button_toggles_animation.js
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, inspector, window, controller} = yield openAnimationInspector();
let {toggleAllButtonEl} = panel;
// select a node without animations
yield selectNodeAndWaitForAnimations(".still", inspector);
// ensure the focus is on the animation panel
--- a/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js
+++ b/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js
@@ -5,17 +5,17 @@
"use strict";
// Test that the spacebar key press toggles the play/resume button state.
// This test doesn't need to test if animations actually pause/resume
// because there's an other test that does this.
// There are animations in the test page and since, by default, the <body> node
// is selected, animations will be displayed in the timeline, so the timeline
// play/resume button will be displayed
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, window} = yield openAnimationInspector();
let {playTimelineButtonEl} = panel;
// ensure the focus is on the animation panel
window.focus();
info("Simulate spacebar stroke and check playResume button" +
--- a/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js
+++ b/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Test that the DOM element targets displayed in animation player widgets can
// be used to highlight elements in the DOM and select them in the inspector.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {toolbox, inspector, panel} = yield openAnimationInspector();
info("Select the simple animated node");
let onPanelUpdated = panel.once(panel.UI_UPDATED_EVENT);
yield selectNodeAndWaitForAnimations(".animated", inspector);
yield onPanelUpdated;
--- a/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js
+++ b/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Test that the DOM element targets displayed in animation player widgets can
// be used to highlight elements in the DOM and select them in the inspector.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let targets = panel.animationsTimelineComponent.targetNodes;
info("Click on the highlighter icon for the first animated node");
let domNodePreview1 = targets[0].previewer;
yield lockHighlighterOn(domNodePreview1);
--- a/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js
@@ -5,17 +5,17 @@
"use strict";
requestLongerTimeout(2);
// Check that the timeline toolbar displays the current time, and that it
// changes when animations are playing, gets back to 0 when animations are
// rewound, and stops when animations are paused.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let label = panel.timelineCurrentTimeEl;
ok(label, "The current time label exists");
// On page load animations are playing so the time shoud change, although we
// don't want to test the exact value of the time displayed, just that it
--- a/devtools/client/animationinspector/test/browser_animation_timeline_header.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_header.js
@@ -9,17 +9,17 @@ requestLongerTimeout(2);
// Check that the timeline shows correct time graduations in the header.
const {findOptimalTimeInterval, TimeScale} = require("devtools/client/animationinspector/utils");
// Should be kept in sync with TIME_GRADUATION_MIN_SPACING in
// animation-timeline.js
const TIME_GRADUATION_MIN_SPACING = 40;
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let headerEl = timeline.timeHeaderEl;
info("Find out how many time graduations should there be");
let width = headerEl.offsetWidth;
--- a/devtools/client/animationinspector/test/browser_animation_timeline_iterationStart.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_iterationStart.js
@@ -1,17 +1,17 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check that the iteration start is displayed correctly in time blocks.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_script_animation.html");
let {panel} = yield openAnimationInspector();
let timelineComponent = panel.animationsTimelineComponent;
let timeBlockComponents = timelineComponent.timeBlocks;
let detailsComponents = timelineComponent.details;
for (let i = 0; i < timeBlockComponents.length; i++) {
info(`Expand time block ${i} so its keyframes are visible`);
--- a/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
@@ -11,17 +11,17 @@ requestLongerTimeout(2);
// displayed in the timeline get their playstates changed accordingly, and check
// that the scrubber resumes/stops moving.
// Also checks that the button goes to the right state when the scrubber has
// reached the end of the timeline: continues to be in playing mode for infinite
// animations, goes to paused mode otherwise.
// And test that clicking the button once the scrubber has reached the end of
// the timeline does the right thing.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, inspector} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let btn = panel.playTimelineButtonEl;
ok(btn, "The play/pause button exists");
ok(!btn.classList.contains("paused"),
--- a/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js
@@ -7,17 +7,17 @@
requestLongerTimeout(2);
// Check that the timeline toolbar contains a playback rate selector UI and that
// it can be used to change the playback rate of animations in the timeline.
// Also check that it displays the rate of the current animations in case they
// all have the same rate, or that it displays the empty value in case they
// have mixed rates.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, controller, inspector, toolbox} = yield openAnimationInspector();
// In this test, we disable the highlighter on purpose because of the way
// events are simulated to select an option in the playbackRate <select>.
// Indeed, this may cause mousemove events to be triggered on the nodes that
// are underneath the <select>, and these are AnimationTargetNode instances.
--- a/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js
@@ -7,17 +7,17 @@
requestLongerTimeout(2);
// Check that the timeline toolbar contains a rewind button and that it can be
// clicked. Check that when it is, the current animations displayed in the
// timeline get their playstates changed to paused, and their currentTimes
// reset to 0, and that the scrubber stops moving and is positioned to the
// start.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, controller} = yield openAnimationInspector();
let players = controller.animationPlayers;
let btn = panel.rewindTimelineButtonEl;
ok(btn, "The rewind button exists");
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Check that the timeline does have a scrubber element.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let scrubberEl = timeline.scrubberEl;
ok(scrubberEl, "The scrubber element exists");
ok(scrubberEl.classList.contains("scrubber"), "It has the right classname");
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js
@@ -7,17 +7,17 @@
requestLongerTimeout(2);
// Check that the scrubber in the timeline can be moved by clicking & dragging
// in the header area.
// Also check that doing so changes the timeline's play/pause button to paused
// state.
// Finally, also check that the scrubber can be moved using the scrubber handle.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let {win, timeHeaderEl, scrubberEl, scrubberHandleEl} = timeline;
let playTimelineButtonEl = panel.playTimelineButtonEl;
ok(!playTimelineButtonEl.classList.contains("paused"),
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js
@@ -6,17 +6,17 @@
requestLongerTimeout(2);
// Check that the scrubber in the timeline moves when animations are playing.
// The animations in the test page last for a very long time, so the test just
// measures the position of the scrubber once, then waits for some time to pass
// and measures its position again.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let scrubberEl = timeline.scrubberEl;
let startPos = scrubberEl.getBoundingClientRect().left;
info("Wait for some time to check that the scrubber moves");
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js
@@ -6,17 +6,17 @@
requestLongerTimeout(2);
// Check that animation delay is visualized in the timeline when the animation
// is delayed.
// Also check that negative delays do not overflow the UI, and are shown like
// positive delays.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Selecting a delayed animated node");
yield selectNodeAndWaitForAnimations(".delayed", inspector);
let timelineEl = panel.animationsTimelineComponent.rootWrapperEl;
checkDelayAndName(timelineEl, true);
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_endDelay.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_endDelay.js
@@ -6,17 +6,17 @@
requestLongerTimeout(2);
// Check that animation endDelay is visualized in the timeline when the
// animation is delayed.
// Also check that negative endDelays do not overflow the UI, and are shown
// like positive endDelays.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_end_delay.html");
let {inspector, panel} = yield openAnimationInspector();
let selectors = ["#target1", "#target2", "#target3", "#target4"];
for (let i = 0; i < selectors.length; i++) {
let selector = selectors[i];
yield selectNode(selector, inspector);
let timelineEl = panel.animationsTimelineComponent.rootWrapperEl;
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Check that the timeline is displays as many iteration elements as there are
// iterations in an animation.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Selecting the test node");
yield selectNodeAndWaitForAnimations(".delayed", inspector);
info("Getting the animation element from the panel");
let timelineEl = panel.animationsTimelineComponent.rootWrapperEl;
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Check that the timeline displays animations' duration, delay iteration
// counts and iteration start in tooltips.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, controller} = yield openAnimationInspector();
info("Getting the animation element from the panel");
let timelineEl = panel.animationsTimelineComponent.rootWrapperEl;
let timeBlockNameEls = timelineEl.querySelectorAll(".time-block .name");
// Verify that each time-block's name element has a tooltip that looks sort of
--- a/devtools/client/animationinspector/test/browser_animation_timeline_takes_rate_into_account.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_takes_rate_into_account.js
@@ -6,17 +6,17 @@
// Check that if an animation has had its playbackRate changed via the DOM, then
// the timeline UI shows the right delay and duration.
// Indeed, the header in the timeline UI always shows the unaltered time,
// because there might be multiple animations displayed at the same time, some
// of which may have a different rate than others. Those that have had their
// rate changed have a delay = delay/rate and a duration = duration/rate.
-add_task(function*() {
+add_task(function* () {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["dom.animations-api.core.enabled", true]
]}, resolve);
});
yield addTab(URL_ROOT + "doc_modify_playbackRate.html");
--- a/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Check that the timeline contains the right elements.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let el = timeline.rootWrapperEl;
ok(el.querySelector(".time-header"),
"The header element is in the DOM of the timeline");
--- a/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js
+++ b/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
// Test that a page navigation resets the state of the global toggle button.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
info("Select the non-animated test node");
yield selectNodeAndWaitForAnimations(".still", inspector);
ok(!panel.toggleAllButtonEl.classList.contains("paused"),
"The toggle button is in its running state by default");
--- a/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js
+++ b/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js
@@ -6,17 +6,17 @@
requestLongerTimeout(2);
// Test that the main toggle button actually toggles animations.
// This test doesn't need to be extra careful about checking that *all*
// animations have been paused (including inside iframes) because there's an
// actor test in /devtools/server/tests/browser/ that does this.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
info("Click the toggle button");
yield panel.toggleAll();
yield checkState("paused");
info("Click again the toggle button");
--- a/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js
+++ b/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js
@@ -6,17 +6,17 @@
requestLongerTimeout(2);
// Test that the animation panel has a top toolbar that contains the play/pause
// button and that is displayed at all times.
// Also test that this toolbar gets replaced by the timeline toolbar when there
// are animations to be displayed.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, window} = yield openAnimationInspector();
let doc = window.document;
let toolbar = doc.querySelector("#global-toolbar");
ok(toolbar, "The panel contains the toolbar element with the new UI");
ok(!isNodeVisible(toolbar),
"The toolbar is hidden while there are animations");
--- a/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js
+++ b/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Verify that if the animation's duration, iterations or delay change in
// content, then the widget reflects the changes.
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {panel, controller, inspector} = yield openAnimationInspector();
info("Select the test node");
yield selectNodeAndWaitForAnimations(".animated", inspector);
let animation = controller.animationPlayers[0];
yield setStyle(animation, panel, "animationDuration", "5.5s");
--- a/devtools/client/animationinspector/test/head.js
+++ b/devtools/client/animationinspector/test/head.js
@@ -12,17 +12,17 @@ Services.scriptloader.loadSubScript(
this);
const {ViewHelpers} = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
const FRAME_SCRIPT_URL = CHROME_URL_ROOT + "doc_frame_script.js";
const COMMON_FRAME_SCRIPT_URL = "chrome://devtools/content/shared/frame-script-utils.js";
const TAB_NAME = "animationinspector";
// Auto clean-up when a test ends
-registerCleanupFunction(function*() {
+registerCleanupFunction(function* () {
yield closeAnimationInspector();
while (gBrowser.tabs.length > 1) {
gBrowser.removeCurrentTab();
}
});
// Clean-up all prefs that might have been changed during a test run
@@ -70,17 +70,17 @@ function* reloadTab(inspector) {
* loaded in the toolbox
* @param {String} reason
* Defaults to "test" which instructs the inspector not
* to highlight the node upon selection
* @return {Promise} Resolves when the inspector is updated with the new node
and animations of its subtree are properly displayed.
*/
var selectNodeAndWaitForAnimations = Task.async(
- function*(data, inspector, reason = "test") {
+ function* (data, inspector, reason = "test") {
yield selectNode(data, inspector, reason);
// We want to make sure the rest of the test waits for the animations to
// be properly displayed (wait for all target DOM nodes to be previewed).
let {AnimationsPanel} = inspector.sidebar.getWindowForTab(TAB_NAME);
yield waitForAllAnimationTargets(AnimationsPanel);
}
);
@@ -102,17 +102,17 @@ function assertAnimationsDisplayed(panel
/**
* Takes an Inspector panel that was just created, and waits
* for a "inspector-updated" event as well as the animation inspector
* sidebar to be ready. Returns a promise once these are completed.
*
* @param {InspectorPanel} inspector
* @return {Promise}
*/
-var waitForAnimationInspectorReady = Task.async(function*(inspector) {
+var waitForAnimationInspectorReady = Task.async(function* (inspector) {
let win = inspector.sidebar.getWindowForTab(TAB_NAME);
let updated = inspector.once("inspector-updated");
// In e10s, if we wait for underlying toolbox actors to
// load (by setting DevToolsUtils.testing to true), we miss the
// "animationinspector-ready" event on the sidebar, so check to see if the
// iframe is already loaded.
let tabReady = win.document.readyState === "complete" ?
@@ -122,17 +122,17 @@ var waitForAnimationInspectorReady = Tas
return promise.all([updated, tabReady]);
});
/**
* Open the toolbox, with the inspector tool visible and the animationinspector
* sidebar selected.
* @return a promise that resolves when the inspector is ready.
*/
-var openAnimationInspector = Task.async(function*() {
+var openAnimationInspector = Task.async(function* () {
let {inspector, toolbox} = yield openInspectorSidebarTab(TAB_NAME);
info("Waiting for the inspector and sidebar to be ready");
yield waitForAnimationInspectorReady(inspector);
let win = inspector.sidebar.getWindowForTab(TAB_NAME);
let {AnimationsController, AnimationsPanel} = win;
@@ -156,17 +156,17 @@ var openAnimationInspector = Task.async(
window: win
};
});
/**
* Close the toolbox.
* @return a promise that resolves when the toolbox has closed.
*/
-var closeAnimationInspector = Task.async(function*() {
+var closeAnimationInspector = Task.async(function* () {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
});
/**
* Wait for a content -> chrome message on the message manager (the window
* messagemanager is used).
* @param {String} name The message name
@@ -209,18 +209,18 @@ function executeInContent(name, data = {
}
return promise.resolve();
}
/**
* Get the current playState of an animation player on a given node.
*/
-var getAnimationPlayerState = Task.async(function*(selector,
- animationIndex = 0) {
+var getAnimationPlayerState = Task.async(function* (selector,
+ animationIndex = 0) {
let playState = yield executeInContent("Test:GetAnimationPlayerState",
{selector, animationIndex});
return playState;
});
/**
* Is the given node visible in the page (rendered in the frame tree).
* @param {DOMNode}
@@ -231,17 +231,17 @@ function isNodeVisible(node) {
}
/**
* Wait for all AnimationTargetNode instances to be fully loaded
* (fetched their related actor and rendered), and return them.
* @param {AnimationsPanel} panel
* @return {Array} all AnimationTargetNode instances
*/
-var waitForAllAnimationTargets = Task.async(function*(panel) {
+var waitForAllAnimationTargets = Task.async(function* (panel) {
let targets = panel.animationsTimelineComponent.targetNodes;
yield promise.all(targets.map(t => {
if (!t.previewer.nodeFront) {
return t.once("target-retrieved");
}
return false;
}));
return targets;
@@ -260,17 +260,19 @@ function* assertScrubberMoving(panel, is
// timeline-data-changed events and compare times.
let {time: time1} = yield timeline.once("timeline-data-changed");
let {time: time2} = yield timeline.once("timeline-data-changed");
ok(time2 > time1, "The scrubber is moving");
} else {
// If instead we expect the scrubber to remain at its position, just wait
// for some time and make sure timeline-data-changed isn't emitted.
let hasMoved = false;
- timeline.once("timeline-data-changed", () => hasMoved = true);
+ timeline.once("timeline-data-changed", () => {
+ hasMoved = true;
+ });
yield new Promise(r => setTimeout(r, 500));
ok(!hasMoved, "The scrubber is not moving");
}
}
/**
* Click the play/pause button in the timeline toolbar and wait for animations
* to update.
--- a/devtools/client/definitions.js
+++ b/devtools/client/definitions.js
@@ -136,16 +136,17 @@ Tools.webConsole = {
preventClosingOnKey: true,
onkey: function(panel, toolbox) {
if (toolbox.splitConsole) {
return toolbox.focusConsoleInput();
}
panel.focusInput();
+ return undefined;
},
isTargetSupported: function() {
return true;
},
build: function(iframeWindow, toolbox) {
return new WebConsolePanel(iframeWindow, toolbox);
--- a/devtools/client/inspector/layout/layout.js
+++ b/devtools/client/inspector/layout/layout.js
@@ -599,16 +599,17 @@ LayoutView.prototype = {
let newValue = width + "\u00D7" + height;
if (this.sizeLabel.textContent != newValue) {
this.sizeLabel.textContent = newValue;
}
this.elementRules = styleEntries.map(e => e.rule);
this.inspector.emit("layoutview-updated");
+ return undefined;
}).bind(this)).catch(console.error);
this._lastRequest = lastRequest;
return this._lastRequest;
},
/**
* Update the text in the tooltip shown when hovering over a value to provide
--- a/devtools/client/inspector/layout/test/browser_layout.js
+++ b/devtools/client/inspector/layout/test/browser_layout.js
@@ -121,17 +121,17 @@ var res2 = [
value: 10
},
{
selector: ".layout-border.layout-right > span",
value: 10
},
];
-add_task(function*() {
+add_task(function* () {
let style = "div { position: absolute; top: 42px; left: 42px; " +
"height: 100.111px; width: 100px; border: 10px solid black; " +
"padding: 20px; margin: 30px auto;}";
let html = "<style>" + style + "</style><div></div>";
yield addTab("data:text/html," + encodeURIComponent(html));
let {inspector, view, testActor} = yield openLayoutView();
yield selectNode("div", inspector);
--- a/devtools/client/inspector/layout/test/browser_layout_editablemodel.js
+++ b/devtools/client/inspector/layout/test/browser_layout_editablemodel.js
@@ -14,17 +14,17 @@ const TEST_URI = "<style>" +
"#div3 { padding: 2em; }" +
"#div4 { margin: 1px; }" +
"#div5 { margin: 1px; }" +
"</style>" +
"<div id='div1'></div><div id='div2'></div>" +
"<div id='div3'></div><div id='div4'></div>" +
"<div id='div5'></div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openLayoutView();
yield testEditingMargins(inspector, view, testActor);
yield testKeyBindings(inspector, view, testActor);
yield testEscapeToUndo(inspector, view, testActor);
yield testDeletingValue(inspector, view, testActor);
yield testRefocusingOnClick(inspector, view, testActor);
--- a/devtools/client/inspector/layout/test/browser_layout_editablemodel_allproperties.js
+++ b/devtools/client/inspector/layout/test/browser_layout_editablemodel_allproperties.js
@@ -9,17 +9,17 @@
const TEST_URI = "<style>" +
"div { margin: 10px; padding: 3px }" +
"#div1 { margin-top: 5px }" +
"#div2 { border-bottom: 1em solid black; }" +
"#div3 { padding: 2em; }" +
"</style>" +
"<div id='div1'></div><div id='div2'></div><div id='div3'></div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openLayoutView();
yield testEditing(inspector, view, testActor);
yield testEditingAndCanceling(inspector, view, testActor);
yield testDeleting(inspector, view, testActor);
yield testDeletingAndCanceling(inspector, view, testActor);
});
--- a/devtools/client/inspector/layout/test/browser_layout_editablemodel_border.js
+++ b/devtools/client/inspector/layout/test/browser_layout_editablemodel_border.js
@@ -9,17 +9,17 @@
const TEST_URI = "<style>" +
"div { margin: 10px; padding: 3px }" +
"#div1 { margin-top: 5px }" +
"#div2 { border-bottom: 1em solid black; }" +
"#div3 { padding: 2em; }" +
"</style>" +
"<div id='div1'></div><div id='div2'></div><div id='div3'></div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openLayoutView();
is((yield getStyle(testActor, "#div1", "border-top-width")), "",
"Should have the right border");
is((yield getStyle(testActor, "#div1", "border-top-style")), "",
"Should have the right border");
yield selectNode("#div1", inspector);
--- a/devtools/client/inspector/layout/test/browser_layout_editablemodel_stylerules.js
+++ b/devtools/client/inspector/layout/test/browser_layout_editablemodel_stylerules.js
@@ -10,17 +10,17 @@
const TEST_URI = "<style>" +
"div { margin: 10px; padding: 3px }" +
"#div1 { margin-top: 5px }" +
"#div2 { border-bottom: 1em solid black; }" +
"#div3 { padding: 2em; }" +
"</style>" +
"<div id='div1'></div><div id='div2'></div><div id='div3'></div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openLayoutView();
yield testUnits(inspector, view, testActor);
yield testValueComesFromStyleRule(inspector, view, testActor);
yield testShorthandsAreParsed(inspector, view, testActor);
});
--- a/devtools/client/inspector/layout/test/browser_layout_guides.js
+++ b/devtools/client/inspector/layout/test/browser_layout_guides.js
@@ -12,17 +12,17 @@
const STYLE = "div { position: absolute; top: 50px; left: 50px; " +
"height: 10px; width: 10px; border: 10px solid black; " +
"padding: 10px; margin: 10px;}";
const HTML = "<style>" + STYLE + "</style><div></div>";
const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent(HTML);
var highlightedNodeFront, highlighterOptions;
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openLayoutView();
yield selectNode("div", inspector);
// Mock the highlighter by replacing the showBoxModel method.
toolbox.highlighter.showBoxModel = function(nodeFront, options) {
highlightedNodeFront = nodeFront;
highlighterOptions = options;
--- a/devtools/client/inspector/layout/test/browser_layout_rotate-labels-on-sides.js
+++ b/devtools/client/inspector/layout/test/browser_layout_rotate-labels-on-sides.js
@@ -25,17 +25,17 @@ const TEST_URI = encodeURIComponent([
"<style>",
"div { border:10px solid black; padding: 20px 20px 20px 2000000px; " +
"margin: 30px auto; }",
"</style>",
"<div></div>"
].join(""));
const LONG_TEXT_ROTATE_LIMIT = 3;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html," + TEST_URI);
let {inspector, view} = yield openLayoutView();
yield selectNode("div", inspector);
for (let i = 0; i < res1.length; i++) {
let elt = view.doc.querySelector(res1[i].selector);
let isLong = elt.textContent.length > LONG_TEXT_ROTATE_LIMIT;
let classList = elt.parentNode.classList;
--- a/devtools/client/inspector/layout/test/browser_layout_tooltips.js
+++ b/devtools/client/inspector/layout/test/browser_layout_tooltips.js
@@ -65,17 +65,17 @@ const VALUES_TEST_DATA = [{
styleSheetLocation: "null:3"
}, {
name: "padding-left",
ruleSelector: "html, body, #div3",
styleSheetLocation: "null:3"
}]
}];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openLayoutView();
info("Checking the regions tooltips");
ok(view.doc.querySelector("#layout-margins").hasAttribute("title"),
"The margin region has a tooltip");
is(view.doc.querySelector("#layout-margins").getAttribute("title"), "margin",
--- a/devtools/client/inspector/layout/test/browser_layout_update-after-navigation.js
+++ b/devtools/client/inspector/layout/test/browser_layout_update-after-navigation.js
@@ -5,17 +5,17 @@
"use strict";
// Test that the layout-view continues to work after a page navigation and that
// it also works after going back
const IFRAME1 = URL_ROOT + "doc_layout_iframe1.html";
const IFRAME2 = URL_ROOT + "doc_layout_iframe2.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(IFRAME1);
let {inspector, view, testActor} = yield openLayoutView();
yield testFirstPage(inspector, view, testActor);
info("Navigate to the second page");
yield testActor.eval(`content.location.href="${IFRAME2}"`);
yield inspector.once("markuploaded");
--- a/devtools/client/inspector/layout/test/browser_layout_update-after-reload.js
+++ b/devtools/client/inspector/layout/test/browser_layout_update-after-reload.js
@@ -1,17 +1,17 @@
/* vim: set 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 the layout-view continues to work after the page is reloaded
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_layout_iframe1.html");
let {inspector, view, testActor} = yield openLayoutView();
info("Test that the layout-view works on the first page");
yield assertLayoutView(inspector, view, testActor);
info("Reload the page");
yield testActor.reload();
--- a/devtools/client/inspector/layout/test/browser_layout_update-in-iframes.js
+++ b/devtools/client/inspector/layout/test/browser_layout_update-in-iframes.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the layout-view for elements within iframes also updates when they
// change
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_layout_iframe1.html");
let {inspector, view, testActor} = yield openLayoutView();
yield testResizingInIframe(inspector, view, testActor);
yield testReflowsAfterIframeDeletion(inspector, view, testActor);
});
function* testResizingInIframe(inspector, view, testActor) {
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -463,16 +463,18 @@ MarkupView.prototype = {
parent = parent.parentNode;
}
if (container instanceof MarkupElementContainer) {
// With the newly found container, delegate the tooltip content creation
// and decision to show or not the tooltip
return container.isImagePreviewTarget(target, this.tooltip);
}
+
+ return undefined;
},
/**
* Given the known reason, should the current selection be briefly highlighted
* In a few cases, we don't want to highlight the node:
* - If the reason is null (used to reset the selection),
* - if it's "inspector-open" (when the inspector opens up, let's not
* highlight the default node)
@@ -529,16 +531,17 @@ MarkupView.prototype = {
return promise.reject("markupview destroyed");
}
// Mark the node as selected.
this.markNodeAsSelected(selection.nodeFront);
// Make sure the new selection receives focus so the keyboard can be used.
this.maybeFocusNewSelection();
+ return undefined;
}).catch(e => {
if (!this._destroyer) {
console.error(e);
} else {
console.warn("Could not mark node as selected, the markup-view was " +
"destroyed while showing the node.");
}
});
@@ -702,16 +705,17 @@ MarkupView.prototype = {
this._inspector.scrollNodeIntoView(selection);
break;
}
case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE: {
if (this.isDragging) {
this.cancelDragging();
break;
}
+ // falls through
}
default:
handled = false;
}
if (handled) {
event.stopPropagation();
event.preventDefault();
}
@@ -2004,17 +2008,17 @@ MarkupContainer.prototype = {
this._isPreDragging = true;
this._dragStartY = event.pageY;
}
},
/**
* On mouse up, stop dragging.
*/
- _onMouseUp: Task.async(function*() {
+ _onMouseUp: Task.async(function* () {
this._isPreDragging = false;
if (this.isDragging) {
this.cancelDragging();
let dropTargetNodes = this.markup.dropTargetNodes;
if (!dropTargetNodes) {
@@ -2293,16 +2297,17 @@ MarkupElementContainer.prototype = Herit
this.markup._makeTooltipPersistent(true);
tooltip.once("hidden", () => {
this.markup._makeTooltipPersistent(false);
});
tooltip.show(target);
});
return true;
}
+ return undefined;
},
/**
* Generates the an image preview for this Element. The element must be an
* image or canvas (@see isPreviewable).
*
* @return {Promise} that is resolved with an object of form
* { data, size: { naturalWidth, naturalHeight, resizeRatio } } where
@@ -2322,17 +2327,17 @@ MarkupElementContainer.prototype = Herit
// A preview request is already pending. Re-use that request.
return this.tooltipDataPromise;
}
let maxDim =
Services.prefs.getIntPref("devtools.inspector.imagePreviewTooltipSize");
// Fetch the preview from the server.
- this.tooltipDataPromise = Task.spawn(function*() {
+ this.tooltipDataPromise = Task.spawn(function* () {
let preview = yield this.node.getImageData(maxDim);
let data = yield preview.data.string();
// Clear the pending preview request. We can't reuse the results later as
// the preview contents might have changed.
this.tooltipDataPromise = null;
return { data, size: preview.size };
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_01.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test native anonymous content in the markupview.
const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let pseudo = yield getNodeFront("#pseudo", inspector);
// Markup looks like: <div><::before /><span /><::after /></div>
let children = yield inspector.walker.children(pseudo);
is(children.nodes.length, 3, "Children returned from walker");
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
@@ -4,17 +4,17 @@
"use strict";
requestLongerTimeout(2);
// Test XBL anonymous content in the markupview
const TEST_URL = "chrome://devtools/content/scratchpad/scratchpad.xul";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let toolbarbutton = yield getNodeFront("toolbarbutton", inspector);
let children = yield inspector.walker.children(toolbarbutton);
is(toolbarbutton.numChildren, 3, "Correct number of children");
is(children.nodes.length, 3, "Children returned from walker");
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js
@@ -4,17 +4,17 @@
"use strict";
// Test shadow DOM content in the markupview.
// Note that many features are not yet enabled, but basic listing
// of elements should be working.
const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
-add_task(function*() {
+add_task(function* () {
Services.prefs.setBoolPref("dom.webcomponents.enabled", true);
let {inspector} = yield openInspectorForURL(TEST_URL);
let shadow = yield getNodeFront("#shadow", inspector.markup);
let children = yield inspector.walker.children(shadow);
is(shadow.numChildren, 3, "Children of the shadow root are counted");
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_04.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_04.js
@@ -4,17 +4,17 @@
"use strict";
// Test native anonymous content in the markupview with
// devtools.inspector.showAllAnonymousContent set to true
const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
const PREF = "devtools.inspector.showAllAnonymousContent";
-add_task(function*() {
+add_task(function* () {
Services.prefs.setBoolPref(PREF, true);
let {inspector} = yield openInspectorForURL(TEST_URL);
let native = yield getNodeFront("#native", inspector);
// Markup looks like: <div><video controls /></div>
let nativeChildren = yield inspector.walker.children(native);
--- a/devtools/client/inspector/markup/test/browser_markup_copy_image_data.js
+++ b/devtools/client/inspector/markup/test/browser_markup_copy_image_data.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that image nodes have the "copy data-uri" contextual menu item enabled
// and that clicking it puts the image data into the clipboard
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_markup_image_and_canvas.html");
let {inspector, testActor} = yield openInspector();
yield selectNode("div", inspector);
yield assertCopyImageDataNotAvailable(inspector);
yield selectNode("img", inspector);
yield assertCopyImageDataAvailable(inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js
@@ -64,14 +64,14 @@ const TEST_DATA = [
["!", "style=\"display: inherit; color :chartreuse !important; ",
45, 55, false],
["VK_RIGHT", "style=\"display: inherit; color :chartreuse !important; ",
55, 55, false],
["VK_RETURN", "style=\"display: inherit; color :chartreuse !important;\"",
-1, -1, false]
];
-add_task(function*() {
+add_task(function* () {
info("Opening the inspector on the test URL");
let {inspector} = yield openInspectorForURL(TEST_URL);
yield runStyleAttributeAutocompleteTests(inspector, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js
@@ -91,16 +91,16 @@ const TEST_DATA_INNER = [
[" ", "style=\"background:url('1'); ", 28, 28, false],
["c", "style=\"background:url('1'); color", 29, 33, true],
["VK_RIGHT", "style=\"background:url('1'); color", 33, 33, false],
[":", "style=\"background:url('1'); color:aliceblue", 34, 43, true],
["b", "style=\"background:url('1'); color:beige", 35, 39, true],
["VK_RETURN", "style=\"background:url('1'); color:beige\"", -1, -1, false]
];
-add_task(function*() {
+add_task(function* () {
info("Opening the inspector on the test URL");
let {inspector} = yield openInspectorForURL(TEST_URL);
yield runStyleAttributeAutocompleteTests(inspector, TEST_DATA_DOUBLE);
yield runStyleAttributeAutocompleteTests(inspector, TEST_DATA_SINGLE);
yield runStyleAttributeAutocompleteTests(inspector, TEST_DATA_INNER);
});
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_autoscroll.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_autoscroll.js
@@ -4,17 +4,17 @@
"use strict";
// Test that dragging a node near the top or bottom edge of the markup-view
// auto-scrolls the view.
const TEST_URL = URL_ROOT + "doc_markup_dragdrop_autoscroll.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let markup = inspector.markup;
let viewHeight = markup.doc.documentElement.clientHeight;
info("Pretend the markup-view is dragging");
markup.isDragging = true;
info("Simulate a mousemove on the view, at the bottom, and expect scrolling");
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_distance.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_distance.js
@@ -9,17 +9,17 @@
// DRAG_DROP_MIN_INITIAL_DISTANCE.
const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html";
const TEST_NODE = "#test";
// Keep this in sync with DRAG_DROP_MIN_INITIAL_DISTANCE in markup-view.js
const MIN_DISTANCE = 10;
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Drag the test node by half of the minimum distance");
yield simulateNodeDrag(inspector, TEST_NODE, 0, MIN_DISTANCE / 2);
yield checkIsDragging(inspector, TEST_NODE, false);
info("Drag the test node by exactly the minimum distance");
yield simulateNodeDrag(inspector, TEST_NODE, 0, MIN_DISTANCE);
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_dragRootNode.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_dragRootNode.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the root node isn't draggable (as well as head and body).
const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html";
const TEST_DATA = ["html", "head", "body"];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
for (let selector of TEST_DATA) {
info("Try to drag/drop node " + selector);
yield simulateNodeDrag(inspector, selector);
let container = yield getContainerForSelector(selector, inspector);
ok(!container.isDragging, "The container hasn't been marked as dragging");
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_draggable.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_draggable.js
@@ -17,36 +17,36 @@ const TEST_DATA = [
{ node: "body", draggable: false },
{ node: "html", draggable: false },
{ node: "style", draggable: true },
{ node: "a", draggable: true },
{ node: "p", draggable: true },
{ node: "input", draggable: true },
{ node: "div", draggable: true },
{
- node: function*(inspector) {
+ node: function* (inspector) {
let parentFront = yield getNodeFront("#before", inspector);
let {nodes} = yield inspector.walker.children(parentFront);
// Getting the comment node.
return getContainerForNodeFront(nodes[1], inspector);
},
draggable: true
},
{
- node: function*(inspector) {
+ node: function* (inspector) {
let parentFront = yield getNodeFront("#test", inspector);
let {nodes} = yield inspector.walker.children(parentFront);
// Getting the ::before pseudo element.
return getContainerForNodeFront(nodes[0], inspector);
},
draggable: false
}
];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
yield inspector.markup.expandAll();
for (let {node, draggable} of TEST_DATA) {
let container;
let name;
if (typeof node === "string") {
container = yield getContainerForSelector(node, inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_escapeKeyPress.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_escapeKeyPress.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test whether ESCAPE keypress cancels dragging of an element.
const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let {markup} = inspector;
info("Get a test container");
yield selectNode("#test", inspector);
let container = yield getContainerForSelector("#test", inspector);
info("Simulate a drag/drop on this container");
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_invalidNodes.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_invalidNodes.js
@@ -4,17 +4,17 @@
"use strict";
// Check that pseudo-elements and anonymous nodes are not draggable.
const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html";
const PREF = "devtools.inspector.showAllAnonymousContent";
-add_task(function*() {
+add_task(function* () {
Services.prefs.setBoolPref(PREF, true);
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Expanding nodes below #test");
let parentFront = yield getNodeFront("#test", inspector);
yield inspector.markup.expandNode(parentFront);
yield waitForMultipleChildrenUpdates(inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_reorder.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_reorder.js
@@ -5,17 +5,17 @@
"use strict";
requestLongerTimeout(2);
// Test different kinds of drag and drop node re-ordering.
const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let ids;
info("Expand #test node");
let parentFront = yield getNodeFront("#test", inspector);
yield inspector.markup.expandNode(parentFront);
yield waitForMultipleChildrenUpdates(inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js
+++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that tooltips don't appear when dragging over tooltip targets.
const TEST_URL = "data:text/html;charset=utf8,<img src=\"about:logo\" /><div>";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let {markup} = inspector;
info("Get the tooltip target element for the image's src attribute");
let img = yield getContainerForSelector("img", inspector);
let target = img.editor.getAttributeElement("src").querySelector(".link");
info("Check that the src attribute of the image is a valid tooltip target");
--- a/devtools/client/inspector/markup/test/browser_markup_events-overflow.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events-overflow.js
@@ -25,17 +25,17 @@ const TEST_DATA = [
desc: "neither header nor editor overflows the container",
initialScrollTop: 2,
headerToClick: 5,
alignBottom: false,
alignTop: false,
},
];
-add_task(function*() {
+add_task(function* () {
let { inspector } = yield openInspectorForURL(TEST_URL);
let markupContainer = yield getContainerForSelector("#events", inspector);
let evHolder = markupContainer.elt.querySelector(".markupview-events");
let tooltip = inspector.markup.tooltip;
info("Clicking to open event tooltip.");
EventUtils.synthesizeMouseAtCenter(evHolder, {},
--- a/devtools/client/inspector/markup/test/browser_markup_events.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events.js
@@ -187,11 +187,11 @@ const TEST_DATA = [ // eslint-disable-li
yield testActor.eval(
"window.wrappedJSObject.removeNoeventsClickHandler();");
yield nodeMutated;
},
expected: []
},
];
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_form.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_form.js
@@ -9,17 +9,17 @@
// The test registers one backend actor providing custom form data
// and checks that the value is properly sent to the client (NodeFront).
const TEST_PAGE_URL = URL_ROOT + "doc_markup_events_form.html";
const TEST_ACTOR_URL = CHROME_URL_ROOT + "actor_events_form.js";
var {EventsFormFront} = require(TEST_ACTOR_URL);
-add_task(function*() {
+add_task(function* () {
info("Opening the Toolbox");
let tab = yield addTab(TEST_PAGE_URL);
let toolbox = yield openToolboxForTab(tab, "webconsole");
info("Registering test actor");
let {registrar, front} = yield registerTestActor(toolbox);
info("Selecting the Inspector panel");
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.0.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.0.js
@@ -228,11 +228,11 @@ const TEST_DATA = [
" return returnValue;\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.1.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.1.js
@@ -262,11 +262,11 @@ const TEST_DATA = [
" return returnValue;\n" +
"}"
}
]
}
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.11.1.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.11.1.js
@@ -186,11 +186,11 @@ const TEST_DATA = [
" alert(5);\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.2.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.2.js
@@ -181,11 +181,11 @@ const TEST_DATA = [
" return val;\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.3.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.3.js
@@ -214,11 +214,11 @@ const TEST_DATA = [
" alert(2);\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.4.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.4.js
@@ -277,11 +277,11 @@ const TEST_DATA = [
" return b\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.6.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.6.js
@@ -378,11 +378,11 @@ const TEST_DATA = [
" }\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.7.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_1.7.js
@@ -224,11 +224,11 @@ const TEST_DATA = [
" alert(5);\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_events_jquery_2.1.1.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_jquery_2.1.1.js
@@ -186,11 +186,11 @@ const TEST_DATA = [
" alert(5);\n" +
"}"
}
]
},
];
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
yield runEventPopupTests(TEST_URL, TEST_DATA);
});
--- a/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js
@@ -7,17 +7,17 @@
// Test outerHTML edition via the markup-view
loadHelperScript("helper_outerhtml_test_runner.js");
const TEST_DATA = [{
selector: "#one",
oldHTML: '<div id="one">First <em>Div</em></div>',
newHTML: '<div id="one">First Div</div>',
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
let text = yield testActor.getProperty("#one", "textContent");
is(text, "First Div", "New div has expected text content");
let num = yield testActor.getNumberOfElementMatches("#one em");
is(num, 0, "No em remaining");
}
}, {
selector: "#removedChildren",
oldHTML: "<div id=\"removedChildren\">removedChild " +
@@ -28,33 +28,33 @@ const TEST_DATA = [{
oldHTML: '<div id="addedChildren">addedChildren</div>',
newHTML: "<div id=\"addedChildren\">addedChildren " +
"<i>Italic <b>Bold <u>Underline</u></b></i> Normal</div>"
}, {
selector: "#addedAttribute",
oldHTML: '<div id="addedAttribute">addedAttribute</div>',
newHTML: "<div id=\"addedAttribute\" class=\"important\" disabled checked>" +
"addedAttribute</div>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let html = yield testActor.getProperty("#addedAttribute", "outerHTML");
is(html, "<div id=\"addedAttribute\" class=\"important\" disabled=\"\" " +
"checked=\"\">addedAttribute</div>", "Attributes have been added");
}
}, {
selector: "#changedTag",
oldHTML: '<div id="changedTag">changedTag</div>',
newHTML: '<p id="changedTag" class="important">changedTag</p>'
}, {
selector: "#siblings",
oldHTML: '<div id="siblings">siblings</div>',
newHTML: '<div id="siblings-before-sibling">before sibling</div>' +
'<div id="siblings">siblings (updated)</div>' +
'<div id="siblings-after-sibling">after sibling</div>',
- validate: function*({selectedNodeFront, inspector, testActor}) {
+ validate: function* ({selectedNodeFront, inspector, testActor}) {
let beforeSiblingFront = yield getNodeFront("#siblings-before-sibling",
inspector);
is(beforeSiblingFront, selectedNodeFront, "Sibling has been selected");
let text = yield testActor.getProperty("#siblings", "textContent");
is(text, "siblings (updated)", "New div has expected text content");
let beforeText = yield testActor.getProperty("#siblings-before-sibling",
@@ -70,13 +70,13 @@ const TEST_DATA = [{
const TEST_URL = "data:text/html," +
"<!DOCTYPE html>" +
"<head><meta charset='utf-8' /></head>" +
"<body>" +
TEST_DATA.map(outer => outer.oldHTML).join("\n") +
"</body>" +
"</html>";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
inspector.markup._frame.focus();
yield runEditOuterHTMLTests(TEST_DATA, inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js
@@ -9,17 +9,17 @@
loadHelperScript("helper_outerhtml_test_runner.js");
requestLongerTimeout(2);
const TEST_DATA = [
{
selector: "#badMarkup1",
oldHTML: "<div id=\"badMarkup1\">badMarkup1</div>",
newHTML: "<div id=\"badMarkup1\">badMarkup1</div> hanging</div>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let textNodeName = yield testActor.eval(`
content.document.querySelector("#badMarkup1").nextSibling.nodeName
`);
let textNodeData = yield testActor.eval(`
content.document.querySelector("#badMarkup1").nextSibling.data
`);
@@ -27,17 +27,17 @@ const TEST_DATA = [
is(textNodeData, " hanging", "New text node has expected text content");
}
},
{
selector: "#badMarkup2",
oldHTML: "<div id=\"badMarkup2\">badMarkup2</div>",
newHTML: "<div id=\"badMarkup2\">badMarkup2</div> hanging<div></div>" +
"</div></div></body>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let textNodeName = yield testActor.eval(`
content.document.querySelector("#badMarkup2").nextSibling.nodeName
`);
let textNodeData = yield testActor.eval(`
content.document.querySelector("#badMarkup2").nextSibling.data
`);
@@ -45,31 +45,31 @@ const TEST_DATA = [
is(textNodeData, " hanging", "New text node has expected text content");
}
},
{
selector: "#badMarkup3",
oldHTML: "<div id=\"badMarkup3\">badMarkup3</div>",
newHTML: "<div id=\"badMarkup3\">badMarkup3 <em>Emphasized <strong> " +
"and strong</div>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let emText = yield testActor.getProperty("#badMarkup3 em", "textContent");
let strongText = yield testActor.getProperty("#badMarkup3 strong",
"textContent");
is(emText, "Emphasized and strong", "<em> was auto created");
is(strongText, " and strong", "<strong> was auto created");
}
},
{
selector: "#badMarkup4",
oldHTML: "<div id=\"badMarkup4\">badMarkup4</div>",
newHTML: "<div id=\"badMarkup4\">badMarkup4</p>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let divText = yield testActor.getProperty("#badMarkup4", "textContent");
let divTag = yield testActor.getProperty("#badMarkup4", "tagName");
let pText = yield testActor.getProperty("#badMarkup4 p", "textContent");
let pTag = yield testActor.getProperty("#badMarkup4 p", "tagName");
@@ -78,17 +78,17 @@ const TEST_DATA = [
is(pText, "", "The <p> tag has no children");
is(pTag, "P", "Created an empty <p> tag");
}
},
{
selector: "#badMarkup5",
oldHTML: "<p id=\"badMarkup5\">badMarkup5</p>",
newHTML: "<p id=\"badMarkup5\">badMarkup5 <div>with a nested div</div></p>",
- validate: function*({pageNodeFront, selectedNodeFront, testActor}) {
+ validate: function* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let num = yield testActor.getNumberOfElementMatches("#badMarkup5 div");
let pText = yield testActor.getProperty("#badMarkup5", "textContent");
let pTag = yield testActor.getProperty("#badMarkup5", "tagName");
let divText = yield testActor.getProperty("#badMarkup5 ~ div",
@@ -107,13 +107,13 @@ const TEST_DATA = [
const TEST_URL = "data:text/html," +
"<!DOCTYPE html>" +
"<head><meta charset='utf-8' /></head>" +
"<body>" +
TEST_DATA.map(outer => outer.oldHTML).join("\n") +
"</body>" +
"</html>";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
inspector.markup._frame.focus();
yield runEditOuterHTMLTests(TEST_DATA, inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_html_edit_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_html_edit_03.js
@@ -15,17 +15,17 @@ const TEST_URL = "data:text/html," +
"</body>" +
"</html>";
const SELECTOR = "#keyboard";
const OLD_HTML = '<div id="keyboard"></div>';
const NEW_HTML = '<div id="keyboard">Edited</div>';
requestLongerTimeout(2);
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
inspector.markup._frame.focus();
info("Check that pressing escape cancels edits");
yield testEscapeCancels(inspector, testActor);
info("Check that pressing F2 commits edits");
--- a/devtools/client/inspector/markup/test/browser_markup_image_tooltip.js
+++ b/devtools/client/inspector/markup/test/browser_markup_image_tooltip.js
@@ -9,17 +9,17 @@
const TEST_NODES = [
{selector: "img.local", size: "192" + " \u00D7 " + "192"},
{selector: "img.data", size: "64" + " \u00D7 " + "64"},
{selector: "img.remote", size: "22" + " \u00D7 " + "23"},
{selector: ".canvas", size: "600" + " \u00D7 " + "600"}
];
-add_task(function*() {
+add_task(function* () {
yield addTab(URL_ROOT + "doc_markup_image_and_canvas_2.html");
let {inspector} = yield openInspector();
info("Selecting the first <img> tag");
yield selectNode("img", inspector);
for (let testNode of TEST_NODES) {
let target = yield getImageTooltipTarget(testNode, inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_image_tooltip_mutations.js
+++ b/devtools/client/inspector/markup/test/browser_markup_image_tooltip_mutations.js
@@ -11,17 +11,17 @@
const INITIAL_SRC = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADI5JREFUeNrsWwuQFNUVPf1m5z87szv7HWSWj8CigBFMEFZKiQsB1PgJwUAZg1HBpIQsKmokEhNjWUnFVPnDWBT+KolJYbRMoqUVq0yCClpqiX8sCchPWFwVlt2db7+X93pez7zu6Vn2NxsVWh8987p7pu+9555z7+tZjTGGY3kjOMa34w447oBjfKsY7i/UNM3Y8eFSAkD50Plgw03K5P9gvGv7U5ieeR3PszeREiPNX3/0DL4hjslzhm8THh+OITfXk3dhiv4GDtGPVzCaeJmPLYzuu5qJuWfuw2QTlcN1X9pwQU7LhdZ/ZAseD45cOh9hHvDkc/yAF/DNhdb5Mrr3PvBMaAYW8fMSIi2G497IMEK/YutGtAYr6+ej+nxu/NN8Ks3N7AR6HgcLz0Eg1Ljg1UcxZzi5qewIkMYLRweTr2Kzp+nmyXAd5pS3XQDd+N/4h4zgu9FI7brlXf90nMEnuwQxlvv+hosE3TuexmWeysmT4W+WxkMaLzf9Y8ATgjcUn7T9H1gqrpFq8eV1gMn6t16NhngjfoX6q4DUP032Rd4LJgpSLwJ1yzFqBG69eRkah0MVyo0Acfe+yy9AG4nMiYCkeM53KKFXncBLAXqEm+wCqZwaueq7WCmuLTcKSJmj737ol2hurA9eq9VdyiO8yWa3NNyog+SB5CZodSsQq/dfu34tJpYbBaTMzvVddDZu16q5smXf4G8zEvqm4cyaAmJPuTJk3oJWdS4WzcVtfMZbThSQckb/pYfRGgo3zNOqZnEHbJPGK4abaDCQIIsT8V/qTaBqHkLh6LzXH8XZQhbLhYKyyCC/WeHYcNdmvOgfe8skzbWL270/T3wf7tSx/lGCbTu8xlzzmCSWLc5iwmgikcCHi3Mga0Ry913vBFvQwg90l6M4ImWKfsWOp7DSWxmfpPlCFuPFfsNfKrCnPYpQKIRgqBK7D0SxYaNHwkEiJMtl0ReDp3Lc5D3PGoTo/sKngCl7a5chFqvBatKwjBd7WwqIlzB/78NcoUcp5VSgGxm+7b8eqQRGnHMO634epO4S1EZww09/iFg5UmGoESDuznP1xVhTUX1WWHPzjpd25wyH0hRxI3LGM75nxmuNEEUVpAN0XgxmPoKralakbQnWlIMQyVBD/w+3orkq4lvualjKyWwzt4MaxqspQHVhPOWG64bxYuhZXSFGWhipbSDVragOu5Y9eAsmDDUKyBA703vemVhHoueD6e9wAzJK1WfmN0Umk5GGM4kEMZcuIECqgjm0nldAqmbjwtm4VxZH5AvlADP6mx9Eqy9Q0+KqW8Ch+47FaMMYmnNGfY1iPMshoC6qFxme4wQ+0p+ARE6H3+9veWEDWgUhDhUKyFARn4jM5BNxT0XsMg7bfymGK1ov3wtjDfhL4w0HVGUVBEjDaaE+QNdrcNWch1PG4W6xrjBUXECGivg++Cva3JUT4iQUz3V2RsSVaKLwOuDT89A3HdBQoxhNC+fnVm74ual2EG893P6G+PuP4SfiO4cCBWQooL9qCWKNXPbcI37Aa/lnlZxXRt4RFONGwSDCPAHqOuqjWct1QiEMw5mChM5X4K47FyNqcd3aK9AwFH0CGYLoe1ctxk2eWi57rg5JfGp9rzC6ggCdFlAgHBDw5Yxlcg6G8SyHCjMlsgmDD9zhSeHlF+JnAgWDTQUy2NxfdwOao1UVV3pi3+bE97YSbWpLAbn6zefHNQkp1PMpIBwwvslKgIYTKM2nEpNzrGcH3FXTEal0L38kJ4uDQgEZbO4vnI173LXf5NHZaiUxtaCxyZuo/rK6LpUg54yg3zTWRAArvDcRIPZ6BqzrQ1REpmL+DNw32OKIDCb3X1qPVn8wNNMT4w2bvs+q4bAZrqBh2skaL3yyhhIIZ4i6oHkUK0RckcB8GigEyRIH4A6Mgc8fatl0/+BkkQxC9gIT4ljna1rIZW9rEdNbjJcNjsnoYj7LHWCUwpITzEgzRQKZ3XAFHbTzA3hrz8TEUUZxFBhoKpABQt/97p+w0hMZG68I8R6FtlsJT3FELndZntjM+VMnylKYq8GJI3UZaRMpquGSGFVOEfv0YZBMNzz+uvjbfzS6xQERIhlI9FcvQWNdFVb7x1zCb+QNK8vb9NsiifmI5hBgVoOCBC1sb0ab5RomqENxLO3eA1/0NDRU47q2RQNbRCUDIb7lF2CNL3ZGxEV4n08TVvZWYG4pZyV0zUdS45tyCBByOHWiyvZmxFXDCyRo1ge5+Sy0TA+8lWMiP/6O0S32exGV9Jf4fr8azdUR3zL/CZz4MtvzdX5uOYs6NDOmpkuj5Huh+7qUQSYl0ThHzw0YQzcGo6bhzEqoYq5rN3yRiYiG3Vfe2Ybm/qKA9NNZ3nNm4F7/yDkg9AN+U1mHiBcXP8zuDN76jj8hg1QyiWQigalj02BJPhK8I0zxijAjhp5zhlpLUDvS+BCy2HMAvvB4XDgL9/SXC0g/ou/5+6/xLX8w0uJrOIkXfPvyhY0F6gr7M8H0KWFYikcqAXakB+xwD9CdREBLoau7Gz3cAdSIdLFxFtJTCqRChSjnutvhDcREtzjz2Tswtz+yeNRFUeXZXtWux7C1fuoVcbd3J//ipDX3uZZDLGrwweS+UBLL5TDliVBnF8P7H+XI8aRRGsIBJg/Zlslt1+W+D1JWoSyi+kD9jfhs78t7mhZhSl+fLfY1Bdyv3I8V/qpY3B1McgN7ZFT5/vNO0I5DPLLdPBIJA8qc4h2I0QplYfDpJwHT+aj0246r5S8rToG8OjCle8wk4OLvvYGa+Ovr84uo2qBSwJS9G5egoZFLTfiEqWDtbwGfHgKOdPHcS+ai7XDzMPW/FJRLGGcxnBbK4YJC2K+h+T6Bdu5CqHqCWERd3bawb7JI+iJ735+LNaHaprBLLHBm08U3XxShEsdt+f3eTh3v7aC95Dct4RCWL5OZWh/oXBZThxAIxyOXLzBk8aiEWJID8rK3CpPOmeHaGpvCS+7EHv5FujVHUSJPLXvIFeHcNc+9xrB2gws9KZdxuLFax/WLM5gzzSm/lTXF/OdAcapyvjxPqxqHjr2v4ckX2bS2dRBrc5lSdpKjEJ9/9tdwX2WMd53ZQ2IVo3RES+UwVSpCPvYepNx4gmTGDUKIMQ4eduPnD7mx9xOn/KZKOlFbStjONxHTtR+BYAPmnoZ1Zp8wkBRwP/EL3u0F/C2hGl7vpz7vW37T3vP7if8wroKuoh8ribknX9BK5rcF+mo1qKaKyRPJTgTDjbzY8szcuLb3bpH00u35T47j7prRpwDJTxzyG0dHgxPp5bPG8VdkpfPbUg3SgoOo2mwVukb98D5EqpswZTTulCggTk4gpYhv0++wIhCJxr0+Hq1sondis0SE2oxQe3qWXwWyO4DSQg9gJ8Iiw1VFcGqXxet0N9xE4ygIxv/9W6wo9WyROEX/R+eiobYSq2vHTOR631Eiv2lRfh9dvxkumkXh92Qsx8XrAJ+7YGbWuhxOi/U+31NQmzyqNYG8N/3wfo6CRtRHcN01FzkvojohwLu0VVvDa56IS/xcj2b7nN+O+m0jqpE1wMPXZxAN9iCVThtDvH7gmiRGRpU8Lspv1Uhq4wIVdQoyuGSLNYPKUCS8+CzNURbzMmjK3i8u0U793lmuV0ef9nWQ5MGC/DiUqEUSaCtXna9RJEspZS1lrXINK/pcq+SpT50t98QKMq1FRmDfx3vxty102k0PM4ssEnvuz5+G26Ij4yDpz6z9fV8bkyIkqBFkhej0Ib+ZQ34XJK9AfozaiimqIoX3Jp3tiISrcfYpuN2+iFph/02P36PNC9fVcCnp6H9jYouKyfaWufz5Tp9tVxcUniw7IohZv4dZz81/ns67z3AYPrc2n0+Ix2q8k0PWjgBy88XaibnfK9A+5LdDY2Ivhy36fbT8Zv3Lb1U1qLqUxorXEEXIs0mjjrtxoTZWtdvigNs2sgPiujTv6DIZLld6b/V5742JZV3fUsUVFy5gdsNtKWFzUCEVbNepD1MkSMVbsb6SZm7jI3/zODtQKgUMsOw8wDZ63t5xcV1TnaEAxoc6wrqY+Fj+N4DsqOnhOIdicrQSm1MPYCPlIqHn5bbHg8/bj2D3QfZnCX3mpAICDZV8jH5kpbZqTD0W+DxaA74CWzLN2nd14OlL72J38Lf7+TjC7dadZFDoZJQPrtaIKL/G0L6ktptPZVJ8fMqHYPZOKYPMyQGadIJfDvdXwAFiZOTvDBPydf5vk4rWA+RfdhBlaF/yDDBRoMu9pfnSjv/p7DG+HXfAcQcc49v/BBgAcFAO4DmB2GQAAAAASUVORK5CYII=";
/*eslint-enable */
const UPDATED_SRC = URL_ROOT + "doc_markup_tooltip.png";
const INITIAL_SRC_SIZE = "64" + " \u00D7 " + "64";
const UPDATED_SRC_SIZE = "22" + " \u00D7 " + "23";
-add_task(function*() {
+add_task(function* () {
let { inspector } = yield openInspectorForURL(
"data:text/html,<p>markup view tooltip test</p><img>");
info("Retrieving NodeFront for the <img> element.");
let img = yield getNodeFront("img", inspector);
info("Selecting the <img> element");
yield selectNode(img, inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_01.js
@@ -5,17 +5,17 @@
"use strict";
requestLongerTimeout(2);
// Tests tabbing through attributes on a node
const TEST_URL = "data:text/html;charset=utf8,<div id='test' a b c d e></div>";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Focusing the tag editor of the test element");
let {editor} = yield getContainerForSelector("div", inspector);
editor.tag.focus();
info("Pressing tab and expecting to focus the ID attribute, always first");
EventUtils.sendKey("tab", inspector.panelWin);
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_02.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that pressing ESC when a node in the markup-view is focused toggles
// the split-console (see bug 988278)
const TEST_URL = "data:text/html;charset=utf8,<div></div>";
-add_task(function*() {
+add_task(function* () {
let {inspector, toolbox} = yield openInspectorForURL(TEST_URL);
info("Focusing the tag editor of the test element");
let {editor} = yield getContainerForSelector("div", inspector);
editor.tag.focus();
info("Pressing ESC and wait for the split-console to open");
let onSplitConsole = toolbox.once("split-console");
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_03.js
@@ -6,17 +6,17 @@
// Tests that selecting a node with the mouse (by clicking on the line) focuses
// the first focusable element in the corresponding MarkupContainer so that the
// keyboard can be used immediately.
const TEST_URL = `data:text/html;charset=utf8,
<div class='test-class'></div>Text node`;
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let {walker} = inspector;
info("Select the test node to have the 2 test containers visible");
yield selectNode("div", inspector);
let divFront = yield walker.querySelector(walker.rootNode, "div");
let textFront = yield walker.nextSibling(divFront);
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_04.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_04.js
@@ -7,17 +7,17 @@
requestLongerTimeout(2);
// Tests that selecting a node using the browser context menu (inspect element)
// or the element picker focuses that node so that the keyboard can be used
// immediately.
const TEST_URL = "data:text/html;charset=utf8,<div>test element</div>";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Select the test node with the browser ctx menu");
yield clickOnInspectMenuItem(testActor, "div");
assertNodeSelected(inspector, "div");
info("Press arrowUp to focus <body> " +
"(which works if the node was focused properly)");
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_delete_attributes.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_delete_attributes.js
@@ -2,34 +2,34 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that attributes can be deleted from the markup-view with the delete key
// when they are focused.
-const HTML = `<div id="id" class="class" data-id="id"></div>`;
+const HTML = '<div id="id" class="class" data-id="id"></div>';
const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent(HTML);
// List of all the test cases. Each item is an object with the following props:
// - selector: the css selector of the node that should be selected
// - attribute: the name of the attribute that should be focused. Do not
// specify an attribute that would make it impossible to find the node using
// selector.
// Note that after each test case, undo is called.
const TEST_DATA = [{
selector: "#id",
attribute: "class"
}, {
selector: "#id",
attribute: "data-id"
}];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let {walker} = inspector;
for (let {selector, attribute} of TEST_DATA) {
info("Get the container for node " + selector);
let {editor} = yield getContainerForSelector(selector, inspector);
info("Focus attribute " + attribute);
--- a/devtools/client/inspector/markup/test/browser_markup_keybindings_scrolltonode.js
+++ b/devtools/client/inspector/markup/test/browser_markup_keybindings_scrolltonode.js
@@ -12,17 +12,17 @@ const HTML =
style="height: 50px; top: 0; position:absolute;">
TOP</div>
<div id="scroll-bottom"
style="height: 50px; bottom: 0; position:absolute;">
BOTTOM</div>
</div>`;
const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent(HTML);
-add_task(function*() {
+add_task(function* () {
let { inspector, testActor } = yield openInspectorForURL(TEST_URL);
info("Make sure the markup frame has the focus");
inspector.markup._frame.focus();
info("Before test starts, #scroll-top is visible, #scroll-bottom is hidden");
yield checkElementIsInViewport("#scroll-top", true, testActor);
yield checkElementIsInViewport("#scroll-bottom", false, testActor);
--- a/devtools/client/inspector/markup/test/browser_markup_links_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_01.js
@@ -97,17 +97,17 @@ const TEST_DATA = [{
attributes: [{
attributeName: "src",
links: [{type: "jsresource", value: "lib_jquery_1.0.js"}]
}]
}];
requestLongerTimeout(2);
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
for (let {selector, attributes} of TEST_DATA) {
info("Testing attributes on node " + selector);
yield selectNode(selector, inspector);
let {editor} = yield getContainerForSelector(selector, inspector);
for (let {attributeName, links} of attributes) {
--- a/devtools/client/inspector/markup/test/browser_markup_links_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_02.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that attributes are linkified correctly when attributes are updated
// and created.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Adding a contextmenu attribute to the body node");
yield addNewAttributes("body", "contextmenu=\"menu1\"", inspector);
info("Checking for links in the new attribute");
let {editor} = yield getContainerForSelector("body", inspector);
let linkEls = editor.attrElements.get("contextmenu")
--- a/devtools/client/inspector/markup/test/browser_markup_links_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_03.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that links appear correctly in attributes created in content.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Adding a contextmenu attribute to the body node via the content");
let onMutated = inspector.once("markupmutation");
yield testActor.setAttribute("body", "contextmenu", "menu1");
yield onMutated;
info("Checking for links in the new attribute");
--- a/devtools/client/inspector/markup/test/browser_markup_links_04.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_04.js
@@ -69,17 +69,17 @@ const TEST_DATA = [{
}, {
selector: "p[for]",
attributeName: "for",
popupNodeSelector: ".attr-value",
isLinkFollowItemVisible: false,
isLinkCopyItemVisible: false
}];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let linkFollow = inspector.panelDoc.getElementById("node-menu-link-follow");
let linkCopy = inspector.panelDoc.getElementById("node-menu-link-copy");
for (let test of TEST_DATA) {
info("Selecting test node " + test.selector);
yield selectNode(test.selector, inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_links_05.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_05.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that the contextual menu items shown when clicking on links in
// attributes actually do the right things.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Select a node with a URI attribute");
yield selectNode("video", inspector);
info("Set the popupNode to the node that contains the uri");
let {editor} = yield getContainerForSelector("video", inspector);
let popupNode = editor.attrElements.get("poster").querySelector(".link");
--- a/devtools/client/inspector/markup/test/browser_markup_links_06.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_06.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that the contextual menu items shown when clicking on linked attributes
// for <script> and <link> tags actually open the right tools.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
-add_task(function*() {
+add_task(function* () {
let {toolbox, inspector} = yield openInspectorForURL(TEST_URL);
info("Select a node with a cssresource attribute");
yield selectNode("link", inspector);
info("Set the popupNode to the node that contains the uri");
let {editor} = yield getContainerForSelector("link", inspector);
let popupNode = editor.attrElements.get("href").querySelector(".link");
--- a/devtools/client/inspector/markup/test/browser_markup_links_07.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_07.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that a middle-click or meta/ctrl-click on links in attributes actually
// do follows the link.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Select a node with a URI attribute");
yield selectNode("video", inspector);
info("Find the link element from the markup-view");
let {editor} = yield getContainerForSelector("video", inspector);
let linkEl = editor.attrElements.get("poster").querySelector(".link");
--- a/devtools/client/inspector/markup/test/browser_markup_load_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_load_01.js
@@ -27,17 +27,17 @@ const TEST_URL = "data:text/html," +
"<!DOCTYPE html>" +
"<head><meta charset='utf-8' /></head>" +
"<body>" +
"<p>Slow script</p>" +
"<img src='http://localhost:" + server.identity.primaryPort + "/slow.gif' /></script>" +
"</body>" +
"</html>";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor, tab} = yield openInspectorForURL(TEST_URL);
let domContentLoaded = waitForLinkedBrowserEvent(tab, "DOMContentLoaded");
let pageLoaded = waitForLinkedBrowserEvent(tab, "load");
ok(inspector.markup, "There is a markup view");
// Select an element while the tab is in the middle of a slow reload.
testActor.eval("location.reload()");
--- a/devtools/client/inspector/markup/test/browser_markup_mutation_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_mutation_01.js
@@ -12,207 +12,207 @@ const TEST_URL = URL_ROOT + "doc_markup_
// - desc: for logging only
// - numMutations: how many mutations are expected to come happen due to the
// test case. Defaults to 1 if not set.
// - test: a function supposed to mutate the DOM
// - check: a function supposed to test that the mutation was handled
const TEST_DATA = [
{
desc: "Adding an attribute",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setAttribute("#node1", "newattr", "newattrval");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {editor} = yield getContainerForSelector("#node1", inspector);
ok([...editor.attrList.querySelectorAll(".attreditor")].some(attr => {
return attr.textContent.trim() === "newattr=\"newattrval\"";
}), "newattr attribute found");
}
},
{
desc: "Removing an attribute",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.removeAttribute("#node1", "newattr");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {editor} = yield getContainerForSelector("#node1", inspector);
ok(![...editor.attrList.querySelectorAll(".attreditor")].some(attr => {
return attr.textContent.trim() === "newattr=\"newattrval\"";
}), "newattr attribute removed");
}
},
{
desc: "Re-adding an attribute",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setAttribute("#node1", "newattr", "newattrval");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {editor} = yield getContainerForSelector("#node1", inspector);
ok([...editor.attrList.querySelectorAll(".attreditor")].some(attr => {
return attr.textContent.trim() === "newattr=\"newattrval\"";
}), "newattr attribute found");
}
},
{
desc: "Changing an attribute",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setAttribute("#node1", "newattr", "newattrchanged");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {editor} = yield getContainerForSelector("#node1", inspector);
ok([...editor.attrList.querySelectorAll(".attreditor")].some(attr => {
return attr.textContent.trim() === "newattr=\"newattrchanged\"";
}), "newattr attribute found");
}
},
{
desc: "Adding ::after element",
numMutations: 2,
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node1 = content.document.querySelector("#node1");
node1.classList.add("pseudo");
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {children} = yield getContainerForSelector("#node1", inspector);
is(children.childNodes.length, 2,
"Node1 now has 2 children (text child and ::after");
}
},
{
desc: "Removing ::after element",
numMutations: 2,
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node1 = content.document.querySelector("#node1");
node1.classList.remove("pseudo");
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(container.singleTextChild, "Has single text child.");
}
},
{
desc: "Updating the text-content",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setProperty("#node1", "textContent", "newtext");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(container.singleTextChild, "Has single text child.");
ok(!container.canExpand, "Can't expand container with singleTextChild.");
ok(!container.singleTextChild.canExpand, "Can't expand singleTextChild.");
is(container.editor.elt.querySelector(".text").textContent.trim(),
"newtext", "Single text child editor updated.");
}
},
{
desc: "Adding a second text child",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node1 = content.document.querySelector("#node1");
let newText = node1.ownerDocument.createTextNode("more");
node1.appendChild(newText);
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(!container.singleTextChild, "Does not have single text child.");
ok(container.canExpand, "Can expand container with child nodes.");
ok(container.editor.elt.querySelector(".text") == null,
"Single text child editor removed.");
},
},
{
desc: "Go from 2 to 1 text child",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setProperty("#node1", "textContent", "newtext");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(container.singleTextChild, "Has single text child.");
ok(!container.canExpand, "Can't expand container with singleTextChild.");
ok(!container.singleTextChild.canExpand, "Can't expand singleTextChild.");
ok(container.editor.elt.querySelector(".text").textContent.trim(),
"newtext", "Single text child editor updated.");
},
},
{
desc: "Removing an only text child",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setProperty("#node1", "innerHTML", "");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(!container.singleTextChild, "Does not have single text child.");
ok(!container.canExpand, "Can't expand empty container.");
ok(container.editor.elt.querySelector(".text") == null,
"Single text child editor removed.");
},
},
{
desc: "Go from 0 to 1 text child",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setProperty("#node1", "textContent", "newtext");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node1", inspector);
ok(container.singleTextChild, "Has single text child.");
ok(!container.canExpand, "Can't expand container with singleTextChild.");
ok(!container.singleTextChild.canExpand, "Can't expand singleTextChild.");
ok(container.editor.elt.querySelector(".text").textContent.trim(),
"newtext", "Single text child editor updated.");
},
},
{
desc: "Updating the innerHTML",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.setProperty("#node2", "innerHTML",
"<div><span>foo</span></div>");
},
- check: function*(inspector) {
+ check: function* (inspector) {
let container = yield getContainerForSelector("#node2", inspector);
let openTags = container.children.querySelectorAll(".open .tag");
is(openTags.length, 2, "There are 2 tags in node2");
is(openTags[0].textContent.trim(), "div", "The first tag is a div");
is(openTags[1].textContent.trim(), "span", "The second tag is a span");
is(container.children.querySelector(".text").textContent.trim(), "foo",
"The span's textcontent is correct");
}
},
{
desc: "Removing child nodes",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node4 = content.document.querySelector("#node4");
while (node4.firstChild) {
node4.removeChild(node4.firstChild);
}
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {children} = yield getContainerForSelector("#node4", inspector);
is(children.innerHTML, "", "Children have been removed");
}
},
{
desc: "Appending a child to a different parent",
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node17 = content.document.querySelector("#node17");
let node2 = content.document.querySelector("#node2");
node2.appendChild(node17);
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
let {children} = yield getContainerForSelector("#node16", inspector);
is(children.innerHTML, "",
"Node17 has been removed from its node16 parent");
let container = yield getContainerForSelector("#node2", inspector);
let openTags = container.children.querySelectorAll(".open .tag");
is(openTags.length, 3, "There are now 3 tags in node2");
is(openTags[2].textContent.trim(), "p", "The third tag is node17");
@@ -228,26 +228,26 @@ const TEST_DATA = [
// node21
// will become:
// body
// node1
// node20
// node21
// node18
// node19
- test: function*(testActor) {
+ test: function* (testActor) {
yield testActor.eval(`
let node18 = content.document.querySelector("#node18");
let node20 = content.document.querySelector("#node20");
let node1 = content.document.querySelector("#node1");
node1.appendChild(node20);
node20.appendChild(node18);
`);
},
- check: function*(inspector) {
+ check: function* (inspector) {
yield inspector.markup.expandAll();
let {children} = yield getContainerForSelector("#node1", inspector);
is(children.childNodes.length, 2,
"Node1 now has 2 children (textnode and node20)");
let node20 = children.childNodes[1];
let node20Children = node20.container.children;
@@ -261,17 +261,17 @@ const TEST_DATA = [
let node18 = node20Children.childNodes[1];
is(node18.querySelector(".open .attreditor .attr-value")
.textContent.trim(),
"node18", "Node20's second child is indeed node18");
}
}
];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Expanding all markup-view nodes");
yield inspector.markup.expandAll();
for (let {desc, test, check, numMutations} of TEST_DATA) {
info("Starting test: " + desc);
--- a/devtools/client/inspector/markup/test/browser_markup_mutation_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_mutation_02.js
@@ -16,85 +16,85 @@ const TEST_URL = URL_ROOT + "doc_markup_
// - mutate: a generator function that should make changes to the content DOM
// - attribute: if set, the test will expect the corresponding attribute to
// flash instead of the whole node
// - flashedNode: [optional] the css selector of the node that is expected to
// flash in the markup-view as a result of the mutation.
// If missing, the rootNode (".list") will be expected to flash
const TEST_DATA = [{
desc: "Adding a new node should flash the new node",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.eval(`
let newLi = content.document.createElement("LI");
newLi.textContent = "new list item";
content.document.querySelector(".list").appendChild(newLi);
`);
},
flashedNode: ".list li:nth-child(3)"
}, {
desc: "Removing a node should flash its parent",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.eval(`
let root = content.document.querySelector(".list");
root.removeChild(root.lastElementChild);
`);
}
}, {
desc: "Re-appending an existing node should only flash this node",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.eval(`
let root = content.document.querySelector(".list");
root.appendChild(root.firstElementChild);
`);
},
flashedNode: ".list .item:last-child"
}, {
desc: "Adding an attribute should flash the attribute",
attribute: "test-name",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.setAttribute(".list", "test-name", "value-" + Date.now());
}
}, {
desc: "Adding an attribute with css reserved characters should flash the " +
"attribute",
attribute: "one:two",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.setAttribute(".list", "one:two", "value-" + Date.now());
}
}, {
desc: "Editing an attribute should flash the attribute",
attribute: "class",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.setAttribute(".list", "class", "list value-" + Date.now());
}
}, {
desc: "Multiple changes to an attribute should flash the attribute",
attribute: "class",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.eval(`
let root = content.document.querySelector(".list");
root.removeAttribute("class");
root.setAttribute("class", "list value-" + Date.now());
root.setAttribute("class", "list value-" + Date.now());
root.removeAttribute("class");
root.setAttribute("class", "list value-" + Date.now());
root.setAttribute("class", "list value-" + Date.now());
`);
}
}, {
desc: "Removing an attribute should flash the node",
- mutate: function*(testActor) {
+ mutate: function* (testActor) {
yield testActor.eval(`
let root = content.document.querySelector(".list");
root.removeAttribute("class");
`);
}
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
// Make sure mutated nodes flash for a very long time so we can more easily
// assert they do
inspector.markup.CONTAINER_FLASHING_DURATION = 1000 * 60 * 60;
info("Getting the <ul.list> root node to test mutations on");
let rootNodeFront = yield getNodeFront(".list", inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_navigation.js
+++ b/devtools/client/inspector/markup/test/browser_markup_navigation.js
@@ -61,17 +61,17 @@ const TEST_DATA = [
["down", "node10"],
["pageup", "node2"],
["pageup", "*doctype*"],
["down", "html"],
["left", "html"],
["down", "head"]
];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Making sure the markup-view frame is focused");
inspector.markup._frame.focus();
info("Starting to iterate through the test data");
for (let [key, className] of TEST_DATA) {
info("Testing step: " + key + " to navigate to " + className);
--- a/devtools/client/inspector/markup/test/browser_markup_node_names.js
+++ b/devtools/client/inspector/markup/test/browser_markup_node_names.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test element node name in the markupview
const TEST_URL = URL_ROOT + "doc_markup_html_mixed_case.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
// Get and open the svg element to show its children
let svgNodeFront = yield getNodeFront("svg", inspector);
yield inspector.markup.expandNode(svgNodeFront);
yield waitForMultipleChildrenUpdates(inspector);
let clipPathContainer = yield getContainerForSelector("clipPath", inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_node_not_displayed_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_node_not_displayed_01.js
@@ -16,17 +16,17 @@ const TEST_URL = URL_ROOT + "doc_markup_
const TEST_DATA = [
{selector: "#normal-div", isDisplayed: true},
{selector: "head", isDisplayed: false},
{selector: "#display-none", isDisplayed: false},
{selector: "#hidden-true", isDisplayed: false},
{selector: "#visibility-hidden", isDisplayed: true}
];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
for (let {selector, isDisplayed} of TEST_DATA) {
info("Getting node " + selector);
let nodeFront = yield getNodeFront(selector, inspector);
let container = getContainerForNodeFront(nodeFront, inspector);
is(!container.elt.classList.contains("not-displayed"), isDisplayed,
`The container for ${selector} is marked as displayed ${isDisplayed}`);
--- a/devtools/client/inspector/markup/test/browser_markup_node_not_displayed_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_node_not_displayed_02.js
@@ -8,112 +8,112 @@
// their display changes
const TEST_URL = URL_ROOT + "doc_markup_not_displayed.html";
const TEST_DATA = [
{
desc: "Hiding a node by creating a new stylesheet",
selector: "#normal-div",
before: true,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
let div = content.document.createElement("div");
div.id = "new-style";
div.innerHTML = "<style>#normal-div {display:none;}</style>";
content.document.body.appendChild(div);
`);
},
after: false
},
{
desc: "Showing a node by deleting an existing stylesheet",
selector: "#normal-div",
before: false,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
content.document.getElementById("new-style").remove();
`);
},
after: true
},
{
desc: "Hiding a node by changing its style property",
selector: "#display-none",
before: false,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
let node = content.document.querySelector("#display-none");
node.style.display = "block";
`);
},
after: true
},
{
desc: "Showing a node by removing its hidden attribute",
selector: "#hidden-true",
before: false,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
content.document.querySelector("#hidden-true")
.removeAttribute("hidden");
`);
},
after: true
},
{
desc: "Hiding a node by adding a hidden attribute",
selector: "#hidden-true",
before: true,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.setAttribute("#hidden-true", "hidden", "true");
},
after: false
},
{
desc: "Showing a node by changin a stylesheet's rule",
selector: "#hidden-via-stylesheet",
before: false,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
content.document.styleSheets[0]
.cssRules[0].style
.setProperty("display", "inline");
`);
},
after: true
},
{
desc: "Hiding a node by adding a new rule to a stylesheet",
selector: "#hidden-via-stylesheet",
before: true,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
content.document.styleSheets[0].insertRule(
"#hidden-via-stylesheet {display: none;}", 1);
`);
},
after: false
},
{
desc: "Hiding a node by adding a class that matches an existing rule",
selector: "#normal-div",
before: true,
- changeStyle: function*(testActor) {
+ changeStyle: function* (testActor) {
yield testActor.eval(`
content.document.styleSheets[0].insertRule(
".a-new-class {display: none;}", 2);
content.document.querySelector("#normal-div")
.classList.add("a-new-class");
`);
},
after: false
}
];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
for (let data of TEST_DATA) {
info("Running test case: " + data.desc);
yield runTestData(inspector, testActor, data);
}
});
--- a/devtools/client/inspector/markup/test/browser_markup_pagesize_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_pagesize_01.js
@@ -32,17 +32,17 @@ const TEST_DATA = [{
desc: "Verify childrenDirty reloads the page",
selector: "#w",
forceReload: true,
// But now that we don't already have a loaded page, selecting
// w should center around w.
expected: "*more*uvwxy*more*"
}];
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Start iterating through the test data");
for (let step of TEST_DATA) {
info("Start test: " + step.desc);
if (step.forceReload) {
yield forceReload(inspector);
--- a/devtools/client/inspector/markup/test/browser_markup_pagesize_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_pagesize_02.js
@@ -8,17 +8,17 @@
// by the devtools.markup.pagesize preference and that pressing the "show all
// nodes" actually shows the nodes
const TEST_URL = URL_ROOT + "doc_markup_pagesize_02.html";
// Make sure nodes are hidden when there are more than 5 in a row
Services.prefs.setIntPref("devtools.markup.pagesize", 5);
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Selecting the UL node");
yield clickContainer("ul", inspector);
info("Reloading the page with the UL node selected will expand its children");
yield reloadPage(inspector, testActor);
yield inspector.markup._waitForChildren();
--- a/devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js
+++ b/devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js
@@ -4,17 +4,17 @@
"use strict";
// Test confirms that XUL attributes don't show up as empty
// attributes after being deleted
const TEST_URL = URL_ROOT + "doc_markup_xul.xul";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
let panelFront = yield getNodeFront("#test", inspector);
ok(panelFront.hasAttribute("id"),
"panelFront has id attribute in the beginning");
info("Removing panel's id attribute");
let onMutation = inspector.once("markupmutation");
--- a/devtools/client/inspector/markup/test/browser_markup_search_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_search_01.js
@@ -5,17 +5,17 @@
"use strict";
// Test that searching for nodes using the selector-search input expands and
// selects the right nodes in the markup-view, even when those nodes are deeply
// nested (and therefore not attached yet when the markup-view is initialized).
const TEST_URL = URL_ROOT + "doc_markup_search.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
let container = yield getContainerForSelector("em", inspector);
ok(!container, "The <em> tag isn't present yet in the markup-view");
// Searching for the innermost element first makes sure that the inspector
// back-end is able to attach the resulting node to the tree it knows at the
// moment. When the inspector is started, the <body> is the default selected
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js
@@ -57,12 +57,12 @@ var TEST_DATA = [{
name: "id",
value: 'id="node24" class="""',
expectedAttributes: {
id: "node24",
class: ""
}
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield runEditAttributesTests(TEST_DATA, inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_02.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that an existing attribute can be modified
const TEST_URL = `data:text/html,
<div id='test-div'>Test modifying my ID attribute</div>`;
-add_task(function*() {
+add_task(function* () {
info("Opening the inspector on the test page");
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Selecting the test node");
yield selectNode("#test-div", inspector);
info("Verify attributes, only ID should be there for now");
yield assertAttributes("#test-div", {
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_03.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that a node's tagname can be edited in the markup-view
const TEST_URL = `data:text/html;charset=utf-8,
<div id='retag-me'><div id='retag-me-2'></div></div>`;
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield inspector.markup.expandAll();
info("Selecting the test node");
yield selectNode("#retag-me", inspector);
info("Getting the markup-container for the test node");
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_04.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_04.js
@@ -43,17 +43,17 @@ const TEST_DATA = [{
selector: "#second",
key: "back_space",
focusedSelector: "#first"
}, {
selector: "#third",
key: "back_space",
focusedSelector: "#second"
}, {
- setup: function*(inspector, testActor) {
+ setup: function* (inspector, testActor) {
// Removing the siblings of #first in order to test with an only child.
let mutated = inspector.once("markupmutation");
yield testActor.eval(`
for (let node of content.document.querySelectorAll("#second, #third")) {
node.remove();
}
`);
yield mutated;
@@ -62,17 +62,17 @@ const TEST_DATA = [{
key: "delete",
focusedSelector: "#parent"
}, {
selector: "#first",
key: "back_space",
focusedSelector: "#parent"
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
for (let {setup, selector, key, focusedSelector} of TEST_DATA) {
if (setup) {
yield setup(inspector, testActor);
}
yield checkDeleteAndSelection(inspector, key, selector, focusedSelector);
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_05.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_05.js
@@ -66,12 +66,12 @@ var TEST_DATA = [{
}, {
desc: "Add attribute with xmlns",
text: "xmlns:edi='http://ecommerce.example.org/schema'",
expectedAttributes: {
"xmlns:edi": "http://ecommerce.example.org/schema"
}
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield runAddAttributesTests(TEST_DATA, "div", inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_06.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_06.js
@@ -74,12 +74,12 @@ var TEST_DATA = [{
text: "onclick=\"javascript: throw new Error('wont fire');\" " +
"onload=\"alert('here');\"",
expectedAttributes: {
onclick: "javascript: throw new Error('wont fire');",
onload: "alert('here');"
}
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield runAddAttributesTests(TEST_DATA, "div", inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js
@@ -123,13 +123,13 @@ var TEST_DATA = [{
.textContent;
is(visibleAttrText, collapsed);
},
tearDown: function(inspector) {
Services.prefs.clearUserPref("devtools.markup.collapseAttributeLength");
}
}];
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield runAddAttributesTests(TEST_DATA, "div", inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_08.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_08.js
@@ -8,17 +8,17 @@
// attributes with long values and quotes
const TEST_URL = URL_ROOT + "doc_markup_edit.html";
/*eslint-disable */
const LONG_ATTRIBUTE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const LONG_ATTRIBUTE_COLLAPSED = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEF\u2026UVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/*eslint-enable */
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield inspector.markup.expandAll();
yield testCollapsedLongAttribute(inspector, testActor);
yield testModifyInlineStyleWithQuotes(inspector, testActor);
yield testEditingAttributeWithMixedQuotes(inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_09.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_09.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that editing a mixed-case attribute preserves the case
const TEST_URL = URL_ROOT + "doc_markup_svg_attributes.html";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield inspector.markup.expandAll();
yield selectNode("svg", inspector);
yield testWellformedMixedCase(inspector, testActor);
yield testMalformedMixedCase(inspector, testActor);
});
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_10.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_10.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that invalid tagname updates are handled correctly
const TEST_URL = "data:text/html;charset=utf-8,<div></div>";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
yield inspector.markup.expandAll();
yield selectNode("div", inspector);
info("Updating the DIV tagname to an invalid value");
let container = yield getContainerForSelector("div", inspector);
let onCancelReselect = inspector.markup.once("canceledreselectonremoved");
let tagEditor = container.editor.tag;
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js
@@ -4,17 +4,17 @@
"use strict";
// Bug 1090874 - Tests that a node is not recreated when it's tagname editor
// is blurred and no changes were done.
const TEST_URL = "data:text/html;charset=utf-8,<div></div>";
-add_task(function*() {
+add_task(function* () {
let isEditTagNameCalled = false;
let {inspector} = yield openInspectorForURL(TEST_URL);
// Overriding the editTagName walkerActor method here to check that it isn't
// called when blurring the tagname field.
inspector.walker.editTagName = function() {
isEditTagNameCalled = true;
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_12.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_12.js
@@ -6,17 +6,17 @@
// Tests that focus position is correct when tabbing through and editing
// attributes.
const TEST_URL = "data:text/html;charset=utf8," +
"<div id='attr' a='1' b='2' c='3'></div>" +
"<div id='delattr' tobeinvalid='1' last='2'></div>";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
yield testAttributeEditing(inspector);
yield testAttributeDeletion(inspector);
});
function* testAttributeEditing(inspector) {
info("Testing focus position after attribute editing");
--- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_13-other.js
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_13-other.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that doesn't fit into any specific category.
const TEST_URL = `data:text/html;charset=utf8,
<div a b id='order' c class></div>`;
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
yield testOriginalAttributesOrder(inspector);
yield testOrderAfterAttributeChange(inspector, testActor);
});
function* testOriginalAttributesOrder(inspector) {
info("Testing order of attributes on initial node render");
--- a/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_01.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test editing a node's text content
const TEST_URL = URL_ROOT + "doc_markup_edit.html";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Expanding all nodes");
yield inspector.markup.expandAll();
yield waitForMultipleChildrenUpdates(inspector);
yield editContainer(inspector, testActor, {
selector: ".node6",
--- a/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_02.js
@@ -5,17 +5,17 @@
"use strict";
// Test that using UP/DOWN next to a number when editing a text node does not
// increment or decrement but simply navigates inside the editable field.
const TEST_URL = URL_ROOT + "doc_markup_edit.html";
const SELECTOR = ".node6";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Expanding all nodes");
yield inspector.markup.expandAll();
yield waitForMultipleChildrenUpdates(inspector);
let nodeValue = yield getNodeValue(SELECTOR, testActor);
let expectedValue = "line6";
--- a/devtools/client/inspector/markup/test/browser_markup_toggle_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_toggle_01.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test toggling (expand/collapse) elements by clicking on twisties
const TEST_URL = URL_ROOT + "doc_markup_toggle.html";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Getting the container for the html element");
let container = yield getContainerForSelector("html", inspector);
ok(container.mustExpand, "HTML element mustExpand");
ok(container.canExpand, "HTML element canExpand");
is(container.expander.style.visibility, "hidden", "HTML twisty is hidden");
--- a/devtools/client/inspector/markup/test/browser_markup_toggle_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_toggle_02.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test toggling (expand/collapse) elements by dbl-clicking on tag lines
const TEST_URL = URL_ROOT + "doc_markup_toggle.html";
-add_task(function*() {
+add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Getting the container for the UL parent element");
let container = yield getContainerForSelector("ul", inspector);
info("Dbl-clicking on the UL parent expander, and waiting for children");
let onChildren = waitForChildrenUpdated(inspector);
let onUpdated = inspector.once("inspector-updated");
--- a/devtools/client/inspector/markup/test/browser_markup_toggle_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_toggle_03.js
@@ -4,17 +4,17 @@
"use strict";
// Test toggling (expand/collapse) elements by alt-clicking on twisties, which
// should expand all the descendants
const TEST_URL = URL_ROOT + "doc_markup_toggle.html";
-add_task(function*() {
+add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URL);
info("Getting the container for the UL parent element");
let container = yield getContainerForSelector("ul", inspector);
info("Alt-clicking on the UL parent expander, and waiting for children");
let onUpdated = inspector.once("inspector-updated");
EventUtils.synthesizeMouseAtCenter(container.expander, {altKey: true},
--- a/devtools/client/inspector/markup/test/head.js
+++ b/devtools/client/inspector/markup/test/head.js
@@ -15,17 +15,19 @@ var clipboard = require("sdk/clipboard")
var {ActorRegistryFront} = require("devtools/server/actors/actor-registry");
// If a test times out we want to see the complete log and not just the last few
// lines.
SimpleTest.requestCompleteLog();
// Set the testing flag on DevToolsUtils and reset it when the test ends
DevToolsUtils.testing = true;
-registerCleanupFunction(() => DevToolsUtils.testing = false);
+registerCleanupFunction(() => {
+ DevToolsUtils.testing = false;
+});
// Clear preferences that may be set during the course of tests.
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.inspector.htmlPanelOpen");
Services.prefs.clearUserPref("devtools.inspector.sidebarOpen");
Services.prefs.clearUserPref("devtools.markup.pagesize");
Services.prefs.clearUserPref("dom.webcomponents.enabled");
Services.prefs.clearUserPref("devtools.inspector.showAllAnonymousContent");
@@ -74,17 +76,17 @@ function getContainerForNodeFront(nodeFr
/**
* Get the MarkupContainer object instance that corresponds to the given
* selector
* @param {String|NodeFront} selector
* @param {InspectorPanel} inspector The instance of InspectorPanel currently
* loaded in the toolbox
* @return {MarkupContainer}
*/
-var getContainerForSelector = Task.async(function*(selector, inspector) {
+var getContainerForSelector = Task.async(function* (selector, inspector) {
info("Getting the markup-container for node " + selector);
let nodeFront = yield getNodeFront(selector, inspector);
let container = getContainerForNodeFront(nodeFront, inspector);
info("Found markup-container " + container);
return container;
});
/**
@@ -107,17 +109,17 @@ function waitForChildrenUpdated({markup}
/**
* Simulate a click on the markup-container (a line in the markup-view)
* that corresponds to the selector passed.
* @param {String|NodeFront} selector
* @param {InspectorPanel} inspector The instance of InspectorPanel currently
* loaded in the toolbox
* @return {Promise} Resolves when the node has been selected.
*/
-var clickContainer = Task.async(function*(selector, inspector) {
+var clickContainer = Task.async(function* (selector, inspector) {
info("Clicking on the markup-container for node " + selector);
let nodeFront = yield getNodeFront(selector, inspector);
let container = getContainerForNodeFront(nodeFront, inspector);
let updated = container.selected
? promise.resolve()
: inspector.once("inspector-updated");
@@ -150,17 +152,17 @@ function setEditableFieldValue(field, va
* and enters the given text, then wait for it to be applied and the for the
* node to mutates (when new attribute(s) is(are) created)
* @param {String} selector The selector for the node to edit.
* @param {String} text The new attribute text to be entered (e.g. "id='test'")
* @param {InspectorPanel} inspector The instance of InspectorPanel currently
* loaded in the toolbox
* @return a promise that resolves when the node has mutated
*/
-var addNewAttributes = Task.async(function*(selector, text, inspector) {
+var addNewAttributes = Task.async(function* (selector, text, inspector) {
info(`Entering text "${text}" in new attribute field for node ${selector}`);
let container = yield getContainerForSelector(selector, inspector);
ok(container, "The container for '" + selector + "' was found");
info("Listening for the markupmutation event");
let nodeMutated = inspector.once("markupmutation");
setEditableFieldValue(container.editor.newAttr, text, inspector);
@@ -173,17 +175,17 @@ var addNewAttributes = Task.async(functi
* @param {String} selector The selector for the node to check.
* @param {Object} expected An object containing the attributes to check.
* e.g. {id: "id1", class: "someclass"}
* @param {TestActorFront} testActor The current TestActorFront instance.
*
* Note that node.getAttribute() returns attribute values provided by the HTML
* parser. The parser only provides unescaped entities so & will return &.
*/
-var assertAttributes = Task.async(function*(selector, expected, testActor) {
+var assertAttributes = Task.async(function* (selector, expected, testActor) {
let {attributes: actual} = yield testActor.getNodeInfo(selector);
is(actual.length, Object.keys(expected).length,
"The node " + selector + " has the expected number of attributes.");
for (let attr in expected) {
let foundAttr = actual.find(({name}) => name === attr);
let foundValue = foundAttr ? foundAttr.value : undefined;
ok(foundAttr, "The node " + selector + " has the attribute " + attr);
@@ -272,17 +274,17 @@ function wait(ms) {
* Things like Edit As HTML, Delete Node, etc.
* @param {NodeFront} nodeFront
* @param {InspectorPanel} inspector
* @param {Boolean} assert Should this function run assertions inline.
* @return A promise that resolves with a boolean indicating whether
* the menu items are disabled once the menu has been checked.
*/
var isEditingMenuDisabled = Task.async(
-function*(nodeFront, inspector, assert = true) {
+function* (nodeFront, inspector, assert = true) {
let doc = inspector.panelDoc;
let deleteMenuItem = doc.getElementById("node-menu-delete");
let editHTMLMenuItem = doc.getElementById("node-menu-edithtml");
let pasteHTMLMenuItem = doc.getElementById("node-menu-pasteouterhtml");
// To ensure clipboard contains something to paste.
clipboard.set("<p>test</p>", "html");
@@ -310,17 +312,17 @@ function*(nodeFront, inspector, assert =
* Things like Edit As HTML, Delete Node, etc.
* @param {NodeFront} nodeFront
* @param {InspectorPanel} inspector
* @param {Boolean} assert Should this function run assertions inline.
* @return A promise that resolves with a boolean indicating whether
* the menu items are enabled once the menu has been checked.
*/
var isEditingMenuEnabled = Task.async(
-function*(nodeFront, inspector, assert = true) {
+function* (nodeFront, inspector, assert = true) {
let doc = inspector.panelDoc;
let deleteMenuItem = doc.getElementById("node-menu-delete");
let editHTMLMenuItem = doc.getElementById("node-menu-edithtml");
let pasteHTMLMenuItem = doc.getElementById("node-menu-pasteouterhtml");
// To ensure clipboard contains something to paste.
clipboard.set("<p>test</p>", "html");
@@ -343,17 +345,17 @@ function*(nodeFront, inspector, assert =
!isPasteHTMLMenuDisabled;
});
/**
* Open a menu (closing it first if necessary).
* @param {DOMNode} menu A menu that implements hidePopup/openPopup
* @return a promise that resolves once the menu is opened.
*/
-var reopenMenu = Task.async(function*(menu) {
+var reopenMenu = Task.async(function* (menu) {
// First close it is if it is already opened.
if (menu.state == "closing" || menu.state == "open") {
let popuphidden = once(menu, "popuphidden", true);
menu.hidePopup();
yield popuphidden;
}
// Then open it and return once
@@ -417,17 +419,17 @@ function checkFocusedAttribute(attrName,
* Get attributes for node as how they are represented in editor.
*
* @param {String} selector
* @param {InspectorPanel} inspector
* @return {Promise}
* A promise that resolves with an array of attribute names
* (e.g. ["id", "class", "href"])
*/
-var getAttributesFromEditor = Task.async(function*(selector, inspector) {
+var getAttributesFromEditor = Task.async(function* (selector, inspector) {
let nodeList = (yield getContainerForSelector(selector, inspector))
.tagLine.querySelectorAll("[data-attr]");
return [...nodeList].map(node => node.getAttribute("data-attr"));
});
// The expand all operation of the markup-view calls itself recursively and
// there's not one event we can wait for to know when it's done so use this
@@ -435,16 +437,17 @@ var getAttributesFromEditor = Task.async
function* waitForMultipleChildrenUpdates(inspector) {
// As long as child updates are queued up while we wait for an update already
// wait again
if (inspector.markup._queuedChildUpdates &&
inspector.markup._queuedChildUpdates.size) {
yield waitForChildrenUpdated(inspector);
return yield waitForMultipleChildrenUpdates(inspector);
}
+ return undefined;
}
/**
* Create an HTTP server that can be used to simulate custom requests within
* a test. It is automatically cleaned up when the test ends, so no need to
* call `destroy`.
*
* See https://developer.mozilla.org/en-US/docs/Httpd.js/HTTP_server_for_unit_tests
--- a/devtools/client/inspector/markup/test/helper_attributes_test_runner.js
+++ b/devtools/client/inspector/markup/test/helper_attributes_test_runner.js
@@ -18,17 +18,17 @@
* when the test starts. It will be used to add and remove attributes.
* @param {InspectorPanel} inspector The instance of InspectorPanel currently
* opened
* @param {TestActorFront} testActor The current TestActorFront instance.
* @return a promise that resolves when the tests have run
*/
function runAddAttributesTests(tests, nodeOrSelector, inspector, testActor) {
info("Running " + tests.length + " add-attributes tests");
- return Task.spawn(function*() {
+ return Task.spawn(function* () {
info("Selecting the test node");
yield selectNode("div", inspector);
for (let test of tests) {
yield runAddAttributesTest(test, "div", inspector, testActor);
}
});
}
@@ -91,17 +91,17 @@ function* runAddAttributesTest(test, sel
* @param {Array} tests See runEditAttributesTest for the structure
* @param {InspectorPanel} inspector The instance of InspectorPanel currently
* opened
* @param {TestActorFront} testActor The current TestActorFront instance.
* @return a promise that resolves when the tests have run
*/
function runEditAttributesTests(tests, inspector, testActor) {
info("Running " + tests.length + " edit-attributes tests");
- return Task.spawn(function*() {
+ return Task.spawn(function* () {
info("Expanding all nodes in the markup-view");
yield inspector.markup.expandAll();
for (let test of tests) {
yield runEditAttributesTest(test, inspector, testActor);
}
});
}
--- a/devtools/client/inspector/rules/models/element-style.js
+++ b/devtools/client/inspector/rules/models/element-style.js
@@ -125,16 +125,18 @@ ElementStyle.prototype = {
this._sortRulesForPseudoElement();
// We're done with the previous list of rules.
for (let r of existingRules) {
if (r && r.editor) {
r.editor.destroy();
}
}
+
+ return undefined;
}).then(null, e => {
// populate is often called after a setTimeout,
// the connection may already be closed.
if (this.destroyed) {
return promise.resolve(undefined);
}
return promiseWarn(e);
});
--- a/devtools/client/inspector/rules/rules.js
+++ b/devtools/client/inspector/rules/rules.js
@@ -256,17 +256,17 @@ CssRuleView.prototype = {
/**
* Get an instance of SelectorHighlighter (used to highlight nodes that match
* selectors in the rule-view). A new instance is only created the first time
* this function is called. The same instance will then be returned.
*
* @return {Promise} Resolves to the instance of the highlighter.
*/
- getSelectorHighlighter: Task.async(function*() {
+ getSelectorHighlighter: Task.async(function* () {
let utils = this.inspector.toolbox.highlighterUtils;
if (!utils.supportsCustomHighlighters()) {
return null;
}
if (this.selectorHighlighter) {
return this.selectorHighlighter;
}
@@ -314,32 +314,32 @@ CssRuleView.prototype = {
}, Cu.reportError);
} else {
this.highlightedSelector = null;
this.emit("ruleview-selectorhighlighter-toggled", false);
}
}, Cu.reportError);
},
- highlightSelector: Task.async(function*(selector) {
+ highlightSelector: Task.async(function* (selector) {
let node = this.inspector.selection.nodeFront;
let highlighter = yield this.getSelectorHighlighter();
if (!highlighter) {
return;
}
yield highlighter.show(node, {
hideInfoBar: true,
hideGuides: true,
selector
});
}),
- unhighlightSelector: Task.async(function*() {
+ unhighlightSelector: Task.async(function* () {
let highlighter = yield this.getSelectorHighlighter();
if (!highlighter) {
return;
}
yield highlighter.hide();
}),
@@ -869,16 +869,17 @@ CssRuleView.prototype = {
this._elementStyle = elementStyle;
this._startSelectingElement();
return this.dummyElementPromise.then(() => {
if (this._elementStyle === elementStyle) {
return this._populate();
}
+ return undefined;
}).then(() => {
if (this._elementStyle === elementStyle) {
if (!refresh) {
this.element.scrollTop = 0;
}
this._stopSelectingElement();
this._elementStyle.onChanged = () => {
this._changed();
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-and-reselect.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-and-reselect.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that adding properties to rules work and reselecting the element still
// show them.
const TEST_URI = URL_ROOT + "doc_content_stylesheet.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode("#target", inspector);
info("Setting a font-weight property on all rules");
setPropertyOnAllRules(view);
info("Reselecting the element");
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_01.js
@@ -13,17 +13,17 @@ const TEST_URI = `
}
.testclass {
background-color: green;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let elementRuleEditor = getRuleViewRuleEditor(view, 0);
let editor = yield focusNewRuleViewProperty(elementRuleEditor);
is(inplaceEditor(elementRuleEditor.newPropSpan), editor,
"The new property editor got focused");
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_02.js
@@ -10,17 +10,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: blue;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Test creating a new property and escaping");
yield addProperty(view, 1, "color", "red", "VK_ESCAPE", false);
is(view.styleDocument.documentElement, view.styleDocument.activeElement,
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-cancel_03.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
div {
background-color: blue;
}
</style>
<div>Test node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
// Add a property to the element's style declaration, add some text,
// then press escape.
let elementRuleEditor = getRuleViewRuleEditor(view, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-commented.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-commented.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that commented properties can be added and are disabled.
const TEST_URI = "<div id='testid'></div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testCreateNewSetOfCommentedAndUncommentedProperties(view);
});
function* testCreateNewSetOfCommentedAndUncommentedProperties(view) {
info("Test creating a new set of commented and uncommented properties");
--- a/devtools/client/inspector/rules/test/browser_rules_add-property-svg.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property-svg.js
@@ -4,17 +4,17 @@
"use strict";
// Tests editing SVG styles using the rules view.
var TEST_URL = "chrome://global/skin/icons/warning.svg";
var TEST_SELECTOR = "path";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URL);
let {inspector, view} = yield openRuleView();
yield selectNode(TEST_SELECTOR, inspector);
info("Test creating a new property");
yield addProperty(view, 0, "fill", "red");
is((yield getComputedStyleProperty(TEST_SELECTOR, null, "fill")),
--- a/devtools/client/inspector/rules/test/browser_rules_add-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property_01.js
@@ -13,17 +13,17 @@ const TEST_URI = `
}
.testclass {
background-color: green;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Test creating a new property");
let textProp = yield addProperty(view, 0, "background-color", "#XYZ");
is(textProp.value, "#XYZ", "Text prop should have been changed.");
--- a/devtools/client/inspector/rules/test/browser_rules_add-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-property_02.js
@@ -14,17 +14,17 @@ const TEST_URI = `
.testclass, .unmatched {
background-color: green;
};
</style>
<div id='testid' class='testclass'>Styled Node</div>
<div id='testid2'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
info("Focus the new property name field");
let elementRuleEditor = getRuleViewRuleEditor(view, 0);
let editor = yield focusNewRuleViewProperty(elementRuleEditor);
let input = editor.input;
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_01.js
@@ -27,17 +27,17 @@ const TEST_DATA = [
{ node: ".testclass2", expected: ".testclass2" },
{ node: ".class1.class2", expected: ".class1.class2" },
{ node: ".class3.class4", expected: ".class3.class4" },
{ node: "p", expected: "p" },
{ node: "h1", expected: ".asd\\@\\@\\@\\@a\\!\\!\\!\\!\\:\\:\\:\\@asd" },
{ node: "h2", expected: "#asd\\@\\@\\@a\\!\\!2a" }
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
for (let data of TEST_DATA) {
let {node, expected} = data;
yield selectNode(node, inspector);
yield addNewRule(inspector, view);
yield testNewRule(view, expected, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_02.js
@@ -12,17 +12,17 @@ const TEST_URI = `
#testid {
text-align: center;
}
</style>
<div id="testid">Styled Node</div>
<span>This is a span</span>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield addNewRule(inspector, view);
yield testEditSelector(view, "span");
info("Selecting the modified element with the new rule");
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_03.js
@@ -12,17 +12,17 @@ const TEST_URI = `
#testid {
text-align: center;
}
</style>
<div id="testid">Styled Node</div>
<span>This is a span</span>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield addNewRule(inspector, view);
info("Adding new properties to the new rule");
yield testNewRule(view, "#testid", 1);
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_04.js
@@ -12,17 +12,17 @@ const TEST_URI = `
#pseudo::before {
content: "before";
}
</style>
<div id="pseudo"></div>
<div id="testid">Test Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield testDisabledButton(inspector, view);
});
function* testDisabledButton(inspector, view) {
let node = "#testid";
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_05.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_05.js
@@ -27,17 +27,17 @@ const TEST_DATA = [
{ node: ".testclass2", expected: ".testclass2" },
{ node: ".class1.class2", expected: ".class1.class2" },
{ node: ".class3.class4", expected: ".class3.class4" },
{ node: "p", expected: "p" },
{ node: "h1", expected: ".asd\\@\\@\\@\\@a\\!\\!\\!\\!\\:\\:\\:\\@asd" },
{ node: "h2", expected: "#asd\\@\\@\\@a\\!\\!2a" }
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
for (let data of TEST_DATA) {
let {node, expected} = data;
yield selectNode(node, inspector);
yield addNewRuleFromContextMenu(inspector, view);
yield testNewRule(view, expected, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_pseudo_class.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_pseudo_class.js
@@ -14,17 +14,17 @@ const TEST_DATA = [
[":hover"],
[":hover", ":active"],
[":hover", ":active", ":focus"],
[":active"],
[":active", ":focus"],
[":focus"]
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#element", inspector);
for (let data of TEST_DATA) {
yield runTestData(inspector, view, data);
}
});
--- a/devtools/client/inspector/rules/test/browser_rules_colorUnit.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorUnit.js
@@ -10,17 +10,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
color: blue;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
let TESTS = [
{name: "hex", result: "#0f0"},
{name: "rgb", result: "rgb(0, 255, 0)"}
];
for (let {name, result} of TESTS) {
info("starting test for " + name);
Services.prefs.setCharPref("devtools.defaultColorUnit", name);
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_01.js
@@ -12,17 +12,17 @@ const TEST_URI = `
<style type="text/css">
body {
background: url("chrome://global/skin/icons/warning-64.png"), linear-gradient(white, #F06 400px);
}
</style>
Testing the color picker tooltip!
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
let value = getRuleViewProperty(view, "body", "background").valueSpan;
let swatch = value.querySelectorAll(".ruleview-colorswatch")[0];
let url = value.querySelector(".theme-link");
yield testImageTooltipAfterColorChange(swatch, url, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_02.js
@@ -15,17 +15,17 @@ const TEST_URI = `
body {
background: red url("chrome://global/skin/icons/warning-64.png")
no-repeat center center;
}
</style>
Testing the color picker tooltip!
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
yield testColorChangeIsntRevertedWhenOtherTooltipIsShown(view);
});
function* testColorChangeIsntRevertedWhenOtherTooltipIsShown(ruleView) {
let swatch = getRuleViewProperty(ruleView, "body", "background").valueSpan
.querySelector(".ruleview-colorswatch");
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-appears-on-swatch-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-appears-on-swatch-click.js
@@ -13,17 +13,17 @@ const TEST_URI = `
background-color: #ededed;
background-image: url(chrome://global/skin/icons/warning-64.png);
border: 2em solid rgba(120, 120, 120, .5);
}
</style>
Testing the color picker tooltip!
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
let cSwatch = getRuleViewProperty(view, "body", "color").valueSpan
.querySelector(".ruleview-colorswatch");
let bgSwatch = getRuleViewProperty(view, "body", "background-color").valueSpan
.querySelector(".ruleview-colorswatch");
let bSwatch = getRuleViewProperty(view, "body", "border").valueSpan
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-commit-on-ENTER.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-commit-on-ENTER.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
body {
border: 2em solid rgba(120, 120, 120, .5);
}
</style>
Testing the color picker tooltip!
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
let swatch = getRuleViewProperty(view, "body", "border").valueSpan
.querySelector(".ruleview-colorswatch");
yield testPressingEnterCommitsChanges(swatch, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-edit-gradient.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-edit-gradient.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
body {
background-image: linear-gradient(to left, #f06 25%, #333 95%, #000 100%);
}
</style>
Updating a gradient declaration with the color picker tooltip
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
info("Testing that the colors in gradient properties are parsed correctly");
testColorParsing(view);
info("Testing that changing one of the colors of a gradient property works");
yield testPickingNewColor(view);
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-hides-on-tooltip.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-hides-on-tooltip.js
@@ -13,17 +13,17 @@ const TEST_URI = `
background-color: #ededed;
background-image: url(chrome://global/skin/icons/warning-64.png);
border: 2em solid rgba(120, 120, 120, .5);
}
</style>
Testing the color picker tooltip!
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
let swatch = getRuleViewProperty(view, "body", "color").valueSpan
.querySelector(".ruleview-colorswatch");
let bgImageSpan = getRuleViewProperty(view, "body", "background-image")
.valueSpan;
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-multiple-changes.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-multiple-changes.js
@@ -20,17 +20,17 @@ const TEST_URI = `
}
p {
color: blue;
}
</style>
<p>Testing the color picker tooltip!</p>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield testSimpleMultipleColorChanges(inspector, view);
yield testComplexMultipleColorChanges(inspector, view);
yield testOverriddenMultipleColorChanges(inspector, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-release-outside-frame.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-release-outside-frame.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that color pickers stops following the pointer if the pointer is
// released outside the tooltip frame (bug 1160720).
const TEST_URI = "<body style='color: red'>Test page for bug 1160720";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
let cSwatch = getRuleViewProperty(view, "element", "color").valueSpan
.querySelector(".ruleview-colorswatch");
let picker = yield openColorPickerForSwatch(cSwatch, view);
let spectrum = yield picker.spectrum;
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-revert-on-ESC.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-revert-on-ESC.js
@@ -10,17 +10,17 @@
const TEST_URI = `
<style type="text/css">
body {
background-color: #EDEDED;
}
</style>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
yield testPressingEscapeRevertsChanges(view);
yield testPressingEscapeRevertsChangesAndDisables(view);
});
function* testPressingEscapeRevertsChanges(view) {
let {swatch, propEditor, cPicker} = yield openColorPickerAndSelectColor(view,
--- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-swatch-displayed.js
+++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-swatch-displayed.js
@@ -32,17 +32,17 @@ const TEST_URI = `
const TESTS = [
{selector: "body", propertyName: "color", nb: 1},
{selector: "body", propertyName: "background-color", nb: 1},
{selector: "body", propertyName: "border", nb: 1},
{selector: "*", propertyName: "color", nb: 1},
{selector: "*", propertyName: "box-shadow", nb: 2},
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
for (let {selector, propertyName, nb} of TESTS) {
info("Looking for color swatches in property " + propertyName +
" in selector " + selector);
let prop = getRuleViewProperty(view, selector, propertyName).valueSpan;
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
@@ -50,17 +50,17 @@ var testData = [
["VK_LEFT", "filter", -1, 0],
["VK_LEFT", "filter", -1, 0],
["i", "fiilter", -1, 0],
["VK_ESCAPE", null, -1, 0],
];
const TEST_URI = "<h1 style='font: 24px serif'>Header</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view, testActor} = yield openRuleView();
info("Test autocompletion after 1st page load");
yield runAutocompletionTest(toolbox, inspector, view);
info("Test autocompletion after page navigation");
yield reloadPage(inspector, testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
@@ -32,17 +32,17 @@ var testData = [
["d", {}, "display", 1, 3, false],
["VK_TAB", {}, "blue", -1, 0, true],
["n", {}, "none", -1, 0, true],
["VK_RETURN", {}, null, -1, 0, true]
];
const TEST_URI = "<h1 style='color: red'>Header</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view, testActor} = yield openRuleView();
info("Test autocompletion after 1st page load");
yield runAutocompletionTest(toolbox, inspector, view);
info("Test autocompletion after page navigation");
yield reloadPage(inspector, testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
@@ -33,17 +33,17 @@ var testData = [
["VK_BACK_SPACE", "", -1, 0],
["f", "filter", 3, MAX_ENTRIES],
["i", "filter", 3, 4],
["VK_ESCAPE", null, -1, 0],
];
const TEST_URI = "<h1 style='border: 1px solid red'>Header</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view, testActor} = yield openRuleView();
info("Test autocompletion after 1st page load");
yield runAutocompletionTest(toolbox, inspector, view);
info("Test autocompletion after page navigation");
yield reloadPage(inspector, testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
@@ -43,17 +43,17 @@ const TEST_URI = `
<style type="text/css">
h1 {
border: 1px solid red;
}
</style>
<h1>Test element</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view, testActor} = yield openRuleView();
info("Test autocompletion after 1st page load");
yield runAutocompletionTest(toolbox, inspector, view);
info("Test autocompletion after page navigation");
yield reloadPage(inspector, testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_03.js
@@ -4,17 +4,17 @@
"use strict";
// Regression test for a case where completing gave the wrong answer.
// See bug 1179318.
const TEST_URI = "<h1 style='color: red'>Header</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view} = yield openRuleView();
info("Test autocompletion for background-color");
yield runAutocompletionTest(toolbox, inspector, view);
});
function* runAutocompletionTest(toolbox, inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_04.js
@@ -8,17 +8,17 @@
// - type first character of property name
// - select an autocomplete suggestion !!with a mouse click!!
// - press RETURN to move to the property value
// - blur the input to commit
const TEST_URI = "<style>.title {color: red;}</style>" +
"<h1 class=title>Header</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let { inspector, view} = yield openRuleView();
info("Selecting the test node");
yield selectNode("h1", inspector);
info("Focusing the new property editable field");
let ruleEditor = getRuleViewRuleEditor(view, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_multiline.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_multiline.js
@@ -22,17 +22,17 @@ const EXPECTED_CSS_VALUE = LONG_CSS_VALU
const TEST_URI =
`<style>
.title {
background: ${LONG_CSS_VALUE};
}
</style>
<h1 class=title>Header</h1>`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let { inspector, view} = yield openRuleView();
info("Selecting the test node");
yield selectNode("h1", inspector);
info("Focusing the property editable field");
let rule = getRuleViewRuleEditor(view, 1).rule;
--- a/devtools/client/inspector/rules/test/browser_rules_completion-popup-hidden-after-navigation.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-popup-hidden-after-navigation.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that the ruleview autocomplete popup is hidden after page navigation.
const TEST_URI = "<h1 style='font: 24px serif'></h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
info("Test autocompletion popup is hidden after page navigation");
info("Selecting the test node");
yield selectNode("h1", inspector);
--- a/devtools/client/inspector/rules/test/browser_rules_computed-lists_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_computed-lists_01.js
@@ -11,17 +11,17 @@ var TEST_URI = `
#testid {
margin: 4px;
top: 0px;
}
</style>
<h1 id="testid">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testExpandersShown(inspector, view);
});
function* testExpandersShown(inspector, view) {
let rule = getRuleViewRuleEditor(view, 1).rule;
--- a/devtools/client/inspector/rules/test/browser_rules_computed-lists_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_computed-lists_02.js
@@ -12,17 +12,17 @@ var TEST_URI = `
#testid {
margin: 0px 1px 2px 3px;
top: 0px;
}
</style>
<h1 id="testid">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testComputedList(inspector, view);
});
function* testComputedList(inspector, view) {
let rule = getRuleViewRuleEditor(view, 1).rule;
--- a/devtools/client/inspector/rules/test/browser_rules_content_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_content_01.js
@@ -16,17 +16,17 @@ const TEST_URI = `
.testclass, .unmatched {
background-color: green;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
<div id="testid2">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
is(view.element.querySelectorAll("#noResults").length, 0,
"After a highlight, no longer has a no-results element.");
yield clearCurrentNodeSelection(inspector);
--- a/devtools/client/inspector/rules/test/browser_rules_content_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_content_02.js
@@ -15,17 +15,17 @@ const CONTENT = `
</p>
</div>
</body>
`;
const STRINGS = Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
-add_task(function*() {
+add_task(function* () {
let tab = yield addTab("data:text/html;charset=utf-8," + CONTENT);
let testActor = yield getTestActorWithoutToolbox(tab);
let inspector = yield clickOnInspectMenuItem(testActor, "span");
checkRuleViewContent(inspector.ruleview.view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_copy_styles.js
+++ b/devtools/client/inspector/rules/test/browser_rules_copy_styles.js
@@ -10,17 +10,17 @@
*/
XPCOMUtils.defineLazyGetter(this, "osString", function() {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
});
const TEST_URI = URL_ROOT + "doc_copystyles.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let { inspector, view } = yield openRuleView();
let contextmenu = view._contextmenu;
yield selectNode("#testid", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 1);
let data = [
@@ -139,17 +139,17 @@ add_task(function*() {
copyPropertyDeclaration: true,
copyPropertyName: true,
copyPropertyValue: true,
copySelector: true,
copyRule: false
}
},
{
- setup: function*() {
+ setup: function* () {
yield disableProperty(view, 0);
},
desc: "Test Copy Rule with Disabled Property",
node: ruleEditor.rule.textProps[2].editor.nameSpan,
menuItem: contextmenu.menuitemCopyRule,
expectedPattern: "#testid {[\\r\\n]+" +
"\t\/\\* color: #F00; \\*\/[\\r\\n]+" +
"\tbackground-color: #00F;[\\r\\n]+" +
@@ -162,17 +162,17 @@ add_task(function*() {
copyPropertyDeclaration: false,
copyPropertyName: false,
copyPropertyValue: true,
copySelector: true,
copyRule: false
}
},
{
- setup: function*() {
+ setup: function* () {
yield disableProperty(view, 4);
},
desc: "Test Copy Rule with Disabled Property with Comment",
node: ruleEditor.rule.textProps[2].editor.nameSpan,
menuItem: contextmenu.menuitemCopyRule,
expectedPattern: "#testid {[\\r\\n]+" +
"\t\/\\* color: #F00; \\*\/[\\r\\n]+" +
"\tbackground-color: #00F;[\\r\\n]+" +
--- a/devtools/client/inspector/rules/test/browser_rules_cssom.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cssom.js
@@ -4,17 +4,17 @@
"use strict";
// Test to ensure that CSSOM doesn't make the rule view blow up.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1224121
const TEST_URI = URL_ROOT + "doc_cssom.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode("#target", inspector);
let elementStyle = view._elementStyle;
let rule = elementStyle.rules[1];
is(rule.textProps.length, 1, "rule should have one property");
--- a/devtools/client/inspector/rules/test/browser_rules_cubicbezier-appears-on-swatch-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cubicbezier-appears-on-swatch-click.js
@@ -16,17 +16,17 @@ const TEST_URI = `
.test {
animation-timing-function: ease-in-out;
transition-timing-function: ease-out;
}
</style>
<div class="test">Testing the cubic-bezier tooltip!</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let swatches = [];
swatches.push(
getRuleViewProperty(view, "div", "animation").valueSpan
.querySelector(".ruleview-bezierswatch")
--- a/devtools/client/inspector/rules/test/browser_rules_cubicbezier-commit-on-ENTER.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cubicbezier-commit-on-ENTER.js
@@ -10,17 +10,17 @@
const TEST_URI = `
<style type="text/css">
body {
transition: top 2s linear;
}
</style>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
info("Getting the bezier swatch element");
let swatch = getRuleViewProperty(view, "body", "transition").valueSpan
.querySelector(".ruleview-bezierswatch");
yield testPressingEnterCommitsChanges(swatch, view);
@@ -34,17 +34,17 @@ function* testPressingEnterCommitsChange
swatch.click();
yield onShown;
let widget = yield bezierTooltip.widget;
info("Simulating a change of curve in the widget");
widget.coordinates = [0.1, 2, 0.9, -1];
let expected = "cubic-bezier(0.1, 2, 0.9, -1)";
- yield waitForSuccess(function*() {
+ yield waitForSuccess(function* () {
let func = yield getComputedStyleProperty("body", null,
"transition-timing-function");
return func === expected;
}, "Waiting for the change to be previewed on the element");
ok(getRuleViewProperty(ruleView, "body", "transition").valueSpan.textContent
.indexOf("cubic-bezier(") !== -1,
"The text of the timing-function was updated");
--- a/devtools/client/inspector/rules/test/browser_rules_cubicbezier-revert-on-ESC.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cubicbezier-revert-on-ESC.js
@@ -10,17 +10,17 @@
const TEST_URI = `
<style type='text/css'>
body {
animation-timing-function: linear;
}
</style>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
yield testPressingEscapeRevertsChanges(view);
yield testPressingEscapeRevertsChangesAndDisables(view);
});
function* testPressingEscapeRevertsChanges(view) {
let {propEditor} = yield openCubicBezierAndChangeCoords(view, 1, 0,
--- a/devtools/client/inspector/rules/test/browser_rules_custom.js
+++ b/devtools/client/inspector/rules/test/browser_rules_custom.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI = URL_ROOT + "doc_custom.html";
// Tests the display of custom declarations in the rule-view.
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield simpleCustomOverride(inspector, view);
yield importantCustomOverride(inspector, view);
yield disableCustomOverride(inspector, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_cycle-angle.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cycle-angle.js
@@ -13,17 +13,17 @@ const TEST_URI = `
}
div {
image-orientation: 180deg;
}
</style>
<body><div>Test</div>cycling angle units in the rule view!</body>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
let container = getRuleViewProperty(
view, "body", "image-orientation").valueSpan;
yield checkAngleCycling(container, view);
yield checkAngleCyclingPersist(inspector, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_cycle-color.js
+++ b/devtools/client/inspector/rules/test/browser_rules_cycle-color.js
@@ -13,17 +13,17 @@ const TEST_URI = `
}
span {
color: blue;
}
</style>
<body><span>Test</span> cycling color types in the rule view!</body>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
let container = getRuleViewProperty(view, "body", "color").valueSpan;
yield checkColorCycling(container, view);
yield checkColorCyclingPersist(inspector, view);
});
function* checkColorCycling(container, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-cancel.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-cancel.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: #00F;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 1);
let propEditor = ruleEditor.rule.textProps[0].editor;
yield focusEditableField(view, propEditor.nameSpan);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-click.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
margin: 0;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testEditPropertyAndCancel(inspector, view);
});
function* testEditPropertyAndCancel(inspector, view) {
let ruleEditor = getRuleViewRuleEditor(view, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-commit.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-commit.js
@@ -44,17 +44,17 @@ const testData = [
},
{
value: "blue",
commitKey: "VK_TAB", modifiers: {shiftKey: true},
expected: "blue"
}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
for (let data of testData) {
yield runTestData(view, data);
}
});
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-computed.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-computed.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
#testid {
padding: 10px;
}
</style>
<div id="testid">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield editAndCheck(view);
});
function* editAndCheck(view) {
let idRuleEditor = getRuleViewRuleEditor(view, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js
@@ -17,17 +17,17 @@ const TEST_URI = `
background: none;
transition: initial;
z-index: 0;
}
</style>
<div id="test"></div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#test", inspector);
yield testMarginIncrements(view);
yield testVariousUnitIncrements(view);
yield testHexIncrements(view);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-order.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-order.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Checking properties orders and overrides in the rule-view.
const TEST_URI = "<style>#testid {}</style><div id='testid'>Styled Node</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let elementStyle = view._elementStyle;
let elementRule = elementStyle.rules[1];
info("Checking rules insertion order and checking the applied style");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_01.js
@@ -13,17 +13,17 @@ const TEST_URI = `
#testid {
background-color: #00F;
color: #00F;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Getting the first property in the #testid rule");
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_02.js
@@ -13,17 +13,17 @@ const TEST_URI = `
#testid {
background-color: #00F;
color: #00F;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Getting the first property in the rule");
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-remove_03.js
@@ -13,17 +13,17 @@ const TEST_URI = `
#testid {
background-color: #00F;
color: #00F;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Getting the second property in the rule");
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[1];
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_01.js
@@ -26,17 +26,17 @@ const TEST_URI = `
var BACKGROUND_IMAGE_URL = 'url("' + URL_ROOT + 'doc_test_image.png")';
var TEST_DATA = [
{ name: "border-color", value: "red", isValid: true },
{ name: "background-image", value: BACKGROUND_IMAGE_URL, isValid: true },
{ name: "border", value: "solid 1px foo", isValid: false },
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
for (let {name, value, isValid} of TEST_DATA) {
yield testEditProperty(view, rule, name, value, isValid);
}
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_02.js
@@ -14,17 +14,17 @@ const TEST_URI = `
.testclass, .unmatched {
background-color: green;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
<div id="testid2">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testEditProperty(inspector, view);
yield testDisableProperty(inspector, view);
yield testPropertyStillMarkedDirty(inspector, view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_03.js
@@ -17,17 +17,17 @@ const TEST_URI = `
.testclass, .unmatched {
background-color: green;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
<div id="testid2">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 1);
let propEditor = ruleEditor.rule.textProps[1].editor;
yield focusEditableField(view, propEditor.valueSpan);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_04.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: blue;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
info("Disabling a property");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_05.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_05.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: blue;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
info("Disabling background-color property");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_06.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_06.js
@@ -13,17 +13,17 @@ const TEST_URI = `
background-color: green !important;
}
body {
background-color: red;
}
</style>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("body", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
is((yield getComputedStyleProperty("body", null, "background-color")),
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_07.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_07.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: #f00;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
let prop = rule.textProps[0];
info("Disabling red background color property");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_08.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_08.js
@@ -10,17 +10,17 @@ const TEST_URI = `
<style type="text/css">
#testid {
color: #FFF;
}
</style>
<div style='color: red' id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Get the color property editor");
let ruleEditor = getRuleViewRuleEditor(view, 0);
let propEditor = ruleEditor.rule.textProps[0].editor;
is(ruleEditor.rule.textProps[0].name, "color");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property_09.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_09.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: blue;
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testClickOnEmptyAreaToCloseEditor(inspector, view);
});
function synthesizeMouseOnEmptyArea(ruleEditor, view) {
// any text property editor will do
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector-click-on-scrollbar.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector-click-on-scrollbar.js
@@ -29,17 +29,17 @@ const TEST_URI = `
}
.f {
color: #fff;
}
</style>
<div class="testclass a b c d e f">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
info("Toolbox height should be small enough to force scrollbars to appear");
yield new Promise(done => {
let options = {"set": [
["devtools.toolbox.footer.height", 200],
]};
SpecialPowers.pushPrefEnv(options, done);
});
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector-click.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
.testclass {
text-align: center;
}
</style>
<div class="testclass">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".testclass", inspector);
yield testClickOnSelectorEditorInput(view);
});
function* testClickOnSelectorEditorInput(view) {
info("Test clicking inside the selector editor input");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector-commit.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector-commit.js
@@ -50,17 +50,17 @@ const TEST_DATA = [
node: "#testid3",
value: ".testclass3",
commitKey: "VK_TAB",
modifiers: {shiftKey: true},
expected: ".testclass3"
}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let { inspector, view } = yield openRuleView();
for (let data of TEST_DATA) {
yield runTestData(inspector, view, data);
}
});
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_01.js
@@ -11,17 +11,17 @@ const TEST_URI = `
.testclass {
text-align: center;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
<span>This is a span</span>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
info("Selecting the test element");
yield selectNode("#testid", inspector);
yield testEditSelector(view, "span");
info("Selecting the modified element with the new rule");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_02.js
@@ -19,17 +19,17 @@ const TEST_URI = `
<div id="testid">Styled Node</div>
<span class="testclass">This is a span</span>
<div class="testclass2">A</div>
<div id="testid3">B</div>
`;
const PSEUDO_PREF = "devtools.inspector.show_pseudo_elements";
-add_task(function*() {
+add_task(function* () {
// Expand the pseudo-elements section by default.
Services.prefs.setBoolPref(PSEUDO_PREF, true);
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
info("Selecting the test element");
yield selectNode(".testclass", inspector);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_03.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
.testclass {
text-align: center;
}
</style>
<div class="testclass">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".testclass", inspector);
yield testEditSelector(view, "asd@:::!");
});
function* testEditSelector(view, name) {
info("Test editing existing selector fields");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_04.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
p {
background: red;
}
</style>
<p>Test the selector highlighter</p>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("p", inspector);
ok(!view.selectorHighlighter,
"No selectorhighlighter exist in the rule-view");
yield testSelectorHighlight(view, "p");
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_05.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_05.js
@@ -13,17 +13,17 @@ const TEST_URI = `
.testclass {
background-color: white;
}
</style>
<div id="testid">Styled Node</div>
<span class="testclass">This is a span</span>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
info("Selecting the test element");
yield selectNode("#testid", inspector);
yield testEditSelector(view, "span");
yield testAddProperty(view);
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_06.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_06.js
@@ -13,17 +13,17 @@ const TEST_URI = `
text-align: center;
}
div {
}
</style>
<div class="testclass">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".testclass", inspector);
yield testEditClassSelector(view);
yield testEditDivSelector(view);
});
function* testEditClassSelector(view) {
--- a/devtools/client/inspector/rules/test/browser_rules_edit-selector_07.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-selector_07.js
@@ -17,17 +17,17 @@ const TEST_URI = `
.testclass {
height: 10px;
}
</style>
<div id="testid">Styled Node</div>
<span class="testclass">This is a span</span>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testEditSelector(view, "span");
});
function* testEditSelector(view, name) {
--- a/devtools/client/inspector/rules/test/browser_rules_editable-field-focus_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_editable-field-focus_01.js
@@ -17,17 +17,17 @@ const TEST_URI = `
}
div {
border-color: red
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testEditableFieldFocus(inspector, view, "VK_RETURN");
yield testEditableFieldFocus(inspector, view, "VK_TAB");
});
function* testEditableFieldFocus(inspector, view, commitKey) {
--- a/devtools/client/inspector/rules/test/browser_rules_editable-field-focus_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_editable-field-focus_02.js
@@ -17,17 +17,17 @@ const TEST_URI = `
}
div {
border-color: red
}
</style>
<div id='testid'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testEditableFieldFocus(inspector, view, "VK_TAB", { shiftKey: true });
});
function* testEditableFieldFocus(inspector, view, commitKey, options = {}) {
let ruleEditor = getRuleViewRuleEditor(view, 2);
--- a/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
+++ b/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
@@ -41,17 +41,17 @@ const TEST_URI = `
// #f09
const ORIGINAL_COLOR = "rgb(255, 0, 153)";
// #ff5
const EXPECTED_COLOR = "rgb(255, 255, 85)";
// Test opening the eyedropper from the color picker. Pressing escape
// to close it, and clicking the page to select a color.
-add_task(function*() {
+add_task(function* () {
// clear telemetry so we can get accurate counts
clearTelemetry();
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#div2", inspector);
let property = getRuleViewProperty(view, "#div2", "background-color");
--- a/devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests the that Filter Editor Tooltip opens by clicking on filter swatches
const TEST_URL = URL_ROOT + "doc_filter.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URL);
let {view} = yield openRuleView();
info("Getting the filter swatch element");
let swatch = getRuleViewProperty(view, "body", "filter").valueSpan
.querySelector(".ruleview-filterswatch");
--- a/devtools/client/inspector/rules/test/browser_rules_filtereditor-commit-on-ENTER.js
+++ b/devtools/client/inspector/rules/test/browser_rules_filtereditor-commit-on-ENTER.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests the Filter Editor Tooltip committing changes on ENTER
const TEST_URL = URL_ROOT + "doc_filter.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URL);
let {view} = yield openRuleView();
info("Get the filter swatch element");
let swatch = getRuleViewProperty(view, "body", "filter").valueSpan
.querySelector(".ruleview-filterswatch");
info("Click on the filter swatch element");
--- a/devtools/client/inspector/rules/test/browser_rules_filtereditor-revert-on-ESC.js
+++ b/devtools/client/inspector/rules/test/browser_rules_filtereditor-revert-on-ESC.js
@@ -3,17 +3,17 @@
"use strict";
// Tests that changes made to the Filter Editor Tooltip are reverted when
// ESC is pressed
const TEST_URL = URL_ROOT + "doc_filter.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URL);
let {view} = yield openRuleView();
yield testPressingEscapeRevertsChanges(view);
yield testPressingEscapeRevertsChangesAndDisables(view);
});
function* testPressingEscapeRevertsChanges(view) {
let ruleEditor = getRuleViewRuleEditor(view, 1);
--- a/devtools/client/inspector/rules/test/browser_rules_guessIndentation.js
+++ b/devtools/client/inspector/rules/test/browser_rules_guessIndentation.js
@@ -25,17 +25,17 @@ div {
background-color: blue;
}
* {
color: chartreuse;
}
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Add a new property in the rule-view");
yield addProperty(view, 2, "color", "chartreuse");
info("Switch to the style-editor");
--- a/devtools/client/inspector/rules/test/browser_rules_inherited-properties_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_inherited-properties_01.js
@@ -12,17 +12,17 @@ const TEST_URI = `
#test2 {
background-color: green;
color: purple;
}
</style>
<div id="test2"><div id="test1">Styled Node</div></div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#test1", inspector);
yield simpleInherit(inspector, view);
});
function* simpleInherit(inspector, view) {
let elementStyle = view._elementStyle;
--- a/devtools/client/inspector/rules/test/browser_rules_inherited-properties_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_inherited-properties_02.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
#test2 {
background-color: green;
}
</style>
<div id="test2"><div id="test1">Styled Node</div></div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#test1", inspector);
yield emptyInherit(inspector, view);
});
function* emptyInherit(inspector, view) {
// No inheritable styles, this rule shouldn't show up.
--- a/devtools/client/inspector/rules/test/browser_rules_inherited-properties_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_inherited-properties_03.js
@@ -9,17 +9,17 @@
var {ELEMENT_STYLE} = require("devtools/server/actors/styles");
const TEST_URI = `
<div id="test2" style="color: red">
<div id="test1">Styled Node</div>
</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#test1", inspector);
yield elementStyleInherit(inspector, view);
});
function* elementStyleInherit(inspector, view) {
let elementStyle = view._elementStyle;
--- a/devtools/client/inspector/rules/test/browser_rules_inline-source-map.js
+++ b/devtools/client/inspector/rules/test/browser_rules_inline-source-map.js
@@ -6,17 +6,17 @@
// Test that when a source map comment appears in an inline stylesheet, the
// rule-view still appears correctly.
// Bug 1255787.
const TESTCASE_URI = URL_ROOT + "doc_inline_sourcemap.html";
const PREF = "devtools.styleeditor.source-maps-enabled";
-add_task(function*() {
+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");
--- a/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
+++ b/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
@@ -6,17 +6,17 @@
// 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*() {
+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");
--- a/devtools/client/inspector/rules/test/browser_rules_keybindings.js
+++ b/devtools/client/inspector/rules/test/browser_rules_keybindings.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that focus doesn't leave the style editor when adding a property
// (bug 719916)
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8,<h1>Some header text</h1>");
let {inspector, view} = yield openRuleView();
yield selectNode("h1", inspector);
info("Getting the ruleclose brace element");
let brace = view.styleDocument.querySelector(".ruleview-ruleclose");
info("Focus the new property editable field to create a color property");
--- a/devtools/client/inspector/rules/test/browser_rules_keyframeLineNumbers.js
+++ b/devtools/client/inspector/rules/test/browser_rules_keyframeLineNumbers.js
@@ -4,17 +4,17 @@
"use strict";
// Test that editing a rule will update the line numbers of subsequent
// rules in the rule view.
const TESTCASE_URI = URL_ROOT + "doc_keyframeLineNumbers.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
yield selectNode("#outer", inspector);
info("Insert a new property, which will affect the line numbers");
yield addProperty(view, 1, "font-size", "72px");
yield selectNode("#inner", inspector);
--- a/devtools/client/inspector/rules/test/browser_rules_keyframes-rule_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_keyframes-rule_01.js
@@ -4,17 +4,17 @@
"use strict";
// Test that keyframe rules and gutters are displayed correctly in the
// rule view.
const TEST_URI = URL_ROOT + "doc_keyframeanimation.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield testPacman(inspector, view);
yield testBoxy(inspector, view);
yield testMoxy(inspector, view);
});
function* testPacman(inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_keyframes-rule_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_keyframes-rule_02.js
@@ -4,17 +4,17 @@
"use strict";
// Test that verifies the content of the keyframes rule and property changes
// to keyframe rules.
const TEST_URI = URL_ROOT + "doc_keyframeanimation.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield testPacman(inspector, view);
yield testBoxy(inspector, view);
});
function* testPacman(inspector, view) {
info("Test content in the keyframes rule of #pacman");
--- a/devtools/client/inspector/rules/test/browser_rules_lineNumbers.js
+++ b/devtools/client/inspector/rules/test/browser_rules_lineNumbers.js
@@ -4,17 +4,17 @@
"use strict";
// Test that editing a rule will update the line numbers of subsequent
// rules in the rule view.
const TESTCASE_URI = URL_ROOT + "doc_ruleLineNumbers.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
yield selectNode("#testid", inspector);
let bodyRuleEditor = getRuleViewRuleEditor(view, 3);
let value = getRuleViewLinkTextByIndex(view, 2);
// Note that this is relative to the <style>.
is(value.slice(-2), ":6", "initial rule line number is 6");
--- a/devtools/client/inspector/rules/test/browser_rules_livepreview.js
+++ b/devtools/client/inspector/rules/test/browser_rules_livepreview.js
@@ -26,17 +26,17 @@ const TEST_DATA = [
// Invalid property values should not apply, and should fall back to default
{value: "red", expected: "block"},
{value: "something", expected: "block"},
{escape: true, value: "inline", expected: "block"}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
for (let data of TEST_DATA) {
yield testLivePreviewData(data, view, "#testid");
}
});
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_01.js
@@ -14,17 +14,17 @@ const TEST_URI = `
}
.testclass {
background-color: green;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let idRule = getRuleViewRuleEditor(view, 1).rule;
let idProp = idRule.textProps[0];
is(idProp.name, "background-color",
"First ID property should be background-color");
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_02.js
@@ -14,17 +14,17 @@ const TEST_URI = `
}
.testclass {
margin: 2px;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testMarkOverridden(inspector, view);
});
function* testMarkOverridden(inspector, view) {
let elementStyle = view._elementStyle;
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_03.js
@@ -14,17 +14,17 @@ const TEST_URI = `
}
.testclass {
background-color: green !important;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let idRule = getRuleViewRuleEditor(view, 1).rule;
let idProp = idRule.textProps[0];
ok(idProp.overridden, "Not-important rule should be overridden.");
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_04.js
@@ -14,17 +14,17 @@ const TEST_URI = `
}
.testclass {
background-color: green;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let idRule = getRuleViewRuleEditor(view, 1).rule;
let idProp = idRule.textProps[0];
yield togglePropStatus(view, idProp);
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_05.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_05.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type='text/css'>
#testid {
background-color: green;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let rule = getRuleViewRuleEditor(view, 1).rule;
yield addProperty(view, 1, "background-color", "red");
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_06.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_06.js
@@ -12,17 +12,17 @@ const TEST_URI = `
div {
background-color: blue;
background-color: chartreuse;
}
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testMarkOverridden(inspector, view);
});
function* testMarkOverridden(inspector, view) {
let elementStyle = view._elementStyle;
--- a/devtools/client/inspector/rules/test/browser_rules_mark_overridden_07.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mark_overridden_07.js
@@ -29,17 +29,17 @@ const TEST_URI = `
</style>
<body>
<span>
<div id='testid' class='testclass'>Styled Node</div>
</span>
</body>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testMarkOverridden(inspector, view);
});
function* testMarkOverridden(inspector, view) {
let elementStyle = view._elementStyle;
--- a/devtools/client/inspector/rules/test/browser_rules_mathml-element.js
+++ b/devtools/client/inspector/rules/test/browser_rules_mathml-element.js
@@ -19,17 +19,17 @@ const TEST_URI = `
<mi>x</mi>
<mn>0</mn>
</msub>
</mfrac>
</math>
</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
info("Select the DIV node and verify the rule-view shows rules");
yield selectNode("div", inspector);
ok(view.element.querySelectorAll(".ruleview-rule").length,
"The rule-view shows rules for the div element");
--- a/devtools/client/inspector/rules/test/browser_rules_media-queries.js
+++ b/devtools/client/inspector/rules/test/browser_rules_media-queries.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that we correctly display appropriate media query titles in the
// rule view.
const TEST_URI = URL_ROOT + "doc_media_queries.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let elementStyle = view._elementStyle;
let _strings = Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
--- a/devtools/client/inspector/rules/test/browser_rules_multiple-properties-duplicates.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple-properties-duplicates.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 0);
// Note that we wait for a markup mutation here because this new rule will end
// up creating a style attribute on the node shown in the markup-view.
// (we also wait for the rule-view to refresh).
--- a/devtools/client/inspector/rules/test/browser_rules_multiple-properties-priority.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple-properties-priority.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors.
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 0);
// Note that we wait for a markup mutation here because this new rule will end
// up creating a style attribute on the node shown in the markup-view.
// (we also wait for the rule-view to refresh).
--- a/devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_01.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering multiple and/or
// unfinished properties/values in inplace-editors
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
yield testCreateNewMultiUnfinished(inspector, view);
});
function* testCreateNewMultiUnfinished(inspector, view) {
let ruleEditor = getRuleViewRuleEditor(view, 0);
--- a/devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_02.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 0);
// Note that we wait for a markup mutation here because this new rule will end
// up creating a style attribute on the node shown in the markup-view.
// (we also wait for the rule-view to refresh).
--- a/devtools/client/inspector/rules/test/browser_rules_multiple_properties_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple_properties_01.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors.
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 0);
// Note that we wait for a markup mutation here because this new rule will end
// up creating a style attribute on the node shown in the markup-view.
// (we also wait for the rule-view to refresh).
--- a/devtools/client/inspector/rules/test/browser_rules_multiple_properties_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_multiple_properties_02.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
const TEST_URI = "<div>Test Element</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 0);
// Expect 2 ruleview-changed events.
// - one when focusing the property-name editor
// - one after pressing RETURN, which will focus the property-value editor
--- a/devtools/client/inspector/rules/test/browser_rules_original-source-link.js
+++ b/devtools/client/inspector/rules/test/browser_rules_original-source-link.js
@@ -7,17 +7,17 @@
// Test that the stylesheet links in the rule view are correct when source maps
// are involved.
const TESTCASE_URI = URL_ROOT + "doc_sourcemaps.html";
const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
-add_task(function*() {
+add_task(function* () {
info("Setting the " + PREF + " pref to true");
Services.prefs.setBoolPref(PREF, true);
yield addTab(TESTCASE_URI);
let {toolbox, inspector, view} = yield openRuleView();
info("Selecting the test node");
yield selectNode("div", inspector);
@@ -73,12 +73,12 @@ function editorSelected(editor) {
let {line} = editor.sourceEditor.getCursor();
is(line, 3, "cursor is at correct line number in original source");
}
function verifyLinkText(text, view) {
info("Verifying that the rule-view stylesheet link is " + text);
let label = getRuleViewLinkByIndex(view, 1).querySelector("label");
- return waitForSuccess(function*() {
+ return waitForSuccess(function* () {
return label.getAttribute("value") == text;
}, "Link text changed to display correct location: " + text);
}
--- a/devtools/client/inspector/rules/test/browser_rules_pseudo-element_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_pseudo-element_01.js
@@ -4,17 +4,17 @@
"use strict";
// Test that pseudoelements are displayed correctly in the rule view
const TEST_URI = URL_ROOT + "doc_pseudoelement.html";
const PSEUDO_PREF = "devtools.inspector.show_pseudo_elements";
-add_task(function*() {
+add_task(function* () {
Services.prefs.setBoolPref(PSEUDO_PREF, true);
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield testTopLeft(inspector, view);
yield testTopRight(inspector, view);
yield testBottomRight(inspector, view);
--- a/devtools/client/inspector/rules/test/browser_rules_pseudo-element_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_pseudo-element_02.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that pseudoelements are displayed correctly in the rule view
const TEST_URI = URL_ROOT + "doc_pseudoelement.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector} = yield openRuleView();
let node = yield getNodeFront("#topleft", inspector);
let children = yield inspector.markup.walker.children(node);
is(children.nodes.length, 3, "Element has correct number of children");
--- a/devtools/client/inspector/rules/test/browser_rules_pseudo_lock_options.js
+++ b/devtools/client/inspector/rules/test/browser_rules_pseudo_lock_options.js
@@ -19,17 +19,17 @@ const TEST_URI = `
}
div:focus {
color: green;
}
</style>
<div>test div</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
yield assertPseudoPanelClosed(view);
info("Toggle the pseudo class panel open");
view.pseudoClassToggle.click();
--- a/devtools/client/inspector/rules/test/browser_rules_refresh-no-flicker.js
+++ b/devtools/client/inspector/rules/test/browser_rules_refresh-no-flicker.js
@@ -5,17 +5,17 @@
"use strict";
// Test that the rule view does not go blank while selecting a new node.
const TESTCASE_URI = "data:text/html;charset=utf-8," +
"<div id=\"testdiv\" style=\"font-size:10px;\">" +
"Test div!</div>";
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
info("Opening the rule view and selecting the test node");
let {inspector, view} = yield openRuleView();
let testdiv = yield getNodeFront("#testdiv", inspector);
yield selectNode(testdiv, inspector);
let htmlBefore = view.element.innerHTML;
--- a/devtools/client/inspector/rules/test/browser_rules_refresh-on-attribute-change_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_refresh-on-attribute-change_01.js
@@ -15,17 +15,17 @@ const TEST_URI = `
background-color: green;
}
</style>
<div id="testid" class="testclass" style="margin-top: 1px; padding-top: 5px;">
Styled Node
</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Checking that the rule-view has the element, #testid and " +
".testclass selectors");
checkRuleViewContent(view, ["element", "#testid", ".testclass"]);
--- a/devtools/client/inspector/rules/test/browser_rules_refresh-on-attribute-change_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_refresh-on-attribute-change_02.js
@@ -8,17 +8,17 @@
// rule-view
const TEST_URI = `
<div id="testid" class="testclass" style="margin-top: 1px; padding-top: 5px;">
Styled Node
</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testPropertyChanges(inspector, view);
yield testPropertyChange0(inspector, view, "#testid", testActor);
yield testPropertyChange1(inspector, view, "#testid", testActor);
yield testPropertyChange2(inspector, view, "#testid", testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_refresh-on-style-change.js
+++ b/devtools/client/inspector/rules/test/browser_rules_refresh-on-style-change.js
@@ -4,17 +4,17 @@
"use strict";
// Test that the rule view refreshes when the current node has its style
// changed
const TEST_URI = "<div id='testdiv' style='font-size: 10px;''>Test div!</div>";
-add_task(function*() {
+add_task(function* () {
Services.prefs.setCharPref("devtools.defaultColorUnit", "name");
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
yield selectNode("#testdiv", inspector);
let fontSize = getRuleViewPropertyValue(view, "element", "font-size");
is(fontSize, "10px", "The rule view shows the right font-size");
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_01.js
@@ -77,17 +77,17 @@ const TEST_DATA = [
isMarginHighlighted: true,
isMarginTopHighlighted: true,
isMarginRightHighlighted: false,
isMarginBottomHighlighted: true,
isMarginLeftHighlighted: false
}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
for (let data of TEST_DATA) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_02.js
@@ -16,17 +16,17 @@ const TEST_URI = `
}
.testclass {
background-color: red;
}
</style>
<h1 id="testid" class="testclass">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
yield testRemoveTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_03.js
@@ -15,17 +15,17 @@ const TEST_URI = `
<style type="text/css">
.testclass {
background: rgb(243, 243, 243) none repeat scroll 0% 0%;
}
</style>
<div class="testclass">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".testclass", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_04.js
@@ -14,17 +14,17 @@ const TEST_URI = `
#testid {
margin: 4px;
top: 0px;
}
</style>
<h1 id='testid'>Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testModifyPropertyValueFilter(inspector, view);
});
function* testModifyPropertyValueFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_expander.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_expander.js
@@ -16,17 +16,17 @@ const TEST_URI = `
}
.testclass {
background-color: red;
}
</style>
<h1 id="testid" class="testclass">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testOpenExpanderAndAddTextInFilter(inspector, view);
yield testClearSearchFilter(inspector, view);
});
function* testOpenExpanderAndAddTextInFilter(inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter-overridden-property.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter-overridden-property.js
@@ -14,17 +14,17 @@ const TEST_URI = `
}
h1 {
width: 50%;
}
</style>
<h1 id='testid' class='testclass'>Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testFilterOverriddenProperty(inspector, view);
});
function* testFilterOverriddenProperty(inspector, ruleView) {
info("Check that the correct rules are visible");
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_01.js
@@ -38,17 +38,17 @@ const TEST_DATA = [
},
{
desc: "Tests that the search filter works properly for parsed property " +
"values",
search: ":00F"
},
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
for (let data of TEST_DATA) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_02.js
@@ -5,17 +5,17 @@
"use strict";
// Tests that the rule view search filter works properly for keyframe rule
// selectors.
const SEARCH = "20%";
const TEST_URI = URL_ROOT + "doc_keyframeanimation.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode("#boxy", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_03.js
@@ -12,17 +12,17 @@ const TEST_URI = `
<style type="text/css">
#testid {
width: 100%;
}
</style>
<div id="testid" style="background-color:aliceblue">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_04.js
@@ -16,17 +16,17 @@ const TEST_URI = `
}
.testclass {
width: 100%;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
yield testRemoveTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_05.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_05.js
@@ -4,17 +4,17 @@
"use strict";
// Tests that the rule view search filter works properly for stylesheet source.
const SEARCH = "doc_urls_clickable.css";
const TEST_URI = URL_ROOT + "doc_urls_clickable.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode(".relative1", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_06.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_06.js
@@ -5,17 +5,17 @@
"use strict";
// Tests that the rule view search filter does not highlight the source with
// input that could be parsed as a property line.
const SEARCH = "doc_urls_clickable.css: url";
const TEST_URI = URL_ROOT + "doc_urls_clickable.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode(".relative1", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_07.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_07.js
@@ -14,17 +14,17 @@ const TEST_URI = `
#testid {
width: 100%;
height: 50%;
}
</style>
<h1 id='testid'>Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Enter the test value in the search filter");
yield setSearchFilter(view, SEARCH);
info("Focus the width property name");
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_08.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_08.js
@@ -14,17 +14,17 @@ const TEST_URI = `
#testid {
width: 100%;
height: 50%;
}
</style>
<h1 id='testid'>Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Enter the test value in the search filter");
yield setSearchFilter(view, SEARCH);
info("Focus the height property value");
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_09.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_09.js
@@ -14,17 +14,17 @@ const TEST_URI = `
#testid {
width: 100%;
height: 50%;
}
</style>
<h1 id='testid'>Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
info("Enter the test value in the search filter");
yield setSearchFilter(view, SEARCH);
info("Start entering a new property in the rule");
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_10.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_10.js
@@ -30,17 +30,17 @@ const TEST_DATA = [
desc: "Tests that the search filter works properly for multiple rule " +
"selectors",
search: "body",
selectorText: "html, body, div",
index: 2
}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
for (let data of TEST_DATA) {
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js
@@ -4,17 +4,17 @@
"use strict";
// Test rule view search filter context menu works properly.
const TEST_INPUT = "h1";
const TEST_URI = "<h1>test filter context menu</h1>";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view} = yield openRuleView();
yield selectNode("h1", inspector);
let win = view.styleWindow;
let searchField = view.searchField;
let searchContextMenu = toolbox.textboxContextMenuPopup;
ok(searchContextMenu,
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_escape-keypress.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_escape-keypress.js
@@ -16,17 +16,17 @@ const TEST_URI = `
}
.testclass {
width: 100%;
}
</style>
<div id="testid" class="testclass">Styled Node</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
yield testEscapeKeypress(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
--- a/devtools/client/inspector/rules/test/browser_rules_select-and-copy-styles.js
+++ b/devtools/client/inspector/rules/test/browser_rules_select-and-copy-styles.js
@@ -33,17 +33,17 @@ const TEST_URI = `
you should go do something else instead. Maybe read a book. Or better
yet, write some test-cases for another bit of code.
<span style="font-style: italic">some text</span></p>
<p id="closing">more text</p>
<p>even more text</p>
</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
yield checkCopySelection(view);
yield checkSelectAll(view);
yield checkCopyEditorValue(view);
});
--- a/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_01.js
@@ -11,17 +11,17 @@ const TEST_URI = `
<style type="text/css">
body, p, td {
background: red;
}
</style>
Test the selector highlighter
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {view} = yield openRuleView();
ok(!view.selectorHighlighter,
"No selectorhighlighter exist in the rule-view");
info("Clicking on a selector icon");
let icon = getRuleViewSelectorHighlighterIcon(view, "body, p, td");
--- a/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_02.js
@@ -17,17 +17,17 @@ const TEST_URI = `
}
p {
color: white;
}
</style>
<p>Testing the selector highlighter</p>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
// Mock the highlighter front to get the reference of the NodeFront
let HighlighterFront = {
isShown: false,
nodeFront: null,
options: null,
--- a/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_selector-highlighter_03.js
@@ -14,17 +14,17 @@ const TEST_URI = `
div {text-decoration: underline;}
.node-1 {color: red;}
.node-2 {color: green;}
</style>
<div class="node-1">Node 1</div>
<div class="node-2">Node 2</div>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
// Mock the highlighter front.
let HighlighterFront = {
isShown: false,
show: function() {
this.isShown = true;
--- a/devtools/client/inspector/rules/test/browser_rules_selector_highlight.js
+++ b/devtools/client/inspector/rules/test/browser_rules_selector_highlight.js
@@ -104,17 +104,17 @@ const TEST_DATA = [
pseudoClass: ":hover",
expected: [
{ value: ".testclass", class: SELECTOR_ELEMENT },
{ value: ":hover", class: SELECTOR_PSEUDO_CLASS_LOCK }
]
},
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
for (let {node, pseudoClass, expected} of TEST_DATA) {
yield selectNode(node, inspector);
if (pseudoClass) {
let onRefresh = inspector.once("rule-view-refreshed");
--- a/devtools/client/inspector/rules/test/browser_rules_strict-search-filter-computed-list_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_strict-search-filter-computed-list_01.js
@@ -103,17 +103,17 @@ const TEST_DATA = [
isMarginHighlighted: false,
isMarginTopHighlighted: true,
isMarginRightHighlighted: false,
isMarginBottomHighlighted: false,
isMarginLeftHighlighted: false
},
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
for (let data of TEST_DATA) {
--- a/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_01.js
@@ -68,17 +68,17 @@ const TEST_DATA = [
desc: "Tests that the search filter works properly for a parsed strict " +
"property value and non-strict property name.",
search: "i:`2%`",
ruleCount: 2,
propertyIndex: 0
}
];
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
for (let data of TEST_DATA) {
--- a/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_02.js
@@ -5,17 +5,17 @@
"use strict";
// Tests that the rule view strict search filter works properly for stylesheet
// source.
const SEARCH = "`doc_urls_clickable.css:1`";
const TEST_URI = URL_ROOT + "doc_urls_clickable.html";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNode(".relative1", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_03.js
+++ b/devtools/client/inspector/rules/test/browser_rules_strict-search-filter_03.js
@@ -16,17 +16,17 @@ const TEST_URI = `
}
.testclass {
color: red;
}
</style>
<h1 id="testid" class="testclass testclass1">Styled Node</h1>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
yield testAddTextInFilter(inspector, view);
});
function* testAddTextInFilter(inspector, view) {
yield setSearchFilter(view, SEARCH);
--- a/devtools/client/inspector/rules/test/browser_rules_style-editor-link.js
+++ b/devtools/client/inspector/rules/test/browser_rules_style-editor-link.js
@@ -47,17 +47,17 @@ const DOCUMENT_URL = "data:text/html;cha
<span style="font-style: italic">some text</span></p>
<p id="closing">more text</p>
<p>even more text</p>
</div>
</body>
</html>
`);
-add_task(function*() {
+add_task(function* () {
yield addTab(DOCUMENT_URL);
let {toolbox, inspector, view, testActor} = yield openRuleView();
yield selectNode("div", inspector);
yield testInlineStyle(view);
yield testFirstInlineStyleSheet(view, toolbox, testActor);
yield testSecondInlineStyleSheet(view, toolbox, testActor);
yield testExternalStyleSheet(view, toolbox, testActor);
--- a/devtools/client/inspector/rules/test/browser_rules_urls-clickable.js
+++ b/devtools/client/inspector/rules/test/browser_rules_urls-clickable.js
@@ -7,17 +7,17 @@
// Tests to make sure that URLs are clickable in the rule view
const TEST_URI = URL_ROOT + "doc_urls_clickable.html";
const TEST_IMAGE = URL_ROOT + "doc_test_image.png";
const BASE_64_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAA" +
"FCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAA" +
"BJRU5ErkJggg==";
-add_task(function*() {
+add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
yield selectNodes(inspector, view);
});
function* selectNodes(inspector, ruleView) {
let relative1 = ".relative1";
let relative2 = ".relative2";
--- a/devtools/client/inspector/rules/test/browser_rules_user-agent-styles-uneditable.js
+++ b/devtools/client/inspector/rules/test/browser_rules_user-agent-styles-uneditable.js
@@ -12,17 +12,17 @@ const TEST_URI = `
<pre _moz_quote=true>
inspect <a href='foo' style='color:orange'>user agent</a> styles
</pre>
</blockquote>
`;
var PREF_UA_STYLES = "devtools.inspector.showUserAgentStyles";
-add_task(function*() {
+add_task(function* () {
info("Starting the test with the pref set to true before toolbox is opened");
Services.prefs.setBoolPref(PREF_UA_STYLES, true);
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield userAgentStylesUneditable(inspector, view);
--- a/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js
+++ b/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js
@@ -52,17 +52,17 @@ const TEST_DATA = [
// last test in TEST_DATA.
{
selector: "a",
numUserRules: 3,
numUARules: 0
}
];
-add_task(function*() {
+add_task(function* () {
requestLongerTimeout(2);
info("Starting the test with the pref set to true before toolbox is opened");
yield setUserAgentStylesPref(true);
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();
--- a/devtools/client/inspector/rules/test/browser_rules_user-property-reset.js
+++ b/devtools/client/inspector/rules/test/browser_rules_user-property-reset.js
@@ -7,17 +7,17 @@
// Test that user set style properties can be changed from the markup-view and
// don't survive page reload
const TEST_URI = `
<p id='id1' style='width:200px;'>element 1</p>
<p id='id2' style='width:100px;'>element 2</p>
`;
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view, testActor} = yield openRuleView();
yield selectNode("#id1", inspector);
yield modifyRuleViewWidth("300px", view, inspector);
yield assertRuleAndMarkupViewWidth("id1", "300px", view, inspector);
yield selectNode("#id2", inspector);
@@ -70,16 +70,17 @@ function* getContainerStyleAttrValue(id,
let attrIndex = 0;
for (let attrName of container.elt.querySelectorAll(".attr-name")) {
if (attrName.textContent === "style") {
return container.elt.querySelectorAll(".attr-value")[attrIndex];
}
attrIndex++;
}
+ return undefined;
}
function* assertRuleAndMarkupViewWidth(id, value, ruleView, inspector) {
let valueSpan = getStyleRule(ruleView)
.querySelector(".ruleview-propertyvalue");
is(valueSpan.textContent, value,
"Rule-view style width is " + value + " as expected");
--- a/devtools/client/inspector/rules/test/head.js
+++ b/devtools/client/inspector/rules/test/head.js
@@ -220,17 +220,17 @@ function* waitForComputedStyleProperty(s
}
/**
* Given an inplace editable element, click to switch it to edit mode, wait for
* focus
*
* @return a promise that resolves to the inplace-editor element when ready
*/
-var focusEditableField = Task.async(function*(ruleView, editable, xOffset = 1,
+var focusEditableField = Task.async(function* (ruleView, editable, xOffset = 1,
yOffset = 1, options = {}) {
let onFocus = once(editable.parentNode, "focus", true);
info("Clicking on editable field to turn to edit mode");
EventUtils.synthesizeMouse(editable, xOffset, yOffset, options,
editable.ownerDocument.defaultView);
yield onFocus;
info("Editable field gained focus, returning the input field now");
@@ -285,17 +285,17 @@ function* hideTooltipAndWaitForRuleViewC
}
/**
* Listen for a new tab to open and return a promise that resolves when one
* does and completes the load event.
*
* @return a promise that resolves to the tab object
*/
-var waitForTab = Task.async(function*() {
+var waitForTab = Task.async(function* () {
info("Waiting for a tab to open");
yield once(gBrowser.tabContainer, "TabOpen");
let tab = gBrowser.selectedTab;
let browser = tab.linkedBrowser;
yield once(browser, "load", true);
info("The tab load completed");
return tab;
});
@@ -308,17 +308,17 @@ var waitForTab = Task.async(function*()
* This is called every few milliseconds to check if the result is true.
* When it is true, the promise resolves.
* @param {String} name
* Optional name of the test. This is used to generate
* the success and failure messages.
* @return a promise that resolves when the function returned true or rejects
* if the timeout is reached
*/
-var waitForSuccess = Task.async(function*(validatorFn, desc = "untitled") {
+var waitForSuccess = Task.async(function* (validatorFn, desc = "untitled") {
let i = 0;
while (true) {
info("Checking: " + desc);
if (yield validatorFn()) {
ok(true, "Success: " + desc);
break;
}
i++;
@@ -334,17 +334,17 @@ var waitForSuccess = Task.async(function
* Get the dataURL for the font family tooltip.
*
* @param {String} font
* The font family value.
* @param {object} nodeFront
* The NodeActor that will used to retrieve the dataURL for the
* font family tooltip contents.
*/
-var getFontFamilyDataURL = Task.async(function*(font, nodeFront) {
+var getFontFamilyDataURL = Task.async(function* (font, nodeFront) {
let fillStyle = (Services.prefs.getCharPref("devtools.theme") === "light") ?
"black" : "white";
let {data} = yield nodeFront.getFontFamilyDataURL(font, fillStyle);
let dataURL = yield data.string();
return dataURL;
});
@@ -479,17 +479,17 @@ function getRuleViewSelectorHighlighterI
* @param {Object} expectedChange
* Optional object that needs the following props:
* - {String} selector The selector to the element in the page that
* will have its style changed.
* - {String} name The style name that will be changed
* - {String} value The expected style value
* The style will be checked like so: getComputedStyle(element)[name] === value
*/
-var simulateColorPickerChange = Task.async(function*(ruleView, colorPicker,
+var simulateColorPickerChange = Task.async(function* (ruleView, colorPicker,
newRgba, expectedChange) {
let onRuleViewChanged = ruleView.once("ruleview-changed");
info("Getting the spectrum colorpicker object");
let spectrum = yield colorPicker.spectrum;
info("Setting the new color");
spectrum.rgb = newRgba;
info("Applying the change");
spectrum.updateUI();
@@ -520,17 +520,17 @@ var simulateColorPickerChange = Task.asy
* @param {Object} expectedChange
* Optional object that needs the following props:
* - {String} selector The selector to the element in the page that
* will have its style changed.
* - {String} name The style name that will be changed
* - {String} value The expected style value
* The style will be checked like so: getComputedStyle(element)[name] === value
*/
-var openColorPickerAndSelectColor = Task.async(function*(view, ruleIndex,
+var openColorPickerAndSelectColor = Task.async(function* (view, ruleIndex,
propIndex, newRgba, expectedChange) {
let ruleEditor = getRuleViewRuleEditor(view, ruleIndex);
let propEditor = ruleEditor.rule.textProps[propIndex].editor;
let swatch = propEditor.valueSpan.querySelector(".ruleview-colorswatch");
let cPicker = view.tooltips.colorPicker;
info("Opening the colorpicker by clicking the color swatch");
let onShown = cPicker.tooltip.once("shown");
@@ -558,17 +558,17 @@ var openColorPickerAndSelectColor = Task
* @param {Object} expectedChange
* Optional object that needs the following props:
* - {String} selector The selector to the element in the page that
* will have its style changed.
* - {String} name The style name that will be changed
* - {String} value The expected style value
* The style will be checked like so: getComputedStyle(element)[name] === value
*/
-var openCubicBezierAndChangeCoords = Task.async(function*(view, ruleIndex,
+var openCubicBezierAndChangeCoords = Task.async(function* (view, ruleIndex,
propIndex, coords, expectedChange) {
let ruleEditor = getRuleViewRuleEditor(view, ruleIndex);
let propEditor = ruleEditor.rule.textProps[propIndex].editor;
let swatch = propEditor.valueSpan.querySelector(".ruleview-bezierswatch");
let bezierTooltip = view.tooltips.cubicBezier;
info("Opening the cubicBezier by clicking the swatch");
let onShown = bezierTooltip.tooltip.once("shown");
@@ -654,19 +654,19 @@ function getRuleViewRuleEditor(view, chi
* default, but tests might want to use another key to test cancelling
* for exemple.
* @param {Boolean} blurNewProperty
* After the new value has been added, a new property would have been
* focused. This parameter is true by default, and that causes the new
* property to be blurred. Set to false if you don't want this.
* @return {TextProperty} The instance of the TextProperty that was added
*/
-var addProperty = Task.async(function*(view, ruleIndex, name, value,
- commitValueWith = "VK_RETURN",
- blurNewProperty = true) {
+var addProperty = Task.async(function* (view, ruleIndex, name, value,
+ commitValueWith = "VK_RETURN",
+ blurNewProperty = true) {
info("Adding new property " + name + ":" + value + " to rule " + ruleIndex);
let ruleEditor = getRuleViewRuleEditor(view, ruleIndex);
let editor = yield focusNewRuleViewProperty(ruleEditor);
let numOfProps = ruleEditor.rule.textProps.length;
info("Adding name " + name);
editor.input.value = name;
@@ -712,18 +712,18 @@ var addProperty = Task.async(function*(v
* @param {String} value
* The new value to be used. If null is passed, then the value will be
* deleted
* @param {Boolean} blurNewProperty
* After the value has been changed, a new property would have been
* focused. This parameter is true by default, and that causes the new
* property to be blurred. Set to false if you don't want this.
*/
-var setProperty = Task.async(function*(view, textProp, value,
- blurNewProperty = true) {
+var setProperty = Task.async(function* (view, textProp, value,
+ blurNewProperty = true) {
yield focusEditableField(view, textProp.editor.valueSpan);
let onPreview = view.once("ruleview-changed");
if (value === null) {
EventUtils.synthesizeKey("VK_DELETE", {}, view.styleWindow);
} else {
EventUtils.sendString(value, view.styleWindow);
}
@@ -745,18 +745,18 @@ var setProperty = Task.async(function*(v
* The instance of the rule-view panel
* @param {TextProperty} textProp
* The instance of the TextProperty to be removed
* @param {Boolean} blurNewProperty
* After the property has been removed, a new property would have been
* focused. This parameter is true by default, and that causes the new
* property to be blurred. Set to false if you don't want this.
*/
-var removeProperty = Task.async(function*(view, textProp,
- blurNewProperty = true) {
+var removeProperty = Task.async(function* (view, textProp,
+ blurNewProperty = true) {
yield focusEditableField(view, textProp.editor.nameSpan);
let onModifications = view.once("ruleview-changed");
info("Deleting the property name now");
EventUtils.synthesizeKey("VK_DELETE", {}, view.styleWindow);
EventUtils.synthesizeKey("VK_RETURN", {}, view.styleWindow);
yield onModifications;
@@ -768,31 +768,31 @@ var removeProperty = Task.async(function
/**
* Simulate clicking the enable/disable checkbox next to a property in a rule.
*
* @param {CssRuleView} view
* The instance of the rule-view panel
* @param {TextProperty} textProp
* The instance of the TextProperty to be enabled/disabled
*/
-var togglePropStatus = Task.async(function*(view, textProp) {
+var togglePropStatus = Task.async(function* (view, textProp) {
let onRuleViewRefreshed = view.once("ruleview-changed");
textProp.editor.enable.click();
yield onRuleViewRefreshed;
});
/**
* Click on a rule-view's close brace to focus a new property name editor
*
* @param {RuleEditor} ruleEditor
* An instance of RuleEditor that will receive the new property
* @return a promise that resolves to the newly created editor when ready and
* focused
*/
-var focusNewRuleViewProperty = Task.async(function*(ruleEditor) {
+var focusNewRuleViewProperty = Task.async(function* (ruleEditor) {
info("Clicking on a close ruleEditor brace to start editing a new property");
ruleEditor.closeBrace.scrollIntoView();
let editor = yield focusEditableField(ruleEditor.ruleView,
ruleEditor.closeBrace);
is(inplaceEditor(ruleEditor.newPropSpan), editor,
"Focused editor is the new property editor.");
@@ -807,17 +807,17 @@ var focusNewRuleViewProperty = Task.asyn
*
* @param {RuleEditor} ruleEditor
* The instance of RuleEditor that will receive the new property(ies)
* @param {String} inputValue
* The text to be entered in the new property name field
* @return a promise that resolves when the new property name has been entered
* and once the value field is focused
*/
-var createNewRuleViewProperty = Task.async(function*(ruleEditor, inputValue) {
+var createNewRuleViewProperty = Task.async(function* (ruleEditor, inputValue) {
info("Creating a new property editor");
let editor = yield focusNewRuleViewProperty(ruleEditor);
info("Entering the value " + inputValue);
editor.input.value = inputValue;
info("Submitting the new value and waiting for value field focus");
let onFocus = once(ruleEditor.element, "focus", true);
@@ -831,17 +831,17 @@ var createNewRuleViewProperty = Task.asy
*
* @param {CssRuleView} view
* The instance of the rule-view panel
* @param {String} searchValue
* The filter search value
* @return a promise that resolves when the rule-view is filtered for the
* search term
*/
-var setSearchFilter = Task.async(function*(view, searchValue) {
+var setSearchFilter = Task.async(function* (view, searchValue) {
info("Setting filter text to \"" + searchValue + "\"");
let win = view.styleWindow;
let searchField = view.searchField;
searchField.focus();
synthesizeKeys(searchValue, win);
yield view.inspector.once("ruleview-filtered");
});
--- a/devtools/client/inspector/rules/views/text-property-editor.js
+++ b/devtools/client/inspector/rules/views/text-property-editor.js
@@ -246,16 +246,17 @@ TextPropertyEditor.prototype = {
*
* @return {String} the stylesheet's href.
*/
get sheetHref() {
let domRule = this.rule.domRule;
if (domRule) {
return domRule.href || domRule.nodeHref;
}
+ return undefined;
},
/**
* Get the URI from which to resolve relative requests for
* this rule's stylesheet.
*
* @return {nsIURI} A URI based on the the stylesheet's href.
*/
--- a/devtools/client/inspector/shared/dom-node-preview.js
+++ b/devtools/client/inspector/shared/dom-node-preview.js
@@ -323,28 +323,28 @@ DomNodePreview.prototype = {
* of DomNodePreview. This is useful because that means showing the highlighter
* on one node will unhighlight the previously highlighted one, but will not
* interfere with the default inspector highlighter.
*/
var HighlighterLock = {
highlighter: null,
isShown: false,
- highlight: Task.async(function*(animationTargetNode) {
+ highlight: Task.async(function* (animationTargetNode) {
if (!this.highlighter) {
let util = animationTargetNode.inspector.toolbox.highlighterUtils;
this.highlighter = yield util.getHighlighterByType("BoxModelHighlighter");
}
yield this.highlighter.show(animationTargetNode.nodeFront);
this.isShown = true;
this.emit("highlighted", animationTargetNode);
}),
- unhighlight: Task.async(function*() {
+ unhighlight: Task.async(function* () {
if (!this.highlighter || !this.isShown) {
return;
}
yield this.highlighter.hide();
this.isShown = false;
this.emit("unhighlighted");
})
--- a/devtools/client/inspector/shared/style-inspector-menu.js
+++ b/devtools/client/inspector/shared/style-inspector-menu.js
@@ -395,17 +395,17 @@ StyleInspectorMenu.prototype = {
clipboardHelper.copyString(this._clickedNodeInfo.value.url);
},
/**
* Retrieve the image data for the selected image url and copy it to the
* clipboard
*/
- _onCopyImageDataUrl: Task.async(function*() {
+ _onCopyImageDataUrl: Task.async(function* () {
if (!this._clickedNodeInfo) {
return;
}
let message;
try {
let inspectorFront = this.inspector.inspector;
let imageUrl = this._clickedNodeInfo.value.url;
--- a/devtools/client/inspector/shared/style-inspector-overlays.js
+++ b/devtools/client/inspector/shared/style-inspector-overlays.js
@@ -401,16 +401,18 @@ TooltipsOverlay.prototype = {
return this.previewTooltip.setRelativeImageContent(uri,
inspector.inspector, dim);
}
if (type === TOOLTIP_FONTFAMILY_TYPE) {
return this.previewTooltip.setFontFamilyContent(nodeInfo.value.value,
inspector.selection.nodeFront);
}
+
+ return undefined;
},
_onNewSelection: function() {
if (this.previewTooltip) {
this.previewTooltip.hide();
}
if (this.colorPicker) {
--- a/devtools/client/jsonview/converter-child.js
+++ b/devtools/client/jsonview/converter-child.js
@@ -127,16 +127,17 @@ let Converter = Class({
let win = NetworkHelper.getWindowForRequest(request);
let Locale = {
$STR: key => {
try {
return jsonViewStrings.GetStringFromName(key);
} catch (err) {
Cu.reportError(err);
+ return undefined;
}
}
};
JsonViewUtils.exportIntoContentScope(win, Locale, "Locale");
Events.once(win, "DOMContentLoaded", event => {
Cu.exportFunction(this.postChromeMessage.bind(this), win, {
--- a/devtools/client/netmonitor/har/har-automation.js
+++ b/devtools/client/netmonitor/har/har-automation.js
@@ -210,17 +210,18 @@ var HarAutomation = Class({
* The "requestHeaders".
* @param object uploadHeaders
* The "requestHeadersFromUploadStream".
* @param object postData
* The "requestPostData".
* @return array
* A promise that is resolved with the extracted form data.
*/
- _getFormDataSections: Task.async(function*(headers, uploadHeaders, postData) {
+ _getFormDataSections: Task.async(function* (headers, uploadHeaders,
+ postData) {
let formDataSections = [];
let { headers: requestHeaders } = headers;
let { headers: payloadHeaders } = uploadHeaders;
let allHeaders = [...payloadHeaders, ...requestHeaders];
let contentTypeHeader = allHeaders.find(e => {
return e.name.toLowerCase() == "content-type";
--- a/devtools/client/netmonitor/har/har-collector.js
+++ b/devtools/client/netmonitor/har/har-collector.js
@@ -451,13 +451,14 @@ function waitForAll(promises) {
// Wait for all promises in the given array.
return all(clone).then(() => {
// If there are new promises (in the original array)
// to wait for - chain them!
if (promises.length) {
return waitForAll(promises);
}
+ return undefined;
});
}
// Exports from this module
exports.HarCollector = HarCollector;
--- a/devtools/client/netmonitor/har/har-exporter.js
+++ b/devtools/client/netmonitor/har/har-exporter.js
@@ -170,14 +170,15 @@ const HarExporter = {
if (!har) {
return null;
}
try {
return JSON.stringify(har, null, " ");
} catch (err) {
Cu.reportError(err);
+ return undefined;
}
},
};
// Exports from this module
exports.HarExporter = HarExporter;
--- a/devtools/client/netmonitor/netmonitor-controller.js
+++ b/devtools/client/netmonitor/netmonitor-controller.js
@@ -158,58 +158,60 @@ Object.defineProperty(this, "NetworkHelp
*/
var NetMonitorController = {
/**
* Initializes the view and connects the monitor client.
*
* @return object
* A promise that is resolved when the monitor finishes startup.
*/
- startupNetMonitor: Task.async(function*() {
+ startupNetMonitor: Task.async(function* () {
if (this._startup) {
return this._startup.promise;
}
this._startup = promise.defer();
{
NetMonitorView.initialize();
yield this.connect();
}
this._startup.resolve();
+ return undefined;
}),
/**
* Destroys the view and disconnects the monitor client from the server.
*
* @return object
* A promise that is resolved when the monitor finishes shutdown.
*/
- shutdownNetMonitor: Task.async(function*() {
+ shutdownNetMonitor: Task.async(function* () {
if (this._shutdown) {
return this._shutdown.promise;
}
this._shutdown = promise.defer();
{
NetMonitorView.destroy();
this.TargetEventsHandler.disconnect();
this.NetworkEventsHandler.disconnect();
yield this.disconnect();
}
this._shutdown.resolve();
+ return undefined;
}),
/**
* Initiates remote or chrome network monitoring based on the current target,
* wiring event handlers as necessary. Since the TabTarget will have already
* started listening to network requests by now, this is largely
* netmonitor-specific initialization.
*
* @return object
* A promise that is resolved when the monitor finishes connecting.
*/
- connect: Task.async(function*() {
+ connect: Task.async(function* () {
if (this._connection) {
return this._connection.promise;
}
this._connection = promise.defer();
// Some actors like AddonActor or RootActor for chrome debugging
// aren't actual tabs.
if (this._target.isTabActor) {
@@ -219,34 +221,36 @@ var NetMonitorController = {
let connectTimeline = () => {
// Don't start up waiting for timeline markers if the server isn't
// recent enough to emit the markers we're interested in.
if (this._target.getTrait("documentLoadingMarkers")) {
this.timelineFront = new TimelineFront(this._target.client,
this._target.form);
return this.timelineFront.start({ withDocLoadingEvents: true });
}
+ return undefined;
};
this.webConsoleClient = this._target.activeConsole;
yield connectTimeline();
this.TargetEventsHandler.connect();
this.NetworkEventsHandler.connect();
window.emit(EVENTS.CONNECTED);
this._connection.resolve();
this._connected = true;
+ return undefined;
}),
/**
* Disconnects the debugger client and removes event handlers as necessary.
*/
- disconnect: Task.async(function*() {
+ disconnect: Task.async(function* () {
if (this._disconnection) {
return this._disconnection.promise;
}
this._disconnection = promise.defer();
// Wait for the connection to finish first.
if (!this.isConnected()) {
yield this._connection.promise;
@@ -261,16 +265,17 @@ var NetMonitorController = {
// recent enough to emit the markers we were interested in.
if (this._target.getTrait("documentLoadingMarkers")) {
yield this.timelineFront.destroy();
this.timelineFront = null;
}
this._disconnection.resolve();
this._connected = false;
+ return undefined;
}),
/**
* Checks whether the netmonitor connection is active.
* @return boolean
*/
isConnected: function() {
return !!this._connected;
@@ -324,25 +329,29 @@ var NetMonitorController = {
let navigationFinished = waitForNavigation();
return reconfigureTab(options).then(() => navigationFinished);
};
if (type == ACTIVITY_TYPE.RELOAD.WITH_CACHE_DEFAULT) {
return reconfigureTabAndWaitForNavigation({}).then(standBy);
}
if (type == ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED) {
this._currentActivity = ACTIVITY_TYPE.ENABLE_CACHE;
- this._target.once("will-navigate", () => this._currentActivity = type);
+ this._target.once("will-navigate", () => {
+ this._currentActivity = type;
+ });
return reconfigureTabAndWaitForNavigation({
cacheDisabled: false,
performReload: true
}).then(standBy);
}
if (type == ACTIVITY_TYPE.RELOAD.WITH_CACHE_DISABLED) {
this._currentActivity = ACTIVITY_TYPE.DISABLE_CACHE;
- this._target.once("will-navigate", () => this._currentActivity = type);
+ this._target.once("will-navigate", () => {
+ this._currentActivity = type;
+ });
return reconfigureTabAndWaitForNavigation({
cacheDisabled: true,
performReload: true
}).then(standBy);
}
if (type == ACTIVITY_TYPE.ENABLE_CACHE) {
this._currentActivity = type;
return reconfigureTab({
--- a/devtools/client/netmonitor/netmonitor-view.js
+++ b/devtools/client/netmonitor/netmonitor-view.js
@@ -178,17 +178,17 @@ var NetMonitorView = {
$("#notice-perf-message").hidden = true;
$("#requests-menu-network-summary-button").hidden = true;
}
},
/**
* Destroys the UI for all the displayed panes.
*/
- _destroyPanes: Task.async(function*() {
+ _destroyPanes: Task.async(function* () {
dumpn("Destroying the NetMonitorView panes");
Prefs.networkDetailsWidth = this._detailsPane.getAttribute("width");
Prefs.networkDetailsHeight = this._detailsPane.getAttribute("height");
this._detailsPane = null;
this._detailsPaneToggleButton = null;
@@ -275,17 +275,17 @@ var NetMonitorView = {
*/
showNetworkStatisticsView: function() {
this._body.selectedPanel = $("#network-statistics-view");
let controller = NetMonitorController;
let requestsView = this.RequestsMenu;
let statisticsView = this.PerformanceStatistics;
- Task.spawn(function*() {
+ Task.spawn(function* () {
statisticsView.displayPlaceholderCharts();
yield controller.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED);
try {
// • The response headers and status code are required for determining
// whether a response is "fresh" (cacheable).
// • The response content size and request total time are necessary for
// populating the statistics view.
@@ -642,16 +642,17 @@ RequestsMenuView.prototype = Heritage.ex
fromServiceWorker]);
// Lazy updating is disabled in some tests.
if (!this.lazyUpdate) {
return void this._flushRequests();
}
this._flushRequestsTask.arm();
+ return undefined;
},
/**
* Opens selected item in a new tab.
*/
openRequestInTab: function() {
let win = Services.wm.getMostRecentWindow("navigator:browser");
let selected = this.selectedItem.attachment;
@@ -685,17 +686,18 @@ RequestsMenuView.prototype = Heritage.ex
* The "requestHeaders".
* @param object uploadHeaders
* The "requestHeadersFromUploadStream".
* @param object postData
* The "requestPostData".
* @return array
* A promise that is resolved with the extracted form data.
*/
- _getFormDataSections: Task.async(function*(headers, uploadHeaders, postData) {
+ _getFormDataSections: Task.async(function* (headers, uploadHeaders,
+ postData) {
let formDataSections = [];
let { headers: requestHeaders } = headers;
let { headers: payloadHeaders } = uploadHeaders;
let allHeaders = [...payloadHeaders, ...requestHeaders];
let contentTypeHeader = allHeaders.find(e => {
return e.name.toLowerCase() == "content-type";
@@ -721,17 +723,17 @@ RequestsMenuView.prototype = Heritage.ex
return formDataSections;
}),
/**
* Copy the request form data parameters (or raw payload) from
* the currently selected item.
*/
- copyPostData: Task.async(function*() {
+ copyPostData: Task.async(function* () {
let selected = this.selectedItem.attachment;
let view = this;
// Try to extract any form data parameters.
let formDataSections = yield view._getFormDataSections(
selected.requestHeaders,
selected.requestHeadersFromUploadStream,
selected.requestPostData);
@@ -761,17 +763,17 @@ RequestsMenuView.prototype = Heritage.ex
}),
/**
* Copy a cURL command from the currently selected item.
*/
copyAsCurl: function() {
let selected = this.selectedItem.attachment;
- Task.spawn(function*() {
+ Task.spawn(function* () {
// Create a sanitized object for the Curl command generator.
let data = {
url: selected.url,
method: selected.method,
headers: [],
httpVersion: selected.httpVersion,
postDataText: null
};
@@ -1277,17 +1279,17 @@ RequestsMenuView.prototype = Heritage.ex
// Detect a websocket upgrade if request has an Upgrade header
// with value 'websocket'
if (!requestHeaders || !Array.isArray(requestHeaders.headers)) {
return false;
}
// Find the 'upgrade' header.
- var upgradeHeader = requestHeaders.headers.find(header => {
+ let upgradeHeader = requestHeaders.headers.find(header => {
return (header.name == "Upgrade");
});
// If no header found on request, check response - mainly to get
// something we can unit test, as it is impossible to set
// the Upgrade header on outgoing XHR as per the spec.
if (!upgradeHeader && responseHeaders &&
Array.isArray(responseHeaders.headers)) {
@@ -1482,16 +1484,17 @@ RequestsMenuView.prototype = Heritage.ex
this._updateQueue.push([id, data, callback]);
// Lazy updating is disabled in some tests.
if (!this.lazyUpdate) {
return void this._flushRequests();
}
this._flushRequestsTask.arm();
+ return undefined;
},
/**
* Starts adding all queued additional information about network requests.
*/
_flushRequests: function() {
// Prevent displaying any updates received after the target closed.
if (NetMonitorView._isDestroyed) {
@@ -1576,17 +1579,17 @@ RequestsMenuView.prototype = Heritage.ex
case "requestPostData":
// Search the POST data upload stream for request headers and add
// them to a separate store, different from the classic headers.
// XXX: Be really careful here! We're creating a function inside
// a loop, so remember the actual request item we want to modify.
let currentItem = requestItem;
let currentStore = { headers: [], headersSize: 0 };
- Task.spawn(function*() {
+ Task.spawn(function* () {
let postData = yield gNetwork.getString(val.postData.text);
let payloadHeaders = CurlUtils.getHeadersFromMultipartText(
postData);
currentStore.headers = payloadHeaders;
currentStore.headersSize = payloadHeaders.reduce(
(acc, { name, value }) =>
acc + name.length + value.length + 2, 0);
@@ -1770,17 +1773,17 @@ RequestsMenuView.prototype = Heritage.ex
* The network request item in this container.
* @param string key
* The type of information that is to be updated.
* @param any value
* The new value to be shown.
* @return object
* A promise that is resolved once the information is displayed.
*/
- updateMenuView: Task.async(function*(item, key, value) {
+ updateMenuView: Task.async(function* (item, key, value) {
let target = item.target || item;
switch (key) {
case "method": {
let node = $(".requests-menu-method", target);
node.setAttribute("value", value);
break;
}
@@ -2237,16 +2240,17 @@ RequestsMenuView.prototype = Heritage.ex
tooltip.setImageContent(src, {
maxDim: REQUESTS_TOOLTIP_IMAGE_MAX_DIM
});
return anchor;
});
}
+ return undefined;
},
/**
* A handler that opens the security tab in the details view if secure or
* broken security indicator is clicked.
*/
_onSecurityIconClick: function(e) {
let state = this.selectedItem.attachment.securityState;
@@ -2308,17 +2312,19 @@ RequestsMenuView.prototype = Heritage.ex
let copyImageAsDataUriElement =
$("#request-menu-context-copy-image-as-data-uri");
copyImageAsDataUriElement.hidden = !selectedItem ||
!selectedItem.attachment.responseContent ||
!selectedItem.attachment.responseContent.content
.mimeType.includes("image/");
let separators = $all(".request-menu-context-separator");
- Array.forEach(separators, separator => separator.hidden = !selectedItem);
+ Array.forEach(separators, separator => {
+ separator.hidden = !selectedItem;
+ });
let copyAsHar = $("#request-menu-context-copy-all-as-har");
copyAsHar.hidden = !NetMonitorView.RequestsMenu.items.length;
let saveAsHar = $("#request-menu-context-save-all-as-har");
saveAsHar.hidden = !NetMonitorView.RequestsMenu.items.length;
let newTabElement = $("#request-menu-context-newtab");
@@ -2503,17 +2509,17 @@ SidebarView.prototype = {
/**
* Populates this view with the specified data.
*
* @param object data
* The data source (this should be the attachment of a request item).
* @return object
* Returns a promise that resolves upon population of the subview.
*/
- populate: Task.async(function*(data) {
+ populate: Task.async(function* (data) {
let isCustom = data.isCustom;
let view = isCustom ?
NetMonitorView.CustomRequest :
NetMonitorView.NetworkDetails;
yield view.populate(data);
$("#details-pane").selectedIndex = isCustom ? 0 : 1;
@@ -2553,17 +2559,17 @@ CustomRequestView.prototype = {
/**
* Populates this view with the specified data.
*
* @param object data
* The data source (this should be the attachment of a request item).
* @return object
* Returns a promise that resolves upon population the view.
*/
- populate: Task.async(function*(data) {
+ populate: Task.async(function* (data) {
$("#custom-url-value").value = data.url;
$("#custom-method-value").value = data.method;
this.updateCustomQuery(data.url);
if (data.requestHeaders) {
let headers = data.requestHeaders.headers;
$("#custom-headers-value").value = writeHeaderText(headers);
}
@@ -2806,17 +2812,17 @@ NetworkDetailsView.prototype = {
// task now it would result in a duplicated content as described in bugs
// 997065 and 984687. As there's no way to stop the current task mark the
// tab dirty and refresh the panel once the current task finishes.
viewState.dirty[tab] = true;
viewState.latestData = src;
return;
}
- Task.spawn(function*() {
+ Task.spawn(function* () {
viewState.updating[tab] = true;
switch (tab) {
// "Headers"
case 0:
yield view._setSummary(src);
yield view._setResponseHeaders(src.responseHeaders);
yield view._setRequestHeaders(
src.requestHeaders,
@@ -2946,51 +2952,51 @@ NetworkDetailsView.prototype = {
*
* @param object headers
* The "requestHeaders" message received from the server.
* @param object uploadHeaders
* The "requestHeadersFromUploadStream" inferred from the POST payload.
* @return object
* A promise that resolves when request headers are set.
*/
- _setRequestHeaders: Task.async(function*(headers, uploadHeaders) {
+ _setRequestHeaders: Task.async(function* (headers, uploadHeaders) {
if (headers && headers.headers.length) {
yield this._addHeaders(this._requestHeaders, headers);
}
if (uploadHeaders && uploadHeaders.headers.length) {
yield this._addHeaders(this._requestHeadersFromUpload, uploadHeaders);
}
}),
/**
* Sets the network response headers shown in this view.
*
* @param object response
* The message received from the server.
* @return object
* A promise that resolves when response headers are set.
*/
- _setResponseHeaders: Task.async(function*(response) {
+ _setResponseHeaders: Task.async(function* (response) {
if (response && response.headers.length) {
response.headers.sort((a, b) => a.name > b.name);
yield this._addHeaders(this._responseHeaders, response);
}
}),
/**
* Populates the headers container in this view with the specified data.
*
* @param string name
* The type of headers to populate (request or response).
* @param object response
* The message received from the server.
* @return object
* A promise that resolves when headers are added.
*/
- _addHeaders: Task.async(function*(name, response) {
+ _addHeaders: Task.async(function* (name, response) {
let kb = response.headersSize / 1024;
let size = L10N.numberWithDecimals(kb, HEADERS_SIZE_DECIMALS);
let text = L10N.getFormatStr("networkMenu.sizeKB", size);
let headersScope = this._headers.addScope(name + " (" + text + ")");
headersScope.expanded = true;
for (let header of response.headers) {
@@ -3003,48 +3009,48 @@ NetworkDetailsView.prototype = {
/**
* Sets the network request cookies shown in this view.
*
* @param object response
* The message received from the server.
* @return object
* A promise that is resolved when the request cookies are set.
*/
- _setRequestCookies: Task.async(function*(response) {
+ _setRequestCookies: Task.async(function* (response) {
if (response && response.cookies.length) {
response.cookies.sort((a, b) => a.name > b.name);
yield this._addCookies(this._requestCookies, response);
}
}),
/**
* Sets the network response cookies shown in this view.
*
* @param object response
* The message received from the server.
* @return object
* A promise that is resolved when the response cookies are set.
*/
- _setResponseCookies: Task.async(function*(response) {
+ _setResponseCookies: Task.async(function* (response) {
if (response && response.cookies.length) {
yield this._addCookies(this._responseCookies, response);
}
}),
/**
* Populates the cookies container in this view with the specified data.
*
* @param string name
* The type of cookies to populate (request or response).
* @param object response
* The message received from the server.
* @return object
* Returns a promise that resolves upon the adding of cookies.
*/
- _addCookies: Task.async(function*(name, response) {
+ _addCookies: Task.async(function* (name, response) {
let cookiesScope = this._cookies.addScope(name);
cookiesScope.expanded = true;
for (let cookie of response.cookies) {
let cookieVar = cookiesScope.addItem(cookie.name, {}, {relaxed: true});
let cookieValue = yield gNetwork.getString(cookie.value);
cookieVar.setGrip(cookieValue);
@@ -3088,17 +3094,17 @@ NetworkDetailsView.prototype = {
* The "requestHeaders" message received from the server.
* @param object uploadHeaders
* The "requestHeadersFromUploadStream" inferred from the POST payload.
* @param object postData
* The "requestPostData" message received from the server.
* @return object
* A promise that is resolved when the request post params are set.
*/
- _setRequestPostParams: Task.async(function*(headers, uploadHeaders,
+ _setRequestPostParams: Task.async(function* (headers, uploadHeaders,
postData) {
if (!headers || !uploadHeaders || !postData) {
return;
}
let formDataSections = yield RequestsMenuView.prototype
._getFormDataSections(headers, uploadHeaders, postData);
@@ -3172,17 +3178,17 @@ NetworkDetailsView.prototype = {
*
* @param string url
* The request's url.
* @param object response
* The message received from the server.
* @return object
* A promise that is resolved when the response body is set.
*/
- _setResponseBody: Task.async(function*(url, response) {
+ _setResponseBody: Task.async(function* (url, response) {
if (!response) {
return;
}
let { mimeType, text, encoding } = response.content;
let responseBody = yield gNetwork.getString(text);
// Handle json, which we tentatively identify by checking the MIME type
// for "json" after any word boundary. This works for the standard
@@ -3367,29 +3373,30 @@ NetworkDetailsView.prototype = {
/**
* Sets the preview for HTML responses shown in this view.
*
* @param object response
* The message received from the server.
* @return object
* A promise that is resolved when the html preview is rendered.
*/
- _setHtmlPreview: Task.async(function*(response) {
+ _setHtmlPreview: Task.async(function* (response) {
if (!response) {
return promise.resolve();
}
let { text } = response.content;
let responseBody = yield gNetwork.getString(text);
// Always disable JS when previewing HTML responses.
let iframe = $("#response-preview");
iframe.contentDocument.docShell.allowJavascript = false;
iframe.contentDocument.documentElement.innerHTML = responseBody;
window.emit(EVENTS.RESPONSE_HTML_PREVIEW_DISPLAYED);
+ return undefined;
}),
/**
* Sets the security information shown in this view.
*
* @param object securityInfo
* The data received from server
* @param string url
--- a/devtools/client/netmonitor/panel.js
+++ b/devtools/client/netmonitor/panel.js
@@ -23,17 +23,17 @@ exports.NetMonitorPanel = NetMonitorPane
NetMonitorPanel.prototype = {
/**
* Open is effectively an asynchronous constructor.
*
* @return object
* A promise that is resolved when the NetMonitor completes opening.
*/
- open: Task.async(function*() {
+ open: Task.async(function* () {
if (this._opening) {
return this._opening;
}
let deferred = promise.defer();
this._opening = deferred.promise;
// Local monitoring needs to make the target remote.
if (!this.target.isRemote) {
@@ -49,17 +49,17 @@ NetMonitorPanel.prototype = {
}),
// DevToolPanel API
get target() {
return this._toolbox.target;
},
- destroy: Task.async(function*() {
+ destroy: Task.async(function* () {
if (this._destroying) {
return this._destroying;
}
let deferred = promise.defer();
this._destroying = deferred.promise;
yield this._controller.shutdownNetMonitor();
this.emit("destroyed");
--- a/devtools/client/responsive.html/components/browser.js
+++ b/devtools/client/responsive.html/components/browser.js
@@ -32,17 +32,17 @@ module.exports = createClass({
onBrowserMounted: PropTypes.func.isRequired,
onContentResize: PropTypes.func.isRequired,
},
/**
* Once the browser element has mounted, load the frame script and enable
* various features, like floating scrollbars.
*/
- componentDidMount: Task.async(function*() {
+ componentDidMount: Task.async(function* () {
let { onContentResize } = this;
let browser = this.refs.browserContainer.querySelector("iframe.browser");
let mm = browser.frameLoader.messageManager;
// Notify tests when the content has received a resize event. This is not
// quite the same timing as when we _set_ a new size around the browser,
// since it still needs to do async work before the content is actually
// resized to match.
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -46,17 +46,17 @@ const ResponsiveUIManager = exports.Resp
* @param window
* The main browser chrome window.
* @param tab
* The browser tab.
* @return Promise
* Resolved to the ResponsiveUI instance for this tab when opening is
* complete.
*/
- openIfNeeded: Task.async(function*(window, tab) {
+ openIfNeeded: Task.async(function* (window, tab) {
if (!this.isActiveForTab(tab)) {
let ui = new ResponsiveUI(window, tab);
this.activeTabs.set(tab, ui);
yield ui.inited;
this.emit("on", { tab });
}
return this.getResponsiveUIForTab(tab);
}),
@@ -66,17 +66,17 @@ const ResponsiveUIManager = exports.Resp
*
* @param window
* The main browser chrome window.
* @param tab
* The browser tab.
* @return Promise
* Resolved (with no value) when closing is complete.
*/
- closeIfNeeded: Task.async(function*(window, tab) {
+ closeIfNeeded: Task.async(function* (window, tab) {
if (this.isActiveForTab(tab)) {
yield this.activeTabs.get(tab).destroy();
this.activeTabs.delete(tab);
this.emit("off", { tab });
}
return promise.resolve();
}),
@@ -186,29 +186,29 @@ ResponsiveUI.prototype = {
*
* This approach is simple, but it also discards the user's state on the page.
* It's just like opening a fresh tab and pasting the URL.
*
* In the future, we can do better by using swapFrameLoaders to preserve the
* state. Platform discussions are in progress to make this happen. See
* bug 1238160 about <iframe mozbrowser> for more details.
*/
- init: Task.async(function*() {
+ init: Task.async(function* () {
let tabBrowser = this.tab.linkedBrowser;
let contentURI = tabBrowser.documentURI.spec;
tabBrowser.loadURI(TOOL_URL);
yield tabLoaded(this.tab);
let toolWindow = this.toolWindow = tabBrowser.contentWindow;
toolWindow.addEventListener("message", this);
yield waitForMessage(toolWindow, "init");
toolWindow.addInitialViewport(contentURI);
yield waitForMessage(toolWindow, "browser-mounted");
}),
- destroy: Task.async(function*() {
+ destroy: Task.async(function* () {
let tabBrowser = this.tab.linkedBrowser;
let browserWindow = this.browserWindow;
this.browserWindow = null;
this.tab = null;
this.inited = null;
this.toolWindow = null;
let loaded = waitForDocLoadComplete(browserWindow.gBrowser);
tabBrowser.goBack();
@@ -237,17 +237,17 @@ ResponsiveUI.prototype = {
break;
}
},
getViewportSize() {
return this.toolWindow.getViewportSize();
},
- setViewportSize: Task.async(function*(width, height) {
+ setViewportSize: Task.async(function* (width, height) {
yield this.inited;
this.toolWindow.setViewportSize(width, height);
}),
getViewportMessageManager() {
return this.toolWindow.getViewportMessageManager();
},
--- a/devtools/client/responsive.html/test/browser/browser_device_width.js
+++ b/devtools/client/responsive.html/test/browser/browser_device_width.js
@@ -1,30 +1,30 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URL = "about:logo";
-addRDMTask(TEST_URL, function*({ ui, manager }) {
+addRDMTask(TEST_URL, function* ({ ui, manager }) {
ok(ui, "An instance of the RDM should be attached to the tab.");
yield setViewportSize(ui, manager, 110, 500);
info("Checking initial width/height properties.");
yield doInitialChecks(ui);
info("Changing the RDM size");
yield setViewportSize(ui, manager, 90, 500);
info("Checking for screen props");
yield checkScreenProps(ui);
info("Setting docShell.deviceSizeIsPageSize to false");
- yield ContentTask.spawn(ui.getViewportMessageManager(), {}, function*() {
+ yield ContentTask.spawn(ui.getViewportMessageManager(), {}, function* () {
let docShell = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.deviceSizeIsPageSize = false;
});
info("Checking for screen props once again.");
yield checkScreenProps2(ui);
@@ -48,17 +48,17 @@ function* checkScreenProps(ui) {
function* checkScreenProps2(ui) {
let { matchesMedia, screen } = yield grabContentInfo(ui);
ok(!matchesMedia, "media query should be re-evaluated.");
is(window.screen.width, screen.width,
"screen.width should be the size of the screen.");
}
function grabContentInfo(ui) {
- return ContentTask.spawn(ui.getViewportMessageManager(), {}, function*() {
+ return ContentTask.spawn(ui.getViewportMessageManager(), {}, function* () {
return {
screen: {
width: content.screen.width,
height: content.screen.height
},
innerWidth: content.innerWidth,
matchesMedia: content.matchMedia("(max-device-width:100px)").matches
};
--- a/devtools/client/responsive.html/test/browser/browser_exit_button.js
+++ b/devtools/client/responsive.html/test/browser/browser_exit_button.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test global exit button
const TEST_URL = "data:text/html;charset=utf-8,";
-addRDMTask(TEST_URL, function*({ ui, manager }) {
+addRDMTask(TEST_URL, function* ({ ui, manager }) {
let { toolWindow } = ui;
let { store } = toolWindow;
// Wait until the viewport has been added
yield waitUntilState(store, state => state.viewports.length == 1);
let exitButton = toolWindow.document.getElementById("global-exit-button");
--- a/devtools/client/responsive.html/test/browser/browser_resize_cmd.js
+++ b/devtools/client/responsive.html/test/browser/browser_resize_cmd.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* global ResponsiveUIManager */
/* eslint key-spacing: 0 */
-add_task(function*() {
+add_task(function* () {
let manager = ResponsiveUIManager;
let done;
function isOpen() {
return ResponsiveUIManager.isActiveForTab(gBrowser.selectedTab);
}
const TEST_URL = "data:text/html;charset=utf-8,hi";
@@ -26,17 +26,17 @@ add_task(function*() {
input: "resize toggle",
hints: "",
markup: "VVVVVVVVVVVVV",
status: "VALID"
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(isOpen(), "responsive mode is open");
}),
},
{
setup() {
done = once(manager, "off");
return helpers.setInput(options, "resize toggle");
@@ -45,17 +45,17 @@ add_task(function*() {
input: "resize toggle",
hints: "",
markup: "VVVVVVVVVVVVV",
status: "VALID"
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(!isOpen(), "responsive mode is closed");
}),
},
]);
});
yield helpers.addTabWithToolbar(TEST_URL, (options) => {
return helpers.audit(options, [
@@ -68,17 +68,17 @@ add_task(function*() {
input: "resize on",
hints: "",
markup: "VVVVVVVVV",
status: "VALID"
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(isOpen(), "responsive mode is open");
}),
},
{
setup() {
done = once(manager, "off");
return helpers.setInput(options, "resize off");
@@ -87,17 +87,17 @@ add_task(function*() {
input: "resize off",
hints: "",
markup: "VVVVVVVVVV",
status: "VALID"
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(!isOpen(), "responsive mode is closed");
}),
},
]);
});
yield helpers.addTabWithToolbar(TEST_URL, (options) => {
return helpers.audit(options, [
@@ -114,17 +114,17 @@ add_task(function*() {
args: {
width: { value: 400 },
height: { value: 400 },
}
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(isOpen(), "responsive mode is open");
}),
},
{
setup() {
done = once(manager, "off");
return helpers.setInput(options, "resize off");
@@ -133,16 +133,16 @@ add_task(function*() {
input: "resize off",
hints: "",
markup: "VVVVVVVVVV",
status: "VALID"
},
exec: {
output: ""
},
- post: Task.async(function*() {
+ post: Task.async(function* () {
yield done;
ok(!isOpen(), "responsive mode is closed");
}),
},
]);
});
});
--- a/devtools/client/responsive.html/test/browser/browser_viewport_basics.js
+++ b/devtools/client/responsive.html/test/browser/browser_viewport_basics.js
@@ -2,29 +2,29 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test viewports basics after opening, like size and location
const TEST_URL = "http://example.org/";
-addRDMTask(TEST_URL, function*({ ui }) {
+addRDMTask(TEST_URL, function* ({ ui }) {
let store = ui.toolWindow.store;
// Wait until the viewport has been added
yield waitUntilState(store, state => state.viewports.length == 1);
// A single viewport of default size appeared
let viewport = ui.toolWindow.document.querySelector(".viewport-content");
is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("width"),
"320px", "Viewport has default width");
is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("height"),
"480px", "Viewport has default height");
// Browser's location should match original tab
yield waitForFrameLoad(ui, TEST_URL);
- let location = yield spawnViewportTask(ui, {}, function*() {
+ let location = yield spawnViewportTask(ui, {}, function* () {
return content.location.href;
});
is(location, TEST_URL, "Viewport location matches");
});
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -35,28 +35,28 @@ registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.devices.url");
Services.prefs.clearUserPref("devtools.responsive.html.enabled");
});
const { ResponsiveUIManager } = Cu.import("resource://devtools/client/responsivedesign/responsivedesign.jsm", {});
/**
* Open responsive design mode for the given tab.
*/
-var openRDM = Task.async(function*(tab) {
+var openRDM = Task.async(function* (tab) {
info("Opening responsive design mode");
let manager = ResponsiveUIManager;
let ui = yield manager.openIfNeeded(window, tab);
info("Responsive design mode opened");
return { ui, manager };
});
/**
* Close responsive design mode for the given tab.
*/
-var closeRDM = Task.async(function*(tab) {
+var closeRDM = Task.async(function* (tab) {
info("Closing responsive design mode");
let manager = ResponsiveUIManager;
yield manager.closeIfNeeded(window, tab);
info("Responsive design mode closed");
});
/**
* Adds a new test task that adds a tab with the given URL, opens responsive
@@ -65,17 +65,17 @@ var closeRDM = Task.async(function*(tab)
*
* Example usage:
*
* addRDMTask(TEST_URL, function*({ ui, manager }) {
* // Your tests go here...
* });
*/
function addRDMTask(url, generator) {
- add_task(function*() {
+ add_task(function* () {
const tab = yield addTab(url);
const results = yield openRDM(tab);
try {
yield* generator(results);
} catch (err) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(err));
}
@@ -85,17 +85,17 @@ function addRDMTask(url, generator) {
});
}
function spawnViewportTask(ui, args, task) {
return ContentTask.spawn(ui.getViewportMessageManager(), args, task);
}
function waitForFrameLoad(ui, targetURL) {
- return spawnViewportTask(ui, { targetURL }, function*(args) {
+ return spawnViewportTask(ui, { targetURL }, function* (args) {
if ((content.document.readyState == "complete" ||
content.document.readyState == "interactive") &&
content.location.href == args.targetURL) {
return;
}
yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded");
});
}
@@ -110,17 +110,17 @@ function waitForViewportResizeTo(ui, wid
info(`Got content-resize to ${width} x ${height}`);
resolve();
};
info(`Waiting for content-resize to ${width} x ${height}`);
ui.on("content-resize", onResize);
});
}
-var setViewportSize = Task.async(function*(ui, manager, width, height) {
+var setViewportSize = Task.async(function* (ui, manager, width, height) {
let size = ui.getViewportSize();
info(`Current size: ${size.width} x ${size.height}, ` +
`set to: ${width} x ${height}`);
if (size.width != width || size.height != height) {
let resized = waitForViewportResizeTo(ui, width, height);
ui.setViewportSize(width, height);
yield resized;
}
--- a/devtools/client/responsive.html/test/unit/test_add_device.js
+++ b/devtools/client/responsive.html/test/unit/test_add_device.js
@@ -5,17 +5,17 @@
// Test adding a new device.
const {
addDevice,
addDeviceType,
} = require("devtools/client/responsive.html/actions/devices");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
let device = {
"name": "Firefox OS Flame",
"width": 320,
"height": 570,
"pixelRatio": 1.5,
--- a/devtools/client/responsive.html/test/unit/test_add_device_type.js
+++ b/devtools/client/responsive.html/test/unit/test_add_device_type.js
@@ -3,17 +3,17 @@
"use strict";
// Test adding a new device type.
const { addDeviceType } =
require("devtools/client/responsive.html/actions/devices");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
dispatch(addDeviceType("phones"));
equal(getState().devices.types.length, 1, "Correct number of device types");
equal(getState().devices.phones.length, 0,
"Defaults to an empty array of phones");
--- a/devtools/client/responsive.html/test/unit/test_add_viewport.js
+++ b/devtools/client/responsive.html/test/unit/test_add_viewport.js
@@ -3,17 +3,17 @@
"use strict";
// Test adding viewports to the page.
const { addViewport } =
require("devtools/client/responsive.html/actions/viewports");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
equal(getState().viewports.length, 0, "Defaults to no viewpots at startup");
dispatch(addViewport());
equal(getState().viewports.length, 1, "One viewport total");
--- a/devtools/client/responsive.html/test/unit/test_change_location.js
+++ b/devtools/client/responsive.html/test/unit/test_change_location.js
@@ -5,17 +5,17 @@
// Test changing the location of the displayed page.
const { changeLocation } =
require("devtools/client/responsive.html/actions/location");
const TEST_URL = "http://example.com";
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
equal(getState().location, "about:blank",
"Defaults to about:blank at startup");
dispatch(changeLocation(TEST_URL));
equal(getState().location, TEST_URL, "Location changed to TEST_URL");
--- a/devtools/client/responsive.html/test/unit/test_change_viewport_device.js
+++ b/devtools/client/responsive.html/test/unit/test_change_viewport_device.js
@@ -9,17 +9,17 @@ const {
addDevice,
addDeviceType,
} = require("devtools/client/responsive.html/actions/devices");
const {
addViewport,
changeDevice,
} = require("devtools/client/responsive.html/actions/viewports");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
dispatch(addDeviceType("phones"));
dispatch(addDevice({
"name": "Firefox OS Flame",
"width": 320,
"height": 570,
--- a/devtools/client/responsive.html/test/unit/test_resize_viewport.js
+++ b/devtools/client/responsive.html/test/unit/test_resize_viewport.js
@@ -3,17 +3,17 @@
"use strict";
// Test resizing the viewport.
const { addViewport, resizeViewport } =
require("devtools/client/responsive.html/actions/viewports");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
dispatch(addViewport());
dispatch(resizeViewport(0, 500, 500));
let viewport = getState().viewports[0];
equal(viewport.width, 500, "Resized width of 500");
--- a/devtools/client/responsive.html/test/unit/test_rotate_viewport.js
+++ b/devtools/client/responsive.html/test/unit/test_rotate_viewport.js
@@ -3,17 +3,17 @@
"use strict";
// Test rotating the viewport.
const { addViewport, rotateViewport } =
require("devtools/client/responsive.html/actions/viewports");
-add_task(function*() {
+add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
dispatch(addViewport());
let viewport = getState().viewports[0];
equal(viewport.width, 320, "Default width of 320");
equal(viewport.height, 480, "Default height of 480");
--- a/devtools/client/storage/test/browser_storage_basic.js
+++ b/devtools/client/storage/test/browser_storage_basic.js
@@ -103,16 +103,16 @@ function* testTables() {
// Check if all the desired items are present in the table
for (let id of item[1]) {
ok(doc.querySelector(".table-widget-cell[data-id='" + id + "']"),
"Table item " + id + " should be present");
}
}
}
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-listings.html");
testTree();
yield testTables();
yield finishTests();
});
--- a/devtools/client/storage/test/browser_storage_cookies_edit.js
+++ b/devtools/client/storage/test/browser_storage_cookies_edit.js
@@ -1,17 +1,17 @@
/* 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/. */
// Basic test to check the editing of cookies.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
showAllColumns(true);
yield editCell("test3", "name", "newTest3");
yield editCell("newTest3", "path", "/");
yield editCell("newTest3", "host", "test1.example.org");
--- a/devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js
+++ b/devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js
@@ -1,17 +1,17 @@
/* 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/. */
// Basic test to check the editing of cookies with the keyboard.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
showAllColumns(true);
yield startCellEdit("test4", "name");
yield typeWithTerminator("test6", "VK_TAB");
yield typeWithTerminator("/", "VK_TAB");
--- a/devtools/client/storage/test/browser_storage_cookies_tab_navigation.js
+++ b/devtools/client/storage/test/browser_storage_cookies_tab_navigation.js
@@ -1,17 +1,17 @@
/* 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/. */
// Basic test to check cookie table tab navigation.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
showAllColumns(true);
yield startCellEdit("test1", "name");
PressKeyXTimes("VK_TAB", 18);
--- a/devtools/client/storage/test/browser_storage_delete.js
+++ b/devtools/client/storage/test/browser_storage_delete.js
@@ -12,17 +12,17 @@ const TEST_CASES = [
[["localStorage", "http://test1.example.org"],
"ls1", "name"],
[["sessionStorage", "http://test1.example.org"],
"ss1", "name"],
[["cookies", "test1.example.org"],
"c1", "name"]
];
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-listings.html");
let contextMenu = gPanelWindow.document.getElementById("storage-table-popup");
let menuDeleteItem = contextMenu.querySelector("#storage-table-popup-delete");
for (let [ [store, host], rowName, cellToClick] of TEST_CASES) {
info(`Selecting tree item ${store} > ${host}`);
yield selectTreeItem([store, host]);
--- a/devtools/client/storage/test/browser_storage_dynamic_updates.js
+++ b/devtools/client/storage/test/browser_storage_dynamic_updates.js
@@ -1,15 +1,15 @@
/* 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";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-updates.html");
let $ = id => gPanelWindow.document.querySelector(id);
let $$ = sel => gPanelWindow.document.querySelectorAll(sel);
gUI.tree.expandAll();
ok(gUI.sidebar.hidden, "Sidebar is initially hidden");
@@ -195,17 +195,17 @@ add_task(function*() {
is($("#value [data-id='ss2']").value, "changed=ss2",
"Value got updated for session storage in the table");
yield findVariableViewProperties([{name: "ss2", value: "changed=ss2"}]);
// Clearing items. Bug 1233497 makes it so that we can no longer yield
// CPOWs from Tasks. We work around this by calling clear via a ContentTask
// instead.
- yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+ yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
return Task.spawn(content.wrappedJSObject.clear);
});
yield gUI.once("store-objects-cleared");
is($$("#value .table-widget-cell").length, 0,
"Table should be cleared");
--- a/devtools/client/storage/test/browser_storage_localstorage_edit.js
+++ b/devtools/client/storage/test/browser_storage_localstorage_edit.js
@@ -1,17 +1,17 @@
/* 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/. */
// Basic test to check the editing of localStorage.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-localstorage.html");
yield selectTreeItem(["localStorage", "http://test1.example.org"]);
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
yield editCell("TestLS1", "name", "newTestLS1");
yield editCell("newTestLS1", "value", "newValueLS1");
--- a/devtools/client/storage/test/browser_storage_overflow.js
+++ b/devtools/client/storage/test/browser_storage_overflow.js
@@ -1,13 +1,13 @@
// Test endless scrolling when a lot of items are present in the storage
// inspector table.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-overflow.html");
let $ = id => gPanelWindow.document.querySelector(id);
let $$ = sel => gPanelWindow.document.querySelectorAll(sel);
gUI.tree.expandAll();
yield selectTreeItem(["localStorage", "http://test1.example.org"]);
--- a/devtools/client/storage/test/browser_storage_search.js
+++ b/devtools/client/storage/test/browser_storage_search.js
@@ -1,12 +1,12 @@
// Tests the filter search box in the storage inspector
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-search.html");
let $$ = sel => gPanelWindow.document.querySelectorAll(sel);
gUI.tree.expandAll();
yield selectTreeItem(["localStorage", "http://test1.example.org"]);
// Results: 0=hidden, 1=visible
let testcases = [
--- a/devtools/client/storage/test/browser_storage_sessionstorage_edit.js
+++ b/devtools/client/storage/test/browser_storage_sessionstorage_edit.js
@@ -1,17 +1,17 @@
/* 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/. */
// Basic test to check the editing of localStorage.
"use strict";
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-sessionstorage.html");
yield selectTreeItem(["sessionStorage", "http://test1.example.org"]);
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
yield editCell("TestSS1", "name", "newTestSS1");
yield editCell("newTestSS1", "value", "newValueSS1");
--- a/devtools/client/storage/test/browser_storage_sidebar.js
+++ b/devtools/client/storage/test/browser_storage_sidebar.js
@@ -92,17 +92,17 @@ const testCases = [
{
sendEscape: true
}, {
location: "obj-s2",
sidebarHidden: false
}
];
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-listings.html");
for (let test of testCases) {
let { location, sidebarHidden, sendEscape } = test;
info("running " + JSON.stringify(test));
if (Array.isArray(location)) {
--- a/devtools/client/storage/test/browser_storage_values.js
+++ b/devtools/client/storage/test/browser_storage_values.js
@@ -111,17 +111,17 @@ const testCases = [
[null, [
{name: "1.id2", value: "1"},
{name: "1.name", value: "foo"},
{name: "1.email", value: "foo@bar.com"},
{name: "1.extra", value: "baz"},
], true]
];
-add_task(function*() {
+add_task(function* () {
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-complex-values.html");
gUI.tree.expandAll();
for (let item of testCases) {
info("clicking for item " + item);
if (Array.isArray(item[0])) {
--- a/devtools/client/storage/test/head.js
+++ b/devtools/client/storage/test/head.js
@@ -88,17 +88,17 @@ function addTab(url) {
* @return {Promise} A promise that resolves after storage inspector is ready
*/
function* openTabAndSetupStorage(url) {
let content = yield addTab(url);
gWindow = content.wrappedJSObject;
// Setup the async storages in main window and for all its iframes
- yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+ yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
/**
* Get all windows including frames recursively.
*
* @param {Window} [baseWindow]
* The base window at which to start looking for child windows
* (optional).
* @return {Set}
* A set of windows.
@@ -133,17 +133,17 @@ function* openTabAndSetupStorage(url) {
/**
* Open the toolbox, with the storage tool visible.
*
* @param cb {Function} Optional callback, if you don't want to use the returned
* promise
*
* @return {Promise} a promise that resolves when the storage inspector is ready
*/
-var openStoragePanel = Task.async(function*(cb) {
+var openStoragePanel = Task.async(function* (cb) {
info("Opening the storage inspector");
let target = TargetFactory.forTab(gBrowser.selectedTab);
let storage, toolbox;
// Checking if the toolbox and the storage are already loaded
// The storage-updated event should only be waited for if the storage
// isn't loaded yet
@@ -218,17 +218,17 @@ function forceCollections() {
}
/**
* Cleans up and finishes the test
*/
function* finishTests() {
// Bug 1233497 makes it so that we can no longer yield CPOWs from Tasks.
// We work around this by calling clear() via a ContentTask instead.
- yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+ yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
/**
* Get all windows including frames recursively.
*
* @param {Window} [baseWindow]
* The base window at which to start looking for child windows
* (optional).
* @return {Set}
* A set of windows.
--- a/devtools/client/styleeditor/StyleEditorUI.jsm
+++ b/devtools/client/styleeditor/StyleEditorUI.jsm
@@ -941,17 +941,17 @@ StyleEditorUI.prototype = {
},
/**
* Launches the responsive mode with a specific width or height
*
* @param {object} options
* Object with width or/and height properties.
*/
- _launchResponsiveMode: Task.async(function*(options = {}) {
+ _launchResponsiveMode: Task.async(function* (options = {}) {
let tab = this._target.tab;
let win = this._target.tab.ownerGlobal;
yield ResponsiveUIManager.runIfNeeded(win, tab);
if (options.width && options.height) {
ResponsiveUIManager.getResponsiveUIForTab(tab).setSize(options.width,
options.height);
} else if (options.width) {
--- a/devtools/client/styleeditor/StyleSheetEditor.jsm
+++ b/devtools/client/styleeditor/StyleSheetEditor.jsm
@@ -574,17 +574,17 @@ StyleSheetEditor.prototype = {
/**
* Highlight nodes matching the selector found at coordinates x,y in the
* editor, if any.
*
* @param {Number} x
* @param {Number} y
*/
- _highlightSelectorAt: Task.async(function*(x, y) {
+ _highlightSelectorAt: Task.async(function* (x, y) {
let pos = this.sourceEditor.getPositionFromCoords({left: x, top: y});
let info = this.sourceEditor.getInfoAt(pos);
if (!info || info.state !== "selector") {
return;
}
let node =
yield this.walker.getStyleSheetOwnerNode(this.styleSheet.actorID);
--- a/devtools/client/styleeditor/test/browser_styleeditor_fetch-from-cache.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_fetch-from-cache.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// A test to ensure Style Editor doesn't bybass cache when loading style sheet
// contents (bug 978688).
const TEST_URL = TEST_BASE_HTTP + "doc_uncached.html";
-add_task(function*() {
+add_task(function* () {
info("Opening netmonitor");
let tab = yield addTab("about:blank");
let target = TargetFactory.forTab(tab);
let toolbox = yield gDevTools.showToolbox(target, "netmonitor");
let netmonitor = toolbox.getPanel("netmonitor");
netmonitor._view.RequestsMenu.lazyUpdate = false;
info("Navigating to test page");
--- a/devtools/client/styleeditor/test/browser_styleeditor_highlight-selector.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_highlight-selector.js
@@ -5,17 +5,17 @@
"use strict";
// Test that hovering over a simple selector in the style-editor requests the
// highlighting of the corresponding nodes
const TEST_URL = "data:text/html;charset=utf8," +
"<style>div{color:red}</style><div>highlighter test</div>";
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(TEST_URL);
let editor = ui.editors[0];
// Mock the highlighter so we can locally assert that things happened
// correctly instead of accessing the highlighter elements
editor.highlighter = {
isShown: false,
options: null,
--- a/devtools/client/styleeditor/test/browser_styleeditor_inline_friendly_names.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_inline_friendly_names.js
@@ -5,17 +5,17 @@
// Test that inline style sheets get correct names if they are saved to disk and
// that those names survice a reload but not navigation to another page.
const FIRST_TEST_PAGE = TEST_BASE_HTTP + "inline-1.html";
const SECOND_TEST_PAGE = TEST_BASE_HTTP + "inline-2.html";
const SAVE_PATH = "test.css";
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(FIRST_TEST_PAGE);
testIndentifierGeneration(ui);
yield saveFirstInlineStyleSheet(ui);
yield testFriendlyNamesAfterSave(ui);
yield reloadPageAndWaitForStyleSheets(ui);
yield testFriendlyNamesAfterSave(ui);
--- a/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar.js
@@ -12,17 +12,17 @@ const RESIZE = 300;
const LABELS = ["not all", "all", "(max-width: 400px)",
"(min-height: 200px) and (max-height: 250px)",
"(max-width: 600px)"];
const LINE_NOS = [1, 7, 19, 25, 30];
const NEW_RULE = "\n@media (max-width: 600px) { div { color: blue; } }";
waitForExplicitFinish();
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(TESTCASE_URI);
is(ui.editors.length, 2, "correct number of editors");
// Test first plain css editor
let plainEditor = ui.editors[0];
yield openEditor(plainEditor);
testPlainEditor(plainEditor);
--- a/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js
@@ -7,17 +7,17 @@
/* Tests responsive mode links for
* @media sidebar width and height related conditions */
const mgr = "resource://devtools/client/responsivedesign/responsivedesign.jsm";
const {ResponsiveUIManager} = Cu.import(mgr, {});
const TESTCASE_URI = TEST_BASE_HTTPS + "media-rules.html";
const responsiveModeToggleClass = ".media-responsive-mode-toggle";
-add_task(function*() {
+add_task(function* () {
let {ui} = yield openStyleEditorForURL(TESTCASE_URI);
let editor = ui.editors[1];
yield openEditor(editor);
let tab = gBrowser.selectedTab;
testNumberOfLinks(editor);
yield testMediaLink(editor, tab, ui, 2, "width", 400);
@@ -101,17 +101,17 @@ function waitForResizeTo(manager, type,
};
info(`Waiting for contentResize to a ${type} of ${value}`);
manager.on("contentResize", onResize);
});
}
function* getSizing() {
let browser = gBrowser.selectedBrowser;
- let sizing = yield ContentTask.spawn(browser, {}, function*() {
+ let sizing = yield ContentTask.spawn(browser, {}, function* () {
return {
width: content.innerWidth,
height: content.innerHeight
};
});
return sizing;
}
--- a/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_sourcemaps.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_sourcemaps.js
@@ -9,17 +9,17 @@ const TESTCASE_URI = TEST_BASE_HTTPS + "
const MAP_PREF = "devtools.styleeditor.source-maps-enabled";
const LABELS = ["screen and (max-width: 320px)",
"screen and (min-width: 1200px)"];
const LINE_NOS = [5, 8];
waitForExplicitFinish();
-add_task(function*() {
+add_task(function* () {
Services.prefs.setBoolPref(MAP_PREF, true);
let { ui } = yield openStyleEditorForURL(TESTCASE_URI);
yield listenForMediaChange(ui);
is(ui.editors.length, 1, "correct number of editors");
--- a/devtools/client/styleeditor/test/browser_styleeditor_new.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_new.js
@@ -4,17 +4,17 @@
"use strict";
// Test that new sheets can be added and edited.
const TESTCASE_URI = TEST_BASE_HTTP + "simple.html";
const TESTCASE_CSS_SOURCE = "body{background-color:red;";
-add_task(function*() {
+add_task(function* () {
let { panel, ui } = yield openStyleEditorForURL(TESTCASE_URI);
let editor = yield createNew(ui, panel.panelWindow);
yield testInitialState(editor);
let originalHref = editor.styleSheet.href;
let waitForPropertyChange = onPropertyChange(editor);
--- a/devtools/client/styleeditor/test/browser_styleeditor_opentab.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_opentab.js
@@ -3,17 +3,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// A test to check the 'Open Link in new tab' functionality in the
// context menu item for stylesheets (bug 992947).
const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html";
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(TESTCASE_URI);
yield rightClickStyleSheet(ui, ui.editors[0]);
is(ui._openLinkNewTabItem.getAttribute("disabled"), "false",
"The menu item is not disabled");
is(ui._openLinkNewTabItem.getAttribute("hidden"), "false",
"The menu item is not hidden");
--- a/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_large.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_large.js
@@ -6,17 +6,17 @@
// Covers the case from Bug 1128747, where loading a sourcemapped
// file prevents the correct editor from being selected on load,
// and causes a second iframe to be appended when the user clicks
// editor in the list.
const TESTCASE_URI = TEST_BASE_HTTPS + "sourcemaps-large.html";
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(TESTCASE_URI);
yield openEditor(ui.editors[0]);
let iframes = ui.selectedEditor.details.querySelectorAll("iframe");
is(iframes.length, 1, "There is only one editor iframe");
ok(ui.selectedEditor.summary.classList.contains("splitview-active"),
"The editor is selected");
--- a/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js
@@ -16,17 +16,17 @@ const TRANSITIONS_PREF = "devtools.style
const CSS_TEXT = "* { color: blue }";
const Cc = Components.classes;
const Ci = Components.interfaces;
const {FileUtils} = Components.utils.import("resource://gre/modules/FileUtils.jsm", {});
const {NetUtil} = Components.utils.import("resource://gre/modules/NetUtil.jsm", {});
-add_task(function*() {
+add_task(function* () {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
[TRANSITIONS_PREF, false]
]}, resolve);
});
// copy all our files over so we don't screw them up for other tests
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
--- a/devtools/client/styleeditor/test/browser_styleeditor_sourcemaps.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_sourcemaps.js
@@ -72,17 +72,17 @@ const contents = {
].join("\n")
};
const cssNames = ["sourcemaps.css", "contained.css", "test-stylus.css"];
const origNames = ["sourcemaps.scss", "contained.scss", "test-stylus.styl"];
waitForExplicitFinish();
-add_task(function*() {
+add_task(function* () {
let {ui} = yield openStyleEditorForURL(TESTCASE_URI);
is(ui.editors.length, 4,
"correct number of editors with source maps enabled");
// Test first plain css editor
testFirstEditor(ui.editors[0]);
--- a/devtools/client/styleeditor/test/browser_styleeditor_sync.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_sync.js
@@ -24,17 +24,17 @@ const expectedText = `
function* closeAndReopenToolbox() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
let { ui: newui } = yield openStyleEditor();
return newui;
}
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
yield selectNode("#testid", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 1);
// Disable the "font-size" property.
let propEditor = ruleEditor.rule.textProps[0].editor;
let onModification = view.once("ruleview-changed");
@@ -62,14 +62,14 @@ add_task(function*() {
ui = yield closeAndReopenToolbox();
editor = yield ui.editors[0].getSourceEditor();
text = editor.sourceEditor.getText();
is(text, expectedText, "changes remain after close and reopen");
// For the time being, the actor does not update the style's owning
// node's textContent. See bug 1205380.
let textContent = yield ContentTask.spawn(gBrowser.selectedBrowser, null,
- function*() {
+ function* () {
return content.document.querySelector("style").textContent;
});
isnot(textContent, expectedText, "changes not written back to style node");
});
--- a/devtools/client/styleeditor/test/browser_styleeditor_syncAddRule.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_syncAddRule.js
@@ -9,17 +9,17 @@
Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/inspector/shared/test/head.js", this);
const TESTCASE_URI = TEST_BASE_HTTP + "sync.html";
const expectedText = `
#testid {
}`;
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
yield selectNode("#testid", inspector);
let onRuleViewChanged = once(view, "ruleview-changed");
view.addRuleButton.click();
yield onRuleViewChanged;
--- a/devtools/client/styleeditor/test/browser_styleeditor_syncAlreadyOpen.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_syncAlreadyOpen.js
@@ -17,17 +17,17 @@ const expectedText = `
color: red;
}
#testid {
/*! font-size: 4em; */
}
`;
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
// In this test, make sure the style editor is open before making
// changes in the inspector.
let { ui } = yield openStyleEditor();
let editor = yield ui.editors[0].getSourceEditor();
--- a/devtools/client/styleeditor/test/browser_styleeditor_syncEditSelector.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_syncEditSelector.js
@@ -17,17 +17,17 @@ const expectedText = `
color: red;
}
#testid, span {
font-size: 4em;
}
`;
-add_task(function*() {
+add_task(function* () {
yield addTab(TESTCASE_URI);
let { inspector, view } = yield openRuleView();
yield selectNode("#testid", inspector);
let ruleEditor = getRuleViewRuleEditor(view, 1);
let editor = yield focusEditableField(view, ruleEditor.selectorText);
editor.input.value = "#testid, span";
let onRuleViewChanged = once(view, "ruleview-changed");
--- a/devtools/client/styleeditor/test/browser_styleeditor_syncIntoRuleView.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_syncIntoRuleView.js
@@ -13,17 +13,17 @@ const TEST_URI = `
<style type='text/css'>
div { background-color: seagreen; }
</style>
<div id='testid' class='testclass'>Styled Node</div>
`;
const TESTCASE_CSS_SOURCE = "#testid { color: chartreuse; }";
-add_task(function*() {
+add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testid", inspector);
let { panel, ui } = yield openStyleEditor();
let editor = yield ui.editors[0].getSourceEditor();
--- a/devtools/client/styleeditor/test/browser_styleeditor_transition_rule.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_transition_rule.js
@@ -3,34 +3,34 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html";
const NEW_RULE = "body { background-color: purple; }";
-add_task(function*() {
+add_task(function* () {
let { ui } = yield openStyleEditorForURL(TESTCASE_URI);
is(ui.editors.length, 2, "correct number of editors");
let editor = ui.editors[0];
yield openEditor(editor);
// Set text twice in a row
let styleChanges = listenForStyleChange(editor.styleSheet);
editor.sourceEditor.setText(NEW_RULE);
editor.sourceEditor.setText(NEW_RULE + " ");
yield styleChanges;
let rules = yield ContentTask.spawn(gBrowser.selectedBrowser, 0,
- function*(index) {
+ function* (index) {
let sheet = content.document.styleSheets[index];
return [...sheet.cssRules].map(rule => rule.cssText);
});
// Test that we removed the transition rule, but kept the rule we added
is(rules.length, 1, "only one rule in stylesheet");
is(rules[0], NEW_RULE, "stylesheet only contains rule we added");
});
--- a/devtools/client/styleeditor/test/browser_styleeditor_xul.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_xul.js
@@ -5,17 +5,17 @@
// Test that the style-editor initializes correctly for XUL windows.
"use strict";
waitForExplicitFinish();
const TEST_URL = TEST_BASE + "doc_xulpage.xul";
-add_task(function*() {
+add_task(function* () {
let tab = yield addTab(TEST_URL);
let target = TargetFactory.forTab(tab);
let toolbox = yield gDevTools.showToolbox(target, "styleeditor");
let panel = toolbox.getCurrentPanel();
ok(panel,
"The style-editor panel did initialize correctly for the XUL window");
--- a/devtools/client/styleeditor/test/head.js
+++ b/devtools/client/styleeditor/test/head.js
@@ -44,75 +44,75 @@ function addTab(url, win) {
return def.promise;
}
/**
* Navigate the currently selected tab to a new URL and wait for it to load.
* @param {String} url The url to be loaded in the current tab.
* @return a promise that resolves when the page has fully loaded.
*/
-var navigateTo = Task.async(function*(url) {
+var navigateTo = Task.async(function* (url) {
info(`Navigating to ${url}`);
let browser = gBrowser.selectedBrowser;
let navigating = promise.defer();
browser.addEventListener("load", function onload() {
browser.removeEventListener("load", onload, true);
navigating.resolve();
}, true);
browser.loadURI(url);
yield navigating.promise;
});
-var navigateToAndWaitForStyleSheets = Task.async(function*(url, ui) {
+var navigateToAndWaitForStyleSheets = Task.async(function* (url, ui) {
let onReset = ui.once("stylesheets-reset");
yield navigateTo(url);
yield onReset;
});
-var reloadPageAndWaitForStyleSheets = Task.async(function*(ui) {
+var reloadPageAndWaitForStyleSheets = Task.async(function* (ui) {
info("Reloading the page.");
let onReset = ui.once("stylesheets-reset");
let browser = gBrowser.selectedBrowser;
yield ContentTask.spawn(browser, null, "() => content.location.reload()");
yield onReset;
});
-registerCleanupFunction(function*() {
+registerCleanupFunction(function* () {
while (gBrowser.tabs.length > 1) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
gBrowser.removeCurrentTab();
}
});
/**
* Open the style editor for the current tab.
*/
-var openStyleEditor = Task.async(function*(tab) {
+var openStyleEditor = Task.async(function* (tab) {
if (!tab) {
tab = gBrowser.selectedTab;
}
let target = TargetFactory.forTab(tab);
let toolbox = yield gDevTools.showToolbox(target, "styleeditor");
let panel = toolbox.getPanel("styleeditor");
let ui = panel.UI;
return { toolbox, panel, ui };
});
/**
* Creates a new tab in specified window navigates it to the given URL and
* opens style editor in it.
*/
-var openStyleEditorForURL = Task.async(function*(url, win) {
+var openStyleEditorForURL = Task.async(function* (url, win) {
let tab = yield addTab(url, win);
let result = yield openStyleEditor(tab);
result.tab = tab;
return result;
});
/**
* Send an async message to the frame script and get back the requested
--- a/devtools/shared/webconsole/js-property-provider.js
+++ b/devtools/shared/webconsole/js-property-provider.js
@@ -450,17 +450,17 @@ function getExactMatchImpl(obj, name, {c
if (prop) {
return prop.value;
}
}
return undefined;
}
var JSObjectSupport = {
- chainIterator: function*(obj) {
+ chainIterator: function* (obj) {
while (obj) {
yield obj;
obj = Object.getPrototypeOf(obj);
}
},
getProperties: function(obj) {
return Object.getOwnPropertyNames(obj);
@@ -468,17 +468,17 @@ var JSObjectSupport = {
getProperty: function() {
// getProperty is unsafe with raw JS objects.
throw new Error("Unimplemented!");
},
};
var DebuggerObjectSupport = {
- chainIterator: function*(obj) {
+ chainIterator: function* (obj) {
while (obj) {
yield obj;
obj = obj.proto;
}
},
getProperties: function(obj) {
return obj.getOwnPropertyNames();
@@ -486,17 +486,17 @@ var DebuggerObjectSupport = {
getProperty: function(obj, name, rootObj) {
// This is left unimplemented in favor to DevToolsUtils.getProperty().
throw new Error("Unimplemented!");
},
};
var DebuggerEnvironmentSupport = {
- chainIterator: function*(obj) {
+ chainIterator: function* (obj) {
while (obj) {
yield obj;
obj = obj.parent;
}
},
getProperties: function(obj) {
let names = obj.names();
--- a/devtools/shared/webconsole/server-logger-monitor.js
+++ b/devtools/shared/webconsole/server-logger-monitor.js
@@ -106,16 +106,17 @@ var ServerLoggerMonitor = {
switch (method) {
case "attachChild":
return this.onAttachChild(msg);
case "detachChild":
return this.onDetachChild(msg);
default:
trace.log("Unknown method name: ", method);
+ return undefined;
}
},
onAttachChild: function(event) {
let target = event.target;
let size = this.targets.size;
trace.log("ServerLoggerMonitor.onAttachChild; size: ", size, target);