Bug 1310310 - fixing tests
MozReview-Commit-ID: wbrJkHmsIn
--- a/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
+++ b/devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js
@@ -30,14 +30,15 @@ add_task(function* () {
yield verifyLinkText(view, CSS_LOC);
Services.prefs.clearUserPref(PREF);
});
function verifyLinkText(view, text) {
info("Verifying that the rule-view stylesheet link is " + text);
- let label = getRuleViewLinkByIndex(view, 1).querySelector("label");
+ let label = getRuleViewLinkByIndex(view, 1)
+ .querySelector(".ruleview-rule-source-label");
return waitForSuccess(
- () => label.getAttribute("value") == text,
+ () => label.textContent == text,
"Link text changed to display correct location: " + text
);
}
--- a/devtools/client/inspector/rules/test/browser_rules_original-source-link.js
+++ b/devtools/client/inspector/rules/test/browser_rules_original-source-link.js
@@ -72,13 +72,14 @@ function editorSelected(editor) {
"selected stylesheet is correct one");
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");
+ let label = getRuleViewLinkByIndex(view, 1)
+ .querySelector(".ruleview-rule-source-label");
return waitForSuccess(function* () {
- return label.getAttribute("value") == text;
+ return label.textContent == text;
}, "Link text changed to display correct location: " + text);
}
--- a/devtools/client/inspector/rules/test/browser_rules_style-editor-link.js
+++ b/devtools/client/inspector/rules/test/browser_rules_style-editor-link.js
@@ -175,18 +175,18 @@ function* testDisabledStyleEditor(view,
is(toolbox.currentToolId, "styleeditor", "Style Editor should be selected");
Services.prefs.clearUserPref("devtools.styleeditor.enabled");
}
function testRuleViewLinkLabel(view) {
let link = getRuleViewLinkByIndex(view, 2);
let labelElem = link.querySelector(".ruleview-rule-source-label");
- let value = labelElem.getAttribute("value");
- let tooltipText = labelElem.getAttribute("tooltiptext");
+ let value = labelElem.textContent;
+ let tooltipText = labelElem.getAttribute("title");
is(value, EXTERNAL_STYLESHEET_FILE_NAME + ":1",
"rule view stylesheet display value matches filename and line number");
is(tooltipText, EXTERNAL_STYLESHEET_URL + ":1",
"rule view stylesheet tooltip text matches the full URI path");
}
function testUnselectableRuleViewLink(view, index) {
--- a/devtools/client/inspector/rules/test/head.js
+++ b/devtools/client/inspector/rules/test/head.js
@@ -471,17 +471,17 @@ function getRuleViewLinkByIndex(view, in
* @param {CssRuleView} view
* The instance of the rule-view panel
* @param {Number} index
* The index of the link to get
* @return {String} The string at this index
*/
function getRuleViewLinkTextByIndex(view, index) {
let link = getRuleViewLinkByIndex(view, index);
- return link.querySelector(".ruleview-rule-source-label").value;
+ return link.querySelector(".ruleview-rule-source-label").textContent;
}
/**
* Simulate adding a new property in an existing rule in the rule-view.
*
* @param {CssRuleView} view
* The instance of the rule-view panel
* @param {Number} ruleIndex
--- a/devtools/client/inspector/shared/test/head.js
+++ b/devtools/client/inspector/shared/test/head.js
@@ -415,17 +415,17 @@ function getRuleViewLinkByIndex(view, in
* @param {CssRuleView} view
* The instance of the rule-view panel
* @param {Number} index
* The index of the link to get
* @return {String} The string at this index
*/
function getRuleViewLinkTextByIndex(view, index) {
let link = getRuleViewLinkByIndex(view, index);
- return link.querySelector(".ruleview-rule-source-label").value;
+ return link.querySelector(".ruleview-rule-source-label").textContent;
}
/**
* 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