Backed out 2 changesets (bug 1659498, bug 1834946) for causing compatibility related...
[gecko.git] / devtools / client / inspector / compatibility / test / browser / browser_compatibility_css-property_issue.js
blob0ee6fd7960c298de532786fad81638f80aaf4dcb
1 /* Any copyright is dedicated to the Public Domain.
2    http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 // Test whether the deprecated CSS property is shown as issue correctly or not.
8 const {
9   COMPATIBILITY_ISSUE_TYPE,
10 } = require("resource://devtools/shared/constants.js");
12 const TEST_URI = `
13   <style>
14   body {
15     color: blue;
16     scrollbar-width: thin;
17     user-modify: read-only;
18   }
19   div {
20     ruby-align: center;
21   }
22   </style>
23   <body>
24     <div>test</div>
25   </body>
28 const TEST_DATA_SELECTED = [
29   {
30     type: COMPATIBILITY_ISSUE_TYPE.CSS_PROPERTY,
31     property: "scrollbar-width",
32     url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-width",
33     deprecated: false,
34     experimental: false,
35   },
36   {
37     type: COMPATIBILITY_ISSUE_TYPE.CSS_PROPERTY_ALIASES,
38     property: "user-modify",
39     url: "https://developer.mozilla.org/docs/Web/CSS/user-modify",
40     aliases: ["user-modify"],
41     deprecated: true,
42     experimental: false,
43   },
46 const TEST_DATA_ALL = [
47   ...TEST_DATA_SELECTED,
48   {
49     type: COMPATIBILITY_ISSUE_TYPE.CSS_PROPERTY,
50     property: "ruby-align",
51     url: "https://developer.mozilla.org/docs/Web/CSS/ruby-align",
52     deprecated: false,
53     experimental: true,
54   },
57 add_task(async function () {
58   await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
60   const { allElementsPane, selectedElementPane } =
61     await openCompatibilityView();
63   info("Check the content of the issue list on the selected element");
64   await assertIssueList(selectedElementPane, TEST_DATA_SELECTED);
66   info("Check the content of the issue list on all elements");
67   await assertIssueList(allElementsPane, TEST_DATA_ALL);
68 });