[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 173/311: Bug 1721743 - [devtools] Wait for ruleview property in browser_rules_preview-tooltips-sizes.js r=nchevobbe a=test-only DONTBUILD



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit cdf56dc6a8d0b7e404d823003fa3d048db1bc137
Author: Julian Descottes <jdescottes@xxxxxxxxxxx>
AuthorDate: Wed Mar 16 11:55:26 2022 +0200

    Bug 1721743 - [devtools] Wait for ruleview property in browser_rules_preview-tooltips-sizes.js r=nchevobbe a=test-only DONTBUILD
    
    Differential Revision: https://phabricator.services.mozilla.com/D141106
---
 .../test/browser_rules_preview-tooltips-sizes.js      | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js b/devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js
index f2adde79952e4..cd2d39132f36a 100644
--- a/devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js
+++ b/devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js
@@ -23,7 +23,7 @@ add_task(async function() {
           --test-var-wider-than-image: red;
         }
 
-        div {
+        #target {
           color: var(--test-var-wider-than-image);
           background: url(${BASE_64_URL});
         }
@@ -34,15 +34,26 @@ add_task(async function() {
   const { inspector, view } = await openRuleView();
   await selectNode("#target", inspector);
 
+  // Note: See intermittent Bug 1721743.
+  // On linux webrender opt, the inspector might open the ruleview before it has
+  // been populated with the rules for the div.
+  info("Wait until the rule view property is rendered");
+  const colorPropertyElement = await waitFor(() =>
+    getRuleViewProperty(view, "#target", "color")
+  );
+
   // Retrieve the element for `--test-var` on which the CSS variable tooltip will appear.
-  const colorPropertySpan = getRuleViewProperty(view, "div", "color").valueSpan;
+  const colorPropertySpan = colorPropertyElement.valueSpan;
   const colorVariableElement = colorPropertySpan.querySelector(
     ".ruleview-variable"
   );
 
   // Retrieve the element for the background url on which the image preview will appear.
-  const backgroundPropertySpan = getRuleViewProperty(view, "div", "background")
-    .valueSpan;
+  const backgroundPropertySpan = getRuleViewProperty(
+    view,
+    "#target",
+    "background"
+  ).valueSpan;
   const backgroundUrlElement = backgroundPropertySpan.querySelector(
     ".theme-link"
   );

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits