Closed Bug 816835 Opened 12 years ago Closed 12 years ago

B2G STK: Remove Menu causes Parcel error

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
B2G C2 (20nov-10dec)

People

(Reporter: allstars.chh, Assigned: psiddh)

References

Details

(Whiteboard: mno11)

Attachments

(2 files, 6 obsolete files)

From https://bugzilla.mozilla.org/show_bug.cgi?id=814111#c13,
some test data is using 0-length Comprehension-TLV and this caused failure in decoding parcels.
If the "Item data object for item 1" is a null data object (i.e. length = '00' and no value part), this is an indication to the ME
to remove the existing menu from the menu system in the ME.
Summary: B2G STK: Decode Comprehension-TLV failed when its length is 0 → B2G STK: Remove Menu causes Parcel error
(In reply to Siddartha P from comment #1)
> Created attachment 687341 [details] [diff] [review]
> To address usecases when setup menu is issued with item tag
> 
> If the "Item data object for item 1" is a null data object (i.e. length =
> '00' and no value part), this is an indication to the ME
> to remove the existing menu from the menu system in the ME.
Thanks for reminding this.
See TS 102.223 , clause 6.6.7
Comment on attachment 687341 [details] [diff] [review]
To address usecases when setup menu is issued with item tag

Review of attachment 687341 [details] [diff] [review]:
-----------------------------------------------------------------

Hi, Siddartha
thanks for your patch.

Not sure if patch is ready for review or not.
Next time you could send request for review. For example, r? in Bugzilla.

Also I think we need a marionette test for this,
Can you also write a test script?
I am also working on some Stk tests so if you need any help please feel free to ask.

thanks

::: dom/system/gonk/ril_worker.js
@@ +7224,5 @@
>     * | (Y-1)+X+2    |                        |        |
>     */
>    retrieveItem: function retrieveItem(length) {
> +    if (!length) {
> +      return {

you could 'return null;' directly.
Since it's javascript, we could use it more dynamically.

Also can we put more comments here? for example, quoted from spec,
"If the "Item data object for item 1" is a null data object (i.e. length = '00' and no value part), this is an indication to the
terminal to remove the existing menu from the menu system in the terminal."
sure.. comments will be addressed in the next patch. Could you elaborate on the requesting for review . Not sure if I have understood your comment on 'review process'.

Marionette, Use-case should be fairly straight forward.
Addressed the comments
Here is the tentative marionette test case. Both the *updated patch and test script have been tested. (Note : There is still a TBD: in the script)
I assume you're take the bug. Thank you :)
Assignee: nobody → psiddh
Attachment #688533 - Attachment is patch: true
Attachment #688533 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 687341 [details] [diff] [review]
To address usecases when setup menu is issued with item tag

Obsolete Siddartha's old patch.
Attachment #687341 - Attachment is obsolete: true
Comment on attachment 688525 [details] [diff] [review]
SETUP MENU first Item length is zero

Hi, Siddartha
Thanks for your patch,

Also you need to update comments in your patch
1. Add reviewer's name in the bug comment, 
2. Remove the "[PATCH]",

see https://developer.mozilla.org/en-US/docs/Developer_Guide/Committing_Rules_and_Responsibilities#Checkin_comment

and seems you used line break in your comment so I cannot see those final words 'its length is 0'
Attachment #688525 - Flags: review+
(In reply to Siddartha P from comment #4)
> sure.. comments will be addressed in the next patch. Could you elaborate on
> the requesting for review . Not sure if I have understood your comment on
> 'review process'.
> 
> Marionette, Use-case should be fairly straight forward.

See https://developer.mozilla.org/en-US/docs/Developer_Guide/How_to_Submit_a_Patch#Getting_the_patch_reviewed

Basically after you uploaded the patch,  Details -> Flags -> review -> choose ?, and fill-in the mail of the reviewer, if the reviewer is me, type ":allstars.chh", it should be auto-completed to fill out my email address.
(In reply to Siddartha P from comment #6)
> Created attachment 688533 [details] [diff] [review]
> TestCase to test the removal of already existing SETUP_MENU
> 
Hi Siddartha,
Can you make it a patch? so I can add my comments line by line.
For the test script you can find sample from https://bugzilla.mozilla.org/attachment.cgi?id=688149,
but it's still being reviewed, might be subject to change.
Moving to C2 since this bug blocks a C2 blocker.
Target Milestone: --- → B2G C2 (20nov-10dec)
Whiteboard: mno11
Attached patch PATCH v2 (obsolete) — Splinter Review
Addressed the comments
Attachment #689316 - Flags: review?(allstars.chh)
Comment on attachment 688525 [details] [diff] [review]
SETUP MENU first Item length is zero

Marking this patch as obsolete. refer latest patch submitted 'PATCH v2'
Attachment #688525 - Attachment is obsolete: true
Attachment #688533 - Attachment is obsolete: true
Attachment #689514 - Flags: review?(allstars.chh)
Comment on attachment 689316 [details] [diff] [review]
PATCH v2

I have gave you a r+, so you don't have to ask for review again.
Attachment #689316 - Flags: review?(allstars.chh) → review+
Comment on attachment 689514 [details] [diff] [review]
Marionette test case to remove a setup menu

Review of attachment 689514 [details] [diff] [review]:
-----------------------------------------------------------------

Hi, Siddartha
Since the file looks similar to test_stk_proactive_command.js
can you add your patch into that file?

thanks

::: dom/telephony/test/marionette/test_stk_remove_setup_menu.js
@@ +9,5 @@
> +ok(icc instanceof MozIccManager, "icc is instanceof " + icc.constructor);
> +
> +function getResult(cmd) {
> +  is(cmd.typeOfCommand, icc.STK_CMD_SET_UP_MENU);
> +  let result = ((JSON.stringify(cmd.options.items.length) == 1) && !(cmd.options.items[0]));

why JSON.stringify?
can you explain?
Attachment #689514 - Flags: review?(allstars.chh)
Isn't 'cmd.options.items.length' a JS object ? "is( JS obj , 1)" always yields a failure. On converting to JSON string, we can simply do a string comparison. I could be wrong though.

I thought of adding it to test_stk_proactive_command.js itself, but I wasn't sure. I really liked the way 'test_stk_proactive_command.js' is structured
I will add it to test_stk_proactive_command.js
One thing I'd like to remind you, recently marionette needs to add a '--load-early' option, 

in your B2G,
$>./test.sh marionette --load-early gecko/dom/icc/tests/marionette/test_stk_proactive_command.js
Comment on attachment 689514 [details] [diff] [review]
Marionette test case to remove a setup menu

Review of attachment 689514 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/telephony/test/marionette/test_stk_remove_setup_menu.js
@@ +7,5 @@
> +
> +let icc = navigator.mozMobileConnection.icc;
> +ok(icc instanceof MozIccManager, "icc is instanceof " + icc.constructor);
> +
> +function getResult(cmd) {

Do you think we could make the naming better?
Or add some comments in this function?
it might be difficult to know get 'what' result in the first place.

@@ +9,5 @@
> +ok(icc instanceof MozIccManager, "icc is instanceof " + icc.constructor);
> +
> +function getResult(cmd) {
> +  is(cmd.typeOfCommand, icc.STK_CMD_SET_UP_MENU);
> +  let result = ((JSON.stringify(cmd.options.items.length) == 1) && !(cmd.options.items[0]));

I just test your patch and I think 
(cmd.options.items.length == 1 && !(cmd.options.items[0])) works fine.

Also you could simply 
return (cmd.options.items.length == 1 && !(cmd.options.items[0])); 
without introducing 'result'.
Attachment #689984 - Flags: review?(allstars.chh)
Comment on attachment 689514 [details] [diff] [review]
Marionette test case to remove a setup menu

Refer to the latest patch submitted
Attachment #689514 - Attachment is obsolete: true
Comment on attachment 689984 [details] [diff] [review]
Added a marionette test case to remove an existing setup menu

Review of attachment 689984 [details] [diff] [review]:
-----------------------------------------------------------------

Great, thank you : )
Also in the patch comment, since you wrote two patches, (1 for test case)
so we usually write
"Bug 816835 - Part 1: ...."
"Bug 816835 - Part 2: Marionette tests for ..."
Attachment #689984 - Flags: review?(allstars.chh) → review+
Also you need to rebase your patch for the test case since Bug 804671 also updated the marionette test case for proactive command.
Attachment #689984 - Attachment is obsolete: true
Attached patch Part 1: PATCH v3Splinter Review
Attachment #689316 - Attachment is obsolete: true
Thanks Yoshi for the comments and feedback. I have now uploaded the latest patch set. Pls. let me know if anything else is needed to land these patches
Attachment #690531 - Attachment description: Rebased the changes → Part 2: Marionette test case to remove a setup menu.
Attachment #690533 - Attachment description: PATCH v3 → Part 1: PATCH v3
Great, \O/
Your first patch
I'll help you check-in these.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: