Split and isolate every chunk in `test_dom_input_event_on_htmleditor.html` and `test_dom_input_event_on_texteditor.html`
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
Details
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
- https://searchfox.org/mozilla-central/source/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html
- https://searchfox.org/mozilla-central/source/editor/libeditor/tests/test_dom_input_event_on_texteditor.html
Those tests run basic features of HTMLEditor
and TextEditor
, but as you know, those editor classes are too big so that the there are a lot of tests. And some tests depend on previous test result and isolated chunks may not reset everything.
So, I think that each chunk should be encapsulated into a function, and reset function should take an object to reset all things with preferred value.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Indent level of the tests will be increased. Therefore, all descriptions
should be in their own lines.
Note that this and following patches rewrite almost all lines in the test
files again and again. Therefore, it's hard to rebase and existing bugs
will be fixed when I was writing each patch. So, I'd like reviewers just
put inline comment which should be fixed before landing. Then, I'll add
a patch to fix them.
Assignee | ||
Comment 2•4 years ago
|
||
Although, still there are dependencies between the functions, this allows
stack has meaningful name where a failure occurs.
Depends on D94515
Assignee | ||
Comment 3•4 years ago
|
||
So, this removes functions named as *_and_canceling_beforeinput
and
makes corresponding function take an object which has action
and
cancelBeforeInput
to reduce dependency on wider scope variables.
Depends on D94516
Assignee | ||
Comment 4•4 years ago
|
||
This allows the following patches will make all functions use batch function
to test with a framework.
Depends on D94517
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D94518
Assignee | ||
Comment 6•4 years ago
|
||
This patch makes all test functions call runTest()
and it adds event listeners
only while running the function. Therefore, this makes each test function do:
- initializing for running test
- running test with
runTest
and specifying expected data
Depends on D94519
Assignee | ||
Comment 7•4 years ago
|
||
When beforeinput
event is canceled, the editor content shouldn't be modified.
Therefore, runTest()
can handle it with caching initial value before
running the test body.
Additionally, this patch makes every test ensure that target editor has focus.
So, finally, each test is now isolated completely. Developers can run only
a test with commenting out the other tests.
Depends on D94520
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/4cc1e99c7265 part 1: Make sure description of `ok()`, `is()`, etc. have its own line r=m_kato https://hg.mozilla.org/integration/autoland/rev/8e0f42721cd7 part 2: Split each chunk into IIFE r=m_kato https://hg.mozilla.org/integration/autoland/rev/12f9e5ca5023 part 3: Use same function to check canceling "beforeinput" and not canceling it r=m_kato https://hg.mozilla.org/integration/autoland/rev/5363016dd24f part 4: Make all test functions take an object for consistency r=m_kato https://hg.mozilla.org/integration/autoland/rev/0325dbe8ce79 part 5: Create a common method to check editor content, beforeinput event and input event r=m_kato https://hg.mozilla.org/integration/autoland/rev/fd5b832857ba part 6: Encapsulate all variables interacting with event listeners into a function r=m_kato https://hg.mozilla.org/integration/autoland/rev/85bcbc051959 part 7: Make `runTest()` automatically handle editor value check in the case canceling `beforeinput` r=m_kato
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4cc1e99c7265
https://hg.mozilla.org/mozilla-central/rev/8e0f42721cd7
https://hg.mozilla.org/mozilla-central/rev/12f9e5ca5023
https://hg.mozilla.org/mozilla-central/rev/5363016dd24f
https://hg.mozilla.org/mozilla-central/rev/0325dbe8ce79
https://hg.mozilla.org/mozilla-central/rev/fd5b832857ba
https://hg.mozilla.org/mozilla-central/rev/85bcbc051959
Description
•