Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[geometry] Test that DOMMatrix CSS parsing is not exposed in workers #5769

Merged
merged 3 commits into from May 4, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions css/geometry-1/DOMMatrix-css-string.worker.js
@@ -0,0 +1,18 @@
// https://drafts.fxtf.org/geometry/#DOMMatrix

importScripts("/resources/testharness.js");

['DOMMatrix', 'DOMMatrixReadOnly'].forEach(constr => {
test(() => {
assert_true(constr in self, `${constr} is not supported`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this fails, it will be "assert_true: DOMMatrix is not supported expected true got false". In other words, the description is inverted, if it describes the expected value (maybe "self.${constr} exists") then the message will make sense. Or just no description since there's just one assert_true in the test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to ${constr} should exist

assert_throws(new TypeError(), () => new self[constr]('matrix(1,0,0,1,0,0)') );
}, `${constr} constructor with string argument in worker`);
});

test(() => {
assert_false('setMatrixValue' in DOMMatrix.prototype, 'on prototype');
const matrix = new DOMMatrix();
assert_false('setMatrixValue' in matrix, 'on instance');
}, 'DOMMatrix setMatrixValue in worker');

done();
3 changes: 3 additions & 0 deletions lint.whitelist
Expand Up @@ -769,6 +769,9 @@ CSS-COLLIDING-SUPPORT-NAME: css/css-display-3/support/util.js
CSS-COLLIDING-SUPPORT-NAME: css/CSS2/normal-flow/support/replaced-min-max-1.png
CSS-COLLIDING-SUPPORT-NAME: css/vendor-imports/mozilla/mozilla-central-reftests/ui3/support/replaced-min-max-1.png

# TODO https://github.com/w3c/web-platform-tests/issues/5770
MISSING-LINK: css/geometry-1/DOMMatrix-css-string.worker.js

WEBIDL2.JS:.gitmodules

# Manual test that uses console.logs for feedback
Expand Down