If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

B2G SMS: Add test scripts for SMS function

RESOLVED FIXED in mozilla13

Status

()

Core
DOM: Device Interfaces
--
enhancement
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: vicamo, Assigned: vicamo)

Tracking

unspecified
mozilla13
ARM
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Test scripts were intended to be part of bug 729876, but is now separated as another minor issue to land the major function a.s.a.p.
Blocks: 729876
Component: General → DOM: Device Interfaces
OS: Android → Gonk
Product: Boot2Gecko → Core
QA Contact: general → device-interfaces
(Assignee)

Updated

6 years ago
Assignee: nobody → vyang
Blocks: 712933
No longer blocks: 729876
Depends on: 729876
Blocks: 729876
No longer depends on: 729876
(Assignee)

Comment 1

6 years ago
Created attachment 603323 [details] [diff] [review]
WIP V1

add tests for several GsmPDUHelper member functions.
(Assignee)

Comment 2

6 years ago
Created attachment 603612 [details] [diff] [review]
Part 1: fix removing redundent tailing char

fix a bug found with test scripts in part 2
Attachment #603323 - Attachment is obsolete: true
Attachment #603612 - Flags: review?(philipp)
(Assignee)

Comment 3

6 years ago
Created attachment 603619 [details] [diff] [review]
Part2: Add test scripts
Attachment #603619 - Flags: review?(philipp)
(Assignee)

Comment 4

6 years ago
There might be other potential errors in GsmPDUHelper.calculateUserDataLength():

01  calculateUserDataLength: function calculateUserDataLength(options) {
02    ...
03    for (...) {
04      ...
05      // Calculate full user data length, note the extra byte is for header len
06      let userDataLength = length + (headerLen ? headerLen + 1 : 0);
07      ...
08      if (userDataLength <= options.body.length) {
09        // Found minimum user data length already
10        return;
11      }
12    }
13    ...
14  }

In line 6, the unit of `headerLen` is octet, while that of `length` is septet. Under some situations, the result may vary.

In line 8~10, when it comes with a string with numerous ineffective characters like <escape>, the calculated encoded string length may be much less than options.body.length, and it is therefore possible for another encoding to have an even shorter result. For example, an input string of length 10 might get calculated cost 8 with several characters encoded with single shift mechanism. But another encoding might get cost 5 with all characters encoded with locking shift mechanism. This should be a minor issue because users cannot key-in \uffff and \ufffe, which are internally assigned to ineffective characters <escape> and <resctl>.
Comment on attachment 603619 [details] [diff] [review]
Part2: Add test scripts

Sweet!
Attachment #603619 - Flags: review?(philipp) → review+
Comment on attachment 603612 [details] [diff] [review]
Part 1: fix removing redundent tailing char

Good catch, and also nice work on that comment!
Attachment #603612 - Flags: review?(philipp) → review+
(In reply to Vicamo Yang from comment #4)
> There might be other potential errors in
> GsmPDUHelper.calculateUserDataLength():
> <snip>

Good sleuthing. Please file follow-up bug(s). Thanks!
https://hg.mozilla.org/mozilla-central/rev/a4415019a57a
https://hg.mozilla.org/mozilla-central/rev/453d5c733caa
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
(Assignee)

Updated

6 years ago
Depends on: 733981
You need to log in before you can comment on or make changes to this bug.