Closed Bug 987533 Opened 6 years ago Closed 6 years ago

[keyboard refactor] breakdown MockEventTarget, MockInputMethod, and MockInputContext from input_field_test.js

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
1.4 S6 (25apr)

People

(Reporter: gduan, Assigned: timdream)

References

Details

Attachments

(1 file)

Follow-up bug of bug 977452
 
We may need to breakdown MockEventTarget, MockInputMethod, and MockInputContext from input_field_test.js.
Summary: [keyboard refactor] break down mocks mocks from input_field.test → [keyboard refactor] breakdown MockEventTarget, MockInputMethod, and MockInputContext from input_field_test.js
Taking, and I will implement this bug by converting MockDOMRequest.
Assignee: nobody → timdream
Pull request updated with all the mocks, I am now converting the input_field.js tests.
Comment on attachment 8397833 [details] [review]
mozilla-b2g:master PR#17709

Jan, could you review the input_method_test.js?
Alive, could you review the mocks?
Attachment #8397833 - Flags: review?(janjongboom)
Attachment #8397833 - Flags: review?(alive)
Comment on attachment 8397833 [details] [review]
mozilla-b2g:master PR#17709

r+ for mock-event-target part.
Attachment #8397833 - Flags: review?(alive) → review+
Comment on attachment 8397833 [details] [review]
mozilla-b2g:master PR#17709

I don't think we're actually testing anything here at the moment. Yeah, if properties are copied correct from a mocked object. But that's all there is, and I doubt if that required a 500 line test file to be honest.

I would rather like to test this against the real mozInputMethod as I don't think these tests will ever catch a regression or make more to the point tests.

Leaving r? open for now to get some feedback :-)
Flags: needinfo?(timdream)
The purpose of input_field_test.js is to test the input_field.js. If you want to test the API part we would need to write integration tests.

That said, we do need to verify the mock is indeed interact with InputField in the correct sequence. It would be worthy of to figure out we have enough mochitests for API in Gecko too.
Flags: needinfo?(timdream)
Flags: needinfo?(janjongboom)
All the tests assume that promises will always resolve positively; but that's not the case (e.g. keypress gets preventDefaulted). Are we covering this in a follow up issue in the end?
Flags: needinfo?(janjongboom) → needinfo?(timdream)
(In reply to Jan Jongboom [:janjongboom] from comment #9)
> All the tests assume that promises will always resolve positively; but
> that's not the case (e.g. keypress gets preventDefaulted). Are we covering
> this in a follow up issue in the end?

Right, I filed bug 994583.
Flags: needinfo?(timdream)
Flags: needinfo?(janjongboom)
Comment on attachment 8397833 [details] [review]
mozilla-b2g:master PR#17709

r=me.
Attachment #8397833 - Flags: review?(janjongboom) → review+
Flags: needinfo?(janjongboom)
master: https://github.com/mozilla-b2g/gaia/commit/6cfe96ba5c2be43688c1493364fa08f1904eef99
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S6 (25apr)
You need to log in before you can comment on or make changes to this bug.