Closed
Bug 1015901
Opened 12 years ago
Closed 12 years ago
Wifi on emulator doesn't remember networks
Categories
(Firefox OS Graveyard :: Wifi, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S3 (6june)
People
(Reporter: hchang, Assigned: hchang)
Details
(Whiteboard: [p=1])
Attachments
(2 files, 2 obsolete files)
Bug 991025 enables wifi on emulator. But the lack of "update_config=1" in the template wpa_supplicant.conf makes it unable to remember APs that we have ever connected. We should add "update_config=1" to [1]
[1] https://github.com/mozilla-b2g/device_generic_goldfish/blob/master/wifi/wpa_supplicant.conf
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → hchang
| Assignee | ||
Updated•12 years ago
|
Whiteboard: [p=1]
Target Milestone: --- → 2.0 S3 (6june)
| Assignee | ||
Comment 1•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Attachment #8429722 -
Flags: review?(vyang)
Comment 2•12 years ago
|
||
Comment on attachment 8429722 [details]
https://github.com/mozilla-b2g/device_generic_goldfish/pull/14/files
Test cases?
| Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #2)
> Comment on attachment 8429722 [details]
> https://github.com/mozilla-b2g/device_generic_goldfish/pull/14/files
>
> Test cases?
There will a test case based on http://hg.mozilla.org/mozilla-central/file/83ad75d867af/dom/wifi/test/marionette/head.js
Probably need to test with |dontConnect| flag [1] as well.
[1] http://hg.mozilla.org/mozilla-central/file/83ad75d867af/dom/webidl/MozWifiManager.webidl#l91
| Assignee | ||
Comment 4•12 years ago
|
||
| Assignee | ||
Comment 5•12 years ago
|
||
Try run result: https://tbpl.mozilla.org/?tree=Try&rev=b7c442017b69
with the attached patch and PR applied.
| Assignee | ||
Comment 6•12 years ago
|
||
Comment on attachment 8433258 [details] [diff] [review]
Test cases
Hi vicamo, I attached the test cases for the modification of the template wpa_supplicant.conf. The main idea is, without the line "update_config=1" in the template wpa_supplicant.conf, the config file will never be updated to remember the ever connected network information. As a result, if we get connected to certain AP and re-enable Wifi, it will not automatically connect to the AP we connected before. This "re-enable" scenario is what "test_wifi_auto_connect.js" wants to test.
Besides, we can also test "update_config=1" in different aspect: MozWifiManager::getKnwonNetworks. |getKnownNetworks| internally requests wpa_supplicant to parse the config file and reports the remembered networks. "test_wifi_associate_wo_connect.js" attempts to associate but not connect to certain AP and check if |getKnownNetworks| returns that AP. We have to use the flag |dontConnect| because |getKnownNetworks| will return the remembered networks as well as the active networks.
Thanks!
Attachment #8433258 -
Flags: feedback?(vyang)
| Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 8433258 [details] [diff] [review]
Test cases
Review of attachment 8433258 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/wifi/test/marionette/test_wifi_associate_wo_connect.js
@@ +46,5 @@
> + return;
> + }
> + throw 'Got unexpected connected event!';
> + });
> +}
I will remove the flag |timeout| and throw a boolean to indicate if this promise is resolved or not.
| Assignee | ||
Comment 8•12 years ago
|
||
Vicamo, if you haven't started reviewing the previous one, please change to review V2 which addressed the removal of the ugly flag I spoke to you earlier. Thanks!
Comment 9•12 years ago
|
||
Comment on attachment 8433258 [details] [diff] [review]
Test cases
Review of attachment 8433258 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/wifi/test/marionette/head.js
@@ +248,5 @@
> +
> + /**
> + * Forget all known networks.
> + *
> + * Resolve when we successfully forget all the known network;
nit: trailing sp
::: dom/wifi/test/marionette/test_wifi_associate_wo_connect.js
@@ +64,5 @@
> + * MozWifiNetwork object.
> + *
> + * @return A deferred promise.
> + */
> +function associateButDontConnect(aNetwork) {
I think you can reuse 'testAssociate' and simplify this as:
aNetwork.dontConnect = true;
let promises = [];
promises.push(waitForTimeout(10 * 1000)
.then(() => { throw 'timeout'; }));
promises.push(gTestSuite.testAssociate(aNetwork));
return Promise.all(promises)
.then(() => { throw 'unexpected state'; },
function(aReason) {
is(typeof aReason, 'string', 'typeof aReason');
is(aReason, 'timeout', aReason);
});
Attachment #8433258 -
Flags: feedback?(vyang) → feedback+
Updated•12 years ago
|
Attachment #8429722 -
Flags: review?(vyang) → review+
| Assignee | ||
Comment 10•12 years ago
|
||
1) Remove trailing spaces.
2) Simplify |associateButDontConnect|
3) Use is(xxx, xxx) instead of throwing exceptions.
| Assignee | ||
Comment 11•12 years ago
|
||
Comment on attachment 8434639 [details] [diff] [review]
Test cases V3
hi Vincent, I added two wifi test cases relevant to "update_config=1". Please refer to Comment 6 for further information. Thanks!
Attachment #8434639 -
Flags: review?(vchang)
| Assignee | ||
Comment 12•12 years ago
|
||
(In reply to Henry Chang [:henry] from comment #11)
> Comment on attachment 8434639 [details] [diff] [review]
> Test cases V3
>
> hi Vincent, I added two wifi test cases relevant to "update_config=1".
> Please refer to Comment 6 for further information. Thanks!
Try run: https://tbpl.mozilla.org/?tree=Try&rev=c0bd8c6ec49b
Comment 13•12 years ago
|
||
Comment on attachment 8434639 [details] [diff] [review]
Test cases V3
Review of attachment 8434639 [details] [diff] [review]:
-----------------------------------------------------------------
The patches looks good to me, just a couple of suggestion.
::: dom/wifi/test/marionette/head.js
@@ +383,5 @@
> + // Then we do the association.
> + let request = wifiManager.associate(aNetwork);
> + promises.push(wrapDomRequestAsPromise(request));
> +
> + return Promise.all(promises);
I think we should add a timeout here? Like what you have done in associateButDontConnect().
::: dom/wifi/test/marionette/test_wifi_associate_wo_connect.js
@@ +35,5 @@
> + function(aReason) {
> + is(typeof aReason, 'string', 'typeof aReason');
> + is(aReason, 'timeout', aReason);
> + });
> +}
Do you want to move this function to head.js as well? Since you have moved testAssociate()?
Attachment #8434639 -
Flags: review?(vchang) → review+
| Assignee | ||
Comment 14•12 years ago
|
||
(In reply to Vincent Chang[:vchang] from comment #13)
> Comment on attachment 8434639 [details] [diff] [review]
> Test cases V3
>
> Review of attachment 8434639 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> The patches looks good to me, just a couple of suggestion.
>
> ::: dom/wifi/test/marionette/head.js
> @@ +383,5 @@
> > + // Then we do the association.
> > + let request = wifiManager.associate(aNetwork);
> > + promises.push(wrapDomRequestAsPromise(request));
> > +
> > + return Promise.all(promises);
>
> I think we should add a timeout here? Like what you have done in
> associateButDontConnect().
>
> ::: dom/wifi/test/marionette/test_wifi_associate_wo_connect.js
> @@ +35,5 @@
> > + function(aReason) {
> > + is(typeof aReason, 'string', 'typeof aReason');
> > + is(aReason, 'timeout', aReason);
> > + });
> > +}
>
> Do you want to move this function to head.js as well? Since you have moved
> testAssociate()?
Vincent,
Thanks for the review!
Vicamo,
Since all the stuff have been r+, could you please help merge the PR so that I can
commit the test case to gecko afterward? Thanks!
| Assignee | ||
Updated•12 years ago
|
Flags: needinfo?(vyang)
Comment 15•12 years ago
|
||
https://github.com/mozilla-b2g/device_generic_goldfish/commit/3cae7eee1f7f00ba1eb53c733a8779f345055c6e
https://hg.mozilla.org/integration/b2g-inbound/rev/553b7aecee5c
Flags: needinfo?(vyang)
| Assignee | ||
Comment 16•12 years ago
|
||
Vicamo, thanks!
The try run based on merged PR and test cases:
https://tbpl.mozilla.org/?tree=Try&rev=565c7b43c16c
| Assignee | ||
Updated•12 years ago
|
Attachment #8433258 -
Attachment is obsolete: true
| Assignee | ||
Updated•12 years ago
|
Attachment #8433996 -
Attachment is obsolete: true
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 17•12 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•