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

2DContext: Set up tests for new signature of imageData functions #5180

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

fserb
Copy link
Contributor

@fserb fserb commented Mar 20, 2017

{get,put,create}imageData() functions are reverting from double to long.
Added/cleaned up tests for dealing with float inputs.

Relevant discussion: whatwg/html#2433

{get,put,create}imageData() functions are reverting from double to long.
Added/cleaned up tests for dealing with float inputs.

Relevant discussion: whatwg/html#2433
@wpt-pr-bot
Copy link
Collaborator

Notifying @gsnedders. (Learn how reviewing works.)

fserb added a commit to fserb/html that referenced this pull request Mar 20, 2017
ImageData()'s double arguments had undefined behavior and
implementation incompatibilities. Reverting it to long makes
it well defined.

Fixes whatwg#2433.

Tests:

* web-platform-tests/wpt#5180
@ghost
Copy link

ghost commented Mar 20, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision 7f3069c
Using browser at version BuildID 20170319110229; SourceStamp e1576dd8bd9d3a4ca418cf347133b8a4957ddeca
Starting 10 test iterations
All results were stable

All results

4 tests ran
/2dcontext/pixel-manipulation/2d.imageData.create2.double.html
Subtest Results Messages
OK
createImageData(w, h) double is converted to long PASS
/2dcontext/pixel-manipulation/2d.imageData.create2.zero.html
Subtest Results Messages
OK
createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero FAIL assert_throws: function "function() { ctx.createImageData(0.99, 10); }" did not throw
/2dcontext/pixel-manipulation/2d.imageData.get.double.html
Subtest Results Messages
OK
createImageData(w, h) double is converted to long PASS
/2dcontext/pixel-manipulation/2d.imageData.get.zero.html
Subtest Results Messages
OK
getImageData() throws INDEX_SIZE_ERR if size is zero FAIL assert_throws: function "function() { ctx.getImageData(1, 1, 0.1, 10); }" did not throw

@ghost
Copy link

ghost commented Mar 20, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision 7f3069c
Using browser at version 59.0.3043.0 dev
Starting 10 test iterations
All results were stable

All results

4 tests ran
/2dcontext/pixel-manipulation/2d.imageData.create2.double.html
Subtest Results Messages
OK
createImageData(w, h) double is converted to long FAIL assert_equals: imgdata1.width === 10 (got 11[number], expected 10[number]) expected 10 but got 11
/2dcontext/pixel-manipulation/2d.imageData.create2.zero.html
Subtest Results Messages
OK
createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero FAIL assert_throws: function "function () { ctx.createImageData(0.99, 10); }" did not throw
/2dcontext/pixel-manipulation/2d.imageData.get.double.html
Subtest Results Messages
OK
createImageData(w, h) double is converted to long FAIL assert_equals: imgdata1.width === 10 (got 11[number], expected 10[number]) expected 10 but got 11
/2dcontext/pixel-manipulation/2d.imageData.get.zero.html
Subtest Results Messages
OK
getImageData() throws INDEX_SIZE_ERR if size is zero FAIL assert_throws: function "function () { ctx.getImageData(1, 1, 0.1, 10); }" did not throw

@@ -1,28 +1,30 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
Copy link
Member

Choose a reason for hiding this comment

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

I don't see an update to this tool. Am I missing something or is this direct modification of these tests the wrong way to go?

Copy link
Member

@gsnedders gsnedders Mar 21, 2017

Choose a reason for hiding this comment

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

they come from the tests2d.yaml files

Copy link
Member

Choose a reason for hiding this comment

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

also note we'd get a CI failure if it was modifying only the generated files

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

fserb added a commit to fserb/html that referenced this pull request Mar 21, 2017
ImageData()'s double arguments had undefined behavior and
implementation incompatibilities. Reverting it to long makes
it well defined.

Fixes whatwg#2433.

Tests:

* web-platform-tests/wpt#5180
@annevk annevk merged commit 28c13b6 into web-platform-tests:master Mar 22, 2017
annevk pushed a commit to whatwg/html that referenced this pull request Mar 22, 2017
getImageData(), putImageData(), and createImageData() double arguments had undefined behavior and implementation incompatibilities. Reverting them back to long makes it well defined.

Tests: web-platform-tests/wpt#5180.

Fixes #2433.
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
getImageData(), putImageData(), and createImageData() double arguments had undefined behavior and implementation incompatibilities. Reverting them back to long makes it well defined.

Tests: web-platform-tests/wpt#5180.

Fixes whatwg#2433.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants