Closed Bug 919370 Opened 11 years ago Closed 11 years ago

[Test][Keyboard] Unit test for Pinyin IME

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lchang, Assigned: lchang)

References

Details

Attachments

(1 file, 1 obsolete file)

We need a unit test for Pinyin IME especially for its engine library.
Attached file Pull Request 13161 (obsolete) (deleted) —
Rudy, Could you please help review this unit-testing patch in your spare time? Thanks a lot!
Attachment #823791 - Flags: review?(rlu)
Depends on: 932234
Comment on attachment 823791 [details] Pull Request 13161 r+ for tests only patch. 2 questions, 1. I guess we don't need to mock indexedDB. 2. Do you think we should remove the test page since now we have unit tests? apps/keyboard/js/imes/jspinyin/tests/index.html Thanks for making the pinyin more robust.
Attachment #823791 - Flags: review?(rlu) → review+
Rudy, Thanks for reviewing. About the questions, 1. Yes, we don't need the mock indexedDB if we push the prepared data into indexedDB in "setup" stage. I think, however, we can keep the mock indexedDB because it can help us to test the behavior of the engine when indexedDB failed. 2. Since "jspinyin/tests/index.html" can be used to measure the performance of the pinyin engine, I propose to leave it as-is.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Sadly I think this breaks the other keyboard tests (via some test runner bug) unless I am missing something entirely I don't see 300~ or so of the tests that where there before. You can verify this by looking at the number of tests passed in your PR vs right before
This is sad but I backed out the merge: https://github.com/mozilla-b2g/gaia/commit/c43efb5defdd97f778fab95354fe5df9d37a6665 We need to figure out what happened to the other tests =/
Status: RESOLVED → REOPENED
Flags: needinfo?(lchang)
Flags: needinfo?(jlal)
Resolution: FIXED → ---
Really thanks for backing out. I will look into it soon!
Flags: needinfo?(lchang)
I found the issue is caused by the conflict of global variables like "InputMethods." I tried to isolate all the global variables I used and also modified the latin and suggest unit test to prevent this situation. Rudy, could you please review it again when you are free? Thanks a lot.
Attachment #823791 - Attachment is obsolete: true
Attachment #826242 - Flags: review?(rlu)
Attachment #826242 - Flags: feedback?(jlal)
Comment on attachment 826242 [details] Pull Request: https://github.com/mozilla-b2g/gaia/pull/13222 I guess this is just a workaround for the issue you found in testing framework. r+ if the following call is ok to exist in latin_test.js - suiteSetup(init); Please also file a bug for the overall issue about global var and better to have a simple test case there to identify the problem easily. Thanks for your work, great job!
Attachment #826242 - Flags: review?(rlu) → review+
Rudy, thanks for your review. I will make further investigation to confirm whether it is a bug or not and then file a bug.
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
clear ni.
Flags: needinfo?(jlal)
Attachment #826242 - Flags: feedback?(jlal)
Attachment #826242 - Flags: feedback?(jlal)
Flags: needinfo?(jlal)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: