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

Expand coverage on value-changing/selection-changing tests #5610

Merged
merged 2 commits into from
Apr 25, 2017

Conversation

domenic
Copy link
Member

@domenic domenic commented Apr 19, 2017

This is a follow-up to #5147. It tests the clarification at whatwg/html#2560. While there, it also adds additional textarea test cases for line-ending normalization; previously the test only tested an in-document textarea.

@bzbarsky to review


This change is Reviewable

This is a follow-up to #5147. It tests the clarification at whatwg/html#2560. While there, it also adds additional textarea test cases for line-ending normalization; previously the test only tested an in-document textarea.
@wpt-pr-bot
Copy link
Collaborator

Notifying @ayg. (Learn how reviewing works.)

@ghost
Copy link

ghost commented Apr 19, 2017

View the complete job log.

Lint

Passed

@ghost
Copy link

ghost commented Apr 19, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision f1edca9
Using browser at version BuildID 20170420100256; SourceStamp 27311156637f9b5d4504373967e01c4241902ae7
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/semantics/forms/textfieldselection/selection-after-content-change.html
Subtest Results Messages
OK
input out of document: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
input out of document: selection must change when setting a different value FAIL assert_true: selectionDirection must be set to either none or forward expected true got false
input out of document: selection must not change when setting a value that becomes the same after the value sanitization algorithm FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document: selection must change when setting a different value FAIL assert_true: selectionDirection must be set to either none or forward expected true got false
input in document: selection must not change when setting a value that becomes the same after the value sanitization algorithm FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document, with focus: selection must not change when setting the same value PASS
input in document, with focus: selection must change when setting a different value PASS
input in document, with focus: selection must not change when setting a value that becomes the same after the value sanitization algorithm PASS
textarea out of document: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
textarea out of document: selection must change when setting a different value FAIL assert_equals: selectionDirection must be reset to forward (which was previously observed to be the value after resetting the selection direction) expected "forward" but got "backward"
textarea out of document: selection must not change when setting the same normalized value FAIL assert_equals: selectionStart must not change when setting to CRLF expected 1 but got 6
textarea in document: selection must not change when setting the same value PASS
textarea in document: selection must change when setting a different value PASS
textarea in document: selection must not change when setting the same normalized value FAIL assert_equals: selectionStart must not change when setting to CRLF expected 1 but got 6
textarea in document, with focus: selection must not change when setting the same value PASS
textarea in document, with focus: selection must change when setting a different value PASS
textarea in document, with focus: selection must not change when setting the same normalized value FAIL assert_equals: selectionStart must not change when setting to CRLF expected 1 but got 6

@ghost
Copy link

ghost commented Apr 19, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision f1edca9
Using browser at version 59.0.3071.9 dev
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/semantics/forms/textfieldselection/selection-after-content-change.html
Subtest Results Messages
OK
input out of document: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
input out of document: selection must change when setting a different value PASS
input out of document: selection must not change when setting a value that becomes the same after the value sanitization algorithm FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document: selection must change when setting a different value PASS
input in document: selection must not change when setting a value that becomes the same after the value sanitization algorithm FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document, with focus: selection must not change when setting the same value FAIL assert_equals: selectionStart must not change expected 1 but got 5
input in document, with focus: selection must change when setting a different value PASS
input in document, with focus: selection must not change when setting a value that becomes the same after the value sanitization algorithm FAIL assert_equals: selectionStart must not change expected 1 but got 5
textarea out of document: selection must not change when setting the same value PASS
textarea out of document: selection must change when setting a different value PASS
textarea out of document: selection must not change when setting the same normalized value PASS
textarea in document: selection must not change when setting the same value PASS
textarea in document: selection must change when setting a different value PASS
textarea in document: selection must not change when setting the same normalized value PASS
textarea in document, with focus: selection must not change when setting the same value PASS
textarea in document, with focus: selection must change when setting a different value PASS
textarea in document, with focus: selection must not change when setting the same normalized value PASS

@codecov-io
Copy link

codecov-io commented Apr 19, 2017

Codecov Report

Merging #5610 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5610   +/-   ##
=======================================
  Coverage   87.22%   87.22%           
=======================================
  Files          24       24           
  Lines        2418     2418           
  Branches      406      406           
=======================================
  Hits         2109     2109           
  Misses        239      239           
  Partials       70       70

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9894f6d...5567ae7. Read the comment docs.

function runInputTest(descriptor, elementFactory) {
runTest(descriptor, elementFactory);

test(() => {
Copy link
Contributor

@bzbarsky bzbarsky Apr 20, 2017

Choose a reason for hiding this comment

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

This test fails, because in the "input in document" case elementFactory just keeps returning the same node without doing anything to its value. runTest will set the value to "hello", then to "hello2". Then this test will run and set it to a value that sanitizes to "hello", which is not the same as "hello2", so the cursor will get moved.

Presumably the "input in document" case needs to reset value just like the "input in document, with focus" case does.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed!

@domenic
Copy link
Member Author

domenic commented Apr 24, 2017

@bzbarsky ping

@bzbarsky
Copy link
Contributor

Sorry, didn't realize you were waiting on me. Looks good to me.

@domenic domenic merged commit 91bdf59 into master Apr 25, 2017
@domenic domenic deleted the value-sanitization-selection branch April 25, 2017 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants