Closed Bug 902739 Opened 12 years ago Closed 8 years ago

[Test][System] Unit test for Bluetooth

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: alive, Assigned: chsienlee)

References

Details

Attachments

(1 file, 1 obsolete file)

192 bytes, text/html
Details
Bluetooth is the BT API adapter in system. It doesn't have UI, however we still want to test it.
Attached file pull-request (obsolete) —
Attachment #788015 - Flags: review?
Attachment #788015 - Flags: review? → review-
Attached file pull-request.html
Attachment #788016 - Flags: review?
Attachment #788015 - Flags: review-
Attachment #788016 - Flags: review? → review?(alive)
Attachment #788015 - Attachment is obsolete: true
Comment on attachment 788016 [details] pull-request.html I think we should find out what's worthy to test. In this case: * Correct event dispatch * Correct Bluetooth.connected value under different system messages. * Correct Bluetooth.getCurrentProfiles under different system messages. If you are not sure what to write tests, find out the module author and ask him.
Attachment #788016 - Flags: review?(alive)
Attachment #788016 - Flags: review?(alive)
Comment on attachment 788016 [details] pull-request.html Arther, could you please help to list all the cases for profiles to be tested? Thanks. Yuren, do we still need to do replacement in suite setup since we have sinon? I don't think so but I'm not sure.
Attachment #788016 - Flags: feedback?(yurenju.mozilla)
Attachment #788016 - Flags: feedback?(arthur.chen)
Jason, For the bluetooth module in the system app, the following API should be tested: 1. getCurrentProfiles 2. isProfileConnected 3. connected For now there are three profiles, HFPHSP, OPP, and SCO, as you can see in the `Profiles` definition in the module. Each of the profiles corresponds to its own event. Search `_setProfileConnected` in the code to find the events. The idea is to mock the events and check if it performs as expected by using the three APIs listed above.
Comment on attachment 788016 [details] pull-request.html The test cases added in the patch are highly dependent on the internal implementation of the bluetooth module. It requires additional effort to modify the test cases when doing modifications to the implementation in the future. I would suggest only add test cases for the exposed APIs listed as the previous comment. And we also need test cases for the OPP and SCO profiles. Please feel free to let me know if you encounter any problem, Jason.
Attachment #788016 - Flags: feedback?(arthur.chen) → feedback-
Comment on attachment 788016 [details] pull-request.html What arthur says.
Attachment #788016 - Flags: review?(alive)
Comment on attachment 788016 [details] pull-request.html for MockMozSettings.addObserver, sinon will be better than make mock object by yourself.
Attachment #788016 - Flags: feedback?(yurenju.mozilla)
Attachment #788016 - Flags: review+
Comment on attachment 788016 [details] pull-request.html Do you set the wrong flag?
Attachment #788016 - Flags: review+
Attachment #788016 - Flags: review?(arthur.chen)
Comment on attachment 788016 [details] pull-request.html Jason, much better now! But there are some test cases need to be refined. Details pleas check github comments. And please run the test cases on your computer and make sure they are all passed.
Attachment #788016 - Flags: review?(arthur.chen)
Hi Jason, Since we landed a patch to the bluetooth module (https://github.com/mozilla-b2g/gaia/commit/cf8d6e76d823233ec30b095fc69ca82434100cf9). Could you also add a test case for it? We should test all combination of the possible values of telephony.speaker.enabled, connected profiles, and telephony.active.
Comment on attachment 788016 [details] pull-request.html almost rewrite this test.
Attachment #788016 - Flags: review?(arthur.chen)
Jason, thank you for the effort! Currently there are some API changes from the gecko side. So I will review the patch until we finish the corresponding changes of gaia.
Comment on attachment 788016 [details] pull-request.html Jason, good work!! Most of the test cases are the real things that we would like to test. The remaining things are some implementation details. Please check github for my comments, thanks!
Attachment #788016 - Flags: review?(arthur.chen)
Attachment #788016 - Flags: feedback- → review+
Attachment #788016 - Flags: review+ → review?(arthur.chen)
Comment on attachment 788016 [details] pull-request.html Good work! Please check my comments in github for the tests including async functions. Feel free to let me know if you have any question.
Attachment #788016 - Flags: review?(arthur.chen)
Attachment #788016 - Flags: review?(arthur.chen)
Comment on attachment 788016 [details] pull-request.html We're almost there! Please address my last comment in github. Thanks!
Attachment #788016 - Flags: review?(arthur.chen)
Resolve as WONTFIX since Firefox OS is discontinued.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: