From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- ...ser_compatibility_event_selected-node-change.js | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js (limited to 'devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js') diff --git a/devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js b/devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js new file mode 100644 index 0000000000..d24f450968 --- /dev/null +++ b/devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js @@ -0,0 +1,86 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test whether the content of the issue list will be changed when the new node is selected. + +const TEST_URI = ` + + +
has issue
+
no issue
+ +`; + +const TEST_DATA_SELECTED = [ + { + selector: ".has-issue", + expectedIssues: [ + { + property: "scrollbar-width", + url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-width", + }, + { + property: "user-modify", + url: "https://developer.mozilla.org/docs/Web/CSS/user-modify", + }, + ], + }, + { + selector: ".no-issue", + expectedIssues: [], + }, + { + selector: "body", + expectedIssues: [ + { + property: "ruby-align", + url: "https://developer.mozilla.org/docs/Web/CSS/ruby-align", + }, + ], + }, +]; + +const TEST_DATA_ALL = [ + { + property: "ruby-align", + url: "https://developer.mozilla.org/docs/Web/CSS/ruby-align", + }, + { + property: "scrollbar-width", + url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-width", + }, + { + property: "user-modify", + url: "https://developer.mozilla.org/docs/Web/CSS/user-modify", + }, +]; + +add_task(async function () { + await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); + + const { allElementsPane, inspector, selectedElementPane } = + await openCompatibilityView(); + + for (const { selector, expectedIssues } of TEST_DATA_SELECTED) { + info(`Check the issue list for ${selector} node`); + await selectNode(selector, inspector); + await assertIssueList(selectedElementPane, expectedIssues); + info("Check whether the issues on all elements pane are not changed"); + await assertIssueList(allElementsPane, TEST_DATA_ALL); + } +}); -- cgit v1.2.3