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•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 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•5 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•5 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•5 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•5 years ago
|
||
Depends on D94518
| Assignee | ||
Comment 6•5 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
runTestand specifying expected data
Depends on D94519
| Assignee | ||
Comment 7•5 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
Comment 9•5 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
•