Files
sousa-gecko/testing/web-platform/tests/css/selectors/old-tests/common.js
T
Kent Tamura 9e899c3d77 Bug 2051540 [wpt PR 60992] - css/selectors: Automate a part of legacy selectors tests (120 to 139), a=testonly
Automatic update from web-platform-tests
css/selectors: Automate a part of legacy selectors tests (120 to 139)

Change-Id: I1c7bbb9a3287c068c6cd711e481f137d2914db1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8022122
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1655098}

--

wpt-commits: 58970eced72cb32f9ecb6aac8475afdd44424a98
wpt-pr: 60992
2026-07-10 09:22:56 +00:00

19 lines
857 B
JavaScript

const LIME = 'rgb(0, 255, 0)';
const GREEN = 'rgb(0, 128, 0)';
const RED = 'rgb(255, 0, 0)';
function assert_background_color(elementOrId, colorString, comment) {
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
assert_equals(getComputedStyle(element).backgroundColor, colorString, comment);
}
function assert_not_background_color(elementOrId, colorString, comment) {
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
assert_not_equals(getComputedStyle(element).backgroundColor, colorString, comment);
}
function assert_color(elementOrId, colorString, comment) {
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
assert_equals(getComputedStyle(element).color, colorString, comment);
}