Bug 1453246 - Part 2: Add test for avoiding double highlight. r=gl

MozReview-Commit-ID: 1GUuC9Xbrf0

--HG--
extra : rebase_source : 9cd1d8310334d5b0c10cf2030d221691d9fa86a0
This commit is contained in:
Daisuke Akatsuka 2018-06-03 22:52:30 +09:00
Родитель ca72e7b6cc
Коммит dc23fc9878
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -8,6 +8,7 @@
// * unhighlight when mouse out from the above element // * unhighlight when mouse out from the above element
// * lock highlighting when click on the inspect icon in animation target component // * lock highlighting when click on the inspect icon in animation target component
// * add 'highlighting' class to animation target component during locking // * add 'highlighting' class to animation target component during locking
// * mouseover locked target node
// * unlock highlighting when click on the above icon // * unlock highlighting when click on the above icon
// * lock highlighting when click on the other inspect icon // * lock highlighting when click on the other inspect icon
// * if the locked node has multi animations, // * if the locked node has multi animations,
@ -49,6 +50,17 @@ add_task(async function() {
ok(panel.querySelectorAll(".animation-target")[0].classList.contains("highlighting"), ok(panel.querySelectorAll(".animation-target")[0].classList.contains("highlighting"),
"The highlighted element still should have 'highlighting' class"); "The highlighted element still should have 'highlighting' class");
info("Check no highlight event occur by mouse over locked target");
let highlightEventCount = 0;
const highlightEventCounter = () => {
highlightEventCount += 1;
};
toolbox.on("node-highlight", highlightEventCounter);
mouseOverOnTargetNode(animationInspector, panel, 0);
await wait(500);
is(highlightEventCount, 0, "Highlight event should not occur");
toolbox.off("node-highlight", highlightEventCounter);
info("Highlighting another animation target"); info("Highlighting another animation target");
onHighlighterShown = inspector.highlighters.once("box-model-highlighter-shown"); onHighlighterShown = inspector.highlighters.once("box-model-highlighter-shown");
await clickOnInspectIcon(animationInspector, panel, 1); await clickOnInspectIcon(animationInspector, panel, 1);