browser/devtools/markupview/test/browser_markupview_highlight_hover_01.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* vim: set ts=2 et sw=2 tw=80: */
     2 /* Any copyright is dedicated to the Public Domain.
     3  http://creativecommons.org/publicdomain/zero/1.0/ */
     5 "use strict";
     7 // Test that when first hovering over a node and immediately after selecting it
     8 // by clicking on it leaves the highlighter visible for as long as the mouse is
     9 // over the node
    11 let test = asyncTest(function*() {
    12   let {inspector} = yield addTab("data:text/html,<p>It's going to be legen....</p>").then(openInspector);
    13   let p = getNode("p");
    15   info("hovering over the <p> line in the markup-view");
    16   yield hoverContainer(p, inspector);
    17   ok(isHighlighterVisible(), "the highlighter is still visible");
    19   info("selecting the <p> line by clicking in the markup-view");
    20   yield clickContainer(p, inspector);
    22   p.textContent = "wait for it ....";
    23   info("wait and see if the highlighter stays visible even after the node was selected");
    24   yield waitForTheBrieflyShowBoxModelTimeout();
    26   let updated = inspector.once("inspector-updated");
    27   p.textContent = "dary!!!!";
    28   ok(isHighlighterVisible(), "the highlighter is still visible");
    29   yield updated;
    30 });
    32 function waitForTheBrieflyShowBoxModelTimeout() {
    33   let deferred = promise.defer();
    34   // Note that the current timeout is 1 sec and is neither configurable nor
    35   // exported anywhere we can access, so hard-coding the timeout
    36   content.setTimeout(deferred.resolve, 1500);
    37   return deferred.promise;
    38 }

mercurial