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 417111 d8252b50ec6c19fbf077db94763396ce7aa107dc
parent 417110 eff6d5eb51ceeb5b98c96cdbf08fdb43b7fb1f52
child 417112 9f38c38a66cc7ef461284f4f80c8811f335723b8
push id63638
push userxquan@mozilla.com
push dateMon, 07 May 2018 00:39:22 +0000
treeherderautoland@881670154df0 [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");