Bug 1454591 part 4 - Have devtools test not rely on font-family being the first longhand of font shorthand. r=tromey
authorXidorn Quan <me@upsuper.org>
Fri, 04 May 2018 21:13:51 +1000
changeset 473195 d8252b50ec6c19fbf077db94763396ce7aa107dc
parent 473194 eff6d5eb51ceeb5b98c96cdbf08fdb43b7fb1f52
child 473196 9f38c38a66cc7ef461284f4f80c8811f335723b8
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1454591
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1454591 part 4 - Have devtools test not rely on font-family being the first longhand of font shorthand. r=tromey MozReview-Commit-ID: 2URKcAOcCdV
devtools/client/inspector/shared/test/browser_styleinspector_tooltip-shorthand-fontfamily.js
--- a/devtools/client/inspector/shared/test/browser_styleinspector_tooltip-shorthand-fontfamily.js
+++ b/devtools/client/inspector/shared/test/browser_styleinspector_tooltip-shorthand-fontfamily.js
@@ -36,18 +36,25 @@ async function testRuleView(ruleView, no
 
   // Get the computed font family property inside the font rule view
   let propertyList = ruleView.element
     .querySelectorAll(".ruleview-propertylist");
   let fontExpander = propertyList[1].querySelectorAll(".ruleview-expander")[0];
   fontExpander.click();
 
   let rule = getRuleViewRule(ruleView, "#testElement");
-  let valueSpan = rule
-    .querySelector(".ruleview-computed .ruleview-propertyvalue");
+  let computedlist = rule.querySelectorAll(".ruleview-computed");
+  let valueSpan;
+  for (let computed of computedlist) {
+    let propertyName = computed.querySelector(".ruleview-propertyname");
+    if (propertyName.textContent == "font-family") {
+      valueSpan = computed.querySelector(".ruleview-propertyvalue");
+      break;
+    }
+  }
 
   // And verify that the tooltip gets shown on this property
   let previewTooltip = await assertShowPreviewTooltip(ruleView, valueSpan);
 
   let images = panel.getElementsByTagName("img");
   is(images.length, 1, "Tooltip contains an image");
   ok(images[0].getAttribute("src")
     .startsWith("data:"), "Tooltip contains a data-uri image as expected");