diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js')
-rw-r--r-- | devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js b/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js new file mode 100644 index 000000000..214a33bd4 --- /dev/null +++ b/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js @@ -0,0 +1,91 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const LAYOUT_ERRORS_L10N = + new LocalizationHelper("toolkit/locales/layout_errors.properties"); + +// Test that when an animation is selected, its list of animated properties is +// displayed below it. + +const EXPECTED_PROPERTIES = [ + "background-attachment", + "background-clip", + "background-color", + "background-image", + "background-origin", + "background-position-x", + "background-position-y", + "background-repeat", + "background-size", + "border-bottom-left-radius", + "border-bottom-right-radius", + "border-top-left-radius", + "border-top-right-radius", + "filter", + "height", + "transform", + "width" +].sort(); + +add_task(function* () { + yield addTab(URL_ROOT + "doc_keyframes.html"); + let {panel} = yield openAnimationInspector(); + let timeline = panel.animationsTimelineComponent; + let propertiesList = timeline.rootWrapperEl + .querySelector(".animated-properties"); + + ok(!isNodeVisible(propertiesList), + "The list of properties panel is hidden by default"); + + info("Click to select the animation"); + yield clickOnAnimation(panel, 0); + + ok(isNodeVisible(propertiesList), + "The list of properties panel is shown"); + ok(propertiesList.querySelectorAll(".property").length, + "The list of properties panel actually contains properties"); + ok(hasExpectedProperties(propertiesList), + "The list of properties panel contains the right properties"); + + ok(hasExpectedWarnings(propertiesList), + "The list of properties panel contains the right warnings"); + + info("Click to unselect the animation"); + yield clickOnAnimation(panel, 0, true); + + ok(!isNodeVisible(propertiesList), + "The list of properties panel is hidden again"); +}); + +function hasExpectedProperties(containerEl) { + let names = [...containerEl.querySelectorAll(".property .name")] + .map(n => n.textContent) + .sort(); + + if (names.length !== EXPECTED_PROPERTIES.length) { + return false; + } + + for (let i = 0; i < names.length; i++) { + if (names[i] !== EXPECTED_PROPERTIES[i]) { + return false; + } + } + + return true; +} + +function hasExpectedWarnings(containerEl) { + let warnings = [...containerEl.querySelectorAll(".warning")]; + for (let warning of warnings) { + let warningID = + "CompositorAnimationWarningTransformWithGeometricProperties"; + if (warning.getAttribute("title") == LAYOUT_ERRORS_L10N.getStr(warningID)) { + return true; + } + } + return false; +} |