From 1ad91001566bc82c276bcd892c08a393fe2d0c9d Mon Sep 17 00:00:00 2001 From: Ethan Tseng Date: Fri, 11 Jul 2014 17:29:47 +0800 Subject: [PATCH 01/60] Bug 1032065 - RTSP video playback quality is poor if payload type is MP4V-ES. r=sworkman, r=bechen --- .../rtsp/rtsp/AMPEG4ElementaryAssembler.cpp | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp b/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp index 6d28aa29a1cb..0b05296cff84 100644 --- a/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp +++ b/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp @@ -359,12 +359,52 @@ void AMPEG4ElementaryAssembler::submitAccessUnit() { LOGV("Access unit complete (%d nal units)", mPackets.size()); - for (List >::iterator it = mPackets.begin(); - it != mPackets.end(); ++it) { - sp accessUnit = new ABuffer((*it)->size()); - sp nal = *it; - memcpy(accessUnit->data(), nal->data(), nal->size()); - CopyTimes(accessUnit, nal); + if (mIsGeneric) { + /* + * Bug 877116. + * In order to remedy a latency problem caused by hardware decoder for + * mpeg4-generic audios, we artificially divide AUs into more smaller + * AUs before feeding them to decoder. + * + * TODO: However, we are not sure this solution is appropriate to video + * or not. Need more investigation on this. Refer to RFC 3640. + */ + for (List >::iterator it = mPackets.begin(); + it != mPackets.end(); ++it) { + sp accessUnit = new ABuffer((*it)->size()); + sp nal = *it; + memcpy(accessUnit->data(), nal->data(), nal->size()); + CopyTimes(accessUnit, nal); + + if (mAccessUnitDamaged) { + accessUnit->meta()->setInt32("damaged", true); + } + + sp msg = mNotifyMsg->dup(); + msg->setObject("access-unit", accessUnit); + msg->post(); + } + } else { + /* + * For MP4V-ES (MPEG-4 Visual Elementary Streams), NAL units with the + * same RTP timestamp are assembled into an AU, which results in one + * decoded picture (RFC 6416). + */ + size_t totalSize = 0; + + for (List >::iterator it = mPackets.begin(); + it != mPackets.end(); ++it) { + totalSize += (*it)->size(); + } + sp accessUnit = new ABuffer(totalSize); + size_t offset = 0; + for (List >::iterator it = mPackets.begin(); + it != mPackets.end(); ++it) { + sp nal = *it; + memcpy(accessUnit->data() + offset, nal->data(), nal->size()); + offset += nal->size(); + } + CopyTimes(accessUnit, *mPackets.begin()); if (mAccessUnitDamaged) { accessUnit->meta()->setInt32("damaged", true); From 7fba24a1901c08f79dd5c38735b639709a7b5884 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Sat, 12 Jul 2014 06:38:00 +0200 Subject: [PATCH 02/60] Bug 1037820 - Remove SensorsListener hack. r=fabrice --- b2g/chrome/content/shell.js | 47 ------------------------------------- 1 file changed, 47 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index f29de04e91ea..e75811ceafe0 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -1232,53 +1232,6 @@ window.addEventListener('ContentStart', function update_onContentStart() { }) () #endif -#ifdef MOZ_WIDGET_GONK -let SensorsListener = { - sensorsListenerDevices: ['crespo'], - device: libcutils.property_get("ro.product.device"), - - deviceNeedsWorkaround: function SensorsListener_deviceNeedsWorkaround() { - return (this.sensorsListenerDevices.indexOf(this.device) != -1); - }, - - handleEvent: function SensorsListener_handleEvent(evt) { - switch(evt.type) { - case 'devicemotion': - // Listener that does nothing, we need this to have the sensor being - // able to report correct values, as explained in bug 753245, comment 6 - // and in bug 871916 - break; - - default: - break; - } - }, - - observe: function SensorsListener_observe(subject, topic, data) { - // We remove the listener when the screen is off, otherwise sensor will - // continue to bother us with data and we won't be able to get the - // system into suspend state, thus draining battery. - if (data === 'on') { - window.addEventListener('devicemotion', this); - } else { - window.removeEventListener('devicemotion', this); - } - }, - - init: function SensorsListener_init() { - if (this.deviceNeedsWorkaround()) { - // On boot, enable the listener, screen will be on. - window.addEventListener('devicemotion', this); - - // Then listen for further screen state changes - Services.obs.addObserver(this, 'screen-state-changed', false); - } - } -} - -SensorsListener.init(); -#endif - // Calling this observer will cause a shutdown an a profile reset. // Use eg. : Services.obs.notifyObservers(null, 'b2g-reset-profile', null); Services.obs.addObserver(function resetProfile(subject, topic, data) { From 9f5a71ebaaceb5b02fe15d47ea47b83d261576c0 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 01:37:17 -0700 Subject: [PATCH 03/60] Bumping manifests a=b2g-bump --- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index cb21f43e8b98..0da15f118373 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -131,7 +131,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c8b94d291583..036c55c70de0 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -143,7 +143,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 8acba6c7389a..cba6317008dc 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -127,7 +127,7 @@ - + From 8c8eb52df3533087f1b5abd9e99db27e3f4ac7c7 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 01:50:30 -0700 Subject: [PATCH 04/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/cf4e8746d209 Author: Cristian Rodriguez Desc: Merge pull request #21667 from crdlc/bug-1035084 Bug 1035084 - The statusbar disappears from lockscreen ======== https://hg.mozilla.org/integration/gaia-central/rev/7bcd01728ef1 Author: crdlc Desc: Bug 1035084 - The statusbar disappears from lockscreen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 03e5f909160d..92e0456f1608 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "168c5ba3a072b6c6b30bcc93586f833cc97fff4a", + "revision": "cf4e8746d2096254bd77d40a7d37e80b37a17c92", "repo_path": "/integration/gaia-central" } From cc96a2d9d620a66d4f969dcb6cd5175ede4ab09b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 01:56:25 -0700 Subject: [PATCH 05/60] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4f10e6dc0545..494232147c03 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0da15f118373..de2972202c00 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7d7e939ac6e2..901aa19b35ee 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4f10e6dc0545..494232147c03 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 036c55c70de0..8e18c1b4da61 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 9d054ec84924..648a54d36f9a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 493c1dcbce29..538f198b6993 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index cba6317008dc..e1ef33355fb0 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 90847839d63d..448ed69b6ad7 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 996722535dcdb66742d10dbef49fd36fe70f0231 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 03:00:25 -0700 Subject: [PATCH 06/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/5c72f184f51d Author: Greg Weng Desc: Merge pull request #21670 from snowmantw/issue1037027 Bug 1037027 - [Lockscreen] notifications can overlap the date on the loc... ======== https://hg.mozilla.org/integration/gaia-central/rev/8ca16caf0451 Author: Greg Weng Desc: Bug 1037027 - [Lockscreen] notifications can overlap the date on the lockscreen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 92e0456f1608..e83e7048f811 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "cf4e8746d2096254bd77d40a7d37e80b37a17c92", + "revision": "5c72f184f51d147f26106d44744927b4477e44de", "repo_path": "/integration/gaia-central" } From c2f6db720b764b48643c500099007321f783c173 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 03:06:40 -0700 Subject: [PATCH 07/60] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 494232147c03..7f2803649238 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index de2972202c00..009745bbeb32 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 901aa19b35ee..0fca30d677dd 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 494232147c03..7f2803649238 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 8e18c1b4da61..8d5c8c6b1fed 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 648a54d36f9a..2133aa07826b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 538f198b6993..f5178020a595 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e1ef33355fb0..194c63ed6d3f 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 448ed69b6ad7..2c02a2a93fc4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 73a7bf5aa05017aa4b081a0a8b9aec7a6b911f75 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Mon, 14 Jul 2014 14:44:47 +0800 Subject: [PATCH 08/60] Bug 1022490 - Improve the performance of adding contacts. r=allstars.chh --- dom/system/gonk/ril_worker.js | 44 ++++++++++++++++--- .../test_ril_worker_icc_ICCRecordHelper.js | 6 +-- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 602246c2d058..dad916afd4cd 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -12267,6 +12267,8 @@ ICCIOHelperObject.prototype[ICC_COMMAND_UPDATE_RECORD] = function ICC_COMMAND_UP */ function ICCRecordHelperObject(aContext) { this.context = aContext; + // Cache the possible free record id for all files, use fileId as key. + this._freeRecordIds = {}; } ICCRecordHelperObject.prototype = { context: null, @@ -12743,6 +12745,11 @@ ICCRecordHelperObject.prototype = { }); }, + /** + * Cache the possible free record id for all files. + */ + _freeRecordIds: null, + /** * Find free record id. * @@ -12769,8 +12776,11 @@ ICCRecordHelperObject.prototype = { } } + let nextRecord = (options.p1 % options.totalRecords) + 1; + if (readLen == octetLen) { - // Find free record. + // Find free record, assume next record is probably free. + this._freeRecordIds[fileId] = nextRecord; if (onsuccess) { onsuccess(options.p1); } @@ -12781,10 +12791,12 @@ ICCRecordHelperObject.prototype = { Buf.readStringDelimiter(strLen); - if (options.p1 < options.totalRecords) { - ICCIOHelper.loadNextRecord(options); + if (nextRecord !== recordNumber) { + options.p1 = nextRecord; + this.context.RIL.iccIO(options); } else { // No free record found. + delete this._freeRecordIds[fileId]; if (DEBUG) { this.context.debug(CONTACT_ERR_NO_FREE_RECORD_FOUND); } @@ -12792,7 +12804,10 @@ ICCRecordHelperObject.prototype = { } } + // Start searching free records from the possible one. + let recordNumber = this._freeRecordIds[fileId] || 1; ICCIOHelper.loadLinearFixedEF({fileId: fileId, + recordNumber: recordNumber, callback: callback.bind(this), onerror: onerror}); }, @@ -14364,6 +14379,11 @@ ICCContactHelperObject.prototype = { } }, + /** + * Cache the pbr index of the possible free record. + */ + _freePbrIndex: 0, + /** * Find free ADN record id in USIM. * @@ -14374,8 +14394,17 @@ ICCContactHelperObject.prototype = { findUSimFreeADNRecordId: function(pbrs, onsuccess, onerror) { let ICCRecordHelper = this.context.ICCRecordHelper; + function callback(pbrIndex, recordId) { + // Assume other free records are probably in the same phonebook set. + this._freePbrIndex = pbrIndex; + onsuccess(pbrIndex, recordId); + } + + let nextPbrIndex = -1; (function findFreeRecordId(pbrIndex) { - if (pbrIndex >= pbrs.length) { + if (nextPbrIndex === this._freePbrIndex) { + // No free record found, reset the pbr index of free record. + this._freePbrIndex = 0; if (DEBUG) { this.context.debug(CONTACT_ERR_NO_FREE_RECORD_FOUND); } @@ -14384,11 +14413,12 @@ ICCContactHelperObject.prototype = { } let pbr = pbrs[pbrIndex]; + nextPbrIndex = (pbrIndex + 1) % pbrs.length; ICCRecordHelper.findFreeRecordId( pbr.adn.fileId, - onsuccess.bind(this, pbrIndex), - findFreeRecordId.bind(null, pbrIndex + 1)); - })(0); + callback.bind(this, pbrIndex), + findFreeRecordId.bind(this, nextPbrIndex)); + }).call(this, this._freePbrIndex); }, /** diff --git a/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js b/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js index 55f243b9786c..a424dbabfc12 100644 --- a/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js +++ b/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js @@ -593,8 +593,9 @@ add_test(function test_find_free_record_id() { let recordHelper = context.ICCRecordHelper; let buf = context.Buf; let io = context.ICCIOHelper; + let ril = context.RIL; - function writeRecord (record) { + function writeRecord(record) { // Write data size buf.writeInt32(record.length * 2); @@ -617,10 +618,9 @@ add_test(function test_find_free_record_id() { } }; - io.loadNextRecord = function fakeLoadNextRecord(options) { + ril.iccIO = function fakeIccIO(options) { // Unused bytes. let record = [0xff, 0xff, 0xff, 0xff, 0xff]; - options.p1++; writeRecord(record); if (options.callback) { options.callback(options); From 1b0c230740a5fdc123864bc019fc8a742a5fe487 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 04:15:35 -0700 Subject: [PATCH 09/60] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/aecb21f14843 Author: Jose Antonio Olivera Ortega Desc: Merge pull request #21399 from jaoo/1016277 Bug 1016277 - If two different apps try to use the 'telephony' channel at the same time both apps can play audio. r=etienne_s ======== https://hg.mozilla.org/integration/gaia-central/rev/28bffa447724 Author: Jose Antonio Olivera Ortega Desc: Bug 1016277 - Alternative to the second step: play silence during the call ======== https://hg.mozilla.org/integration/gaia-central/rev/56b53249c13e Author: Anthony Ricaud Desc: Merge pull request #21624 from Rik/find-contacts-when-removing-1029581 Bug 1029581 - Contact name is not shown in the call log after having two... r=drs ======== https://hg.mozilla.org/integration/gaia-central/rev/7a93c4d665ed Author: Anthony Ricaud Desc: Bug 1029581 - Contact name is not shown in the call log after having two contacts with same number and the first one is removed --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e83e7048f811..b2a57245f4ab 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5c72f184f51d147f26106d44744927b4477e44de", + "revision": "aecb21f148433e19b86407603ccb0f6dfa0a5633", "repo_path": "/integration/gaia-central" } From 4207007ffe213df8466f8754335052dcc04bd6c8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 04:21:19 -0700 Subject: [PATCH 10/60] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7f2803649238..3952ba0fc70d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 009745bbeb32..1347c4555a94 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 0fca30d677dd..eb7e9470c667 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7f2803649238..3952ba0fc70d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 8d5c8c6b1fed..0ff142a628d3 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2133aa07826b..3662826d93ea 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f5178020a595..470fd2820469 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 194c63ed6d3f..0cc2c9a83acd 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2c02a2a93fc4..b5f6fa38472e 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ff0816378b7dbfcf584832831222399560ab2b75 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 14 Jul 2014 13:43:11 +0200 Subject: [PATCH 11/60] Bug 1038097: Include in BluetoothInterface.cpp, r=shuang This patch adds a missing include statement for to BluetoothInterface.cpp. This fixes the build for flatfish devices. For safety, the patch also adds an include statement for , which might be necessary for several functions. --- dom/bluetooth/bluedroid/BluetoothInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/bluetooth/bluedroid/BluetoothInterface.cpp b/dom/bluetooth/bluedroid/BluetoothInterface.cpp index 89845419b4e7..6f61c128dfff 100644 --- a/dom/bluetooth/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothInterface.cpp @@ -4,6 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include #include #include "base/message_loop.h" #include "BluetoothInterface.h" From 6661fc32702643dedd458e11b08c1cc7d620f461 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 05:10:29 -0700 Subject: [PATCH 12/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/164dccd55fe6 Author: gitmai Desc: Merge pull request #21520 from gitmai/bug-1032095-usage-message-with-sound Bug 1032095 - Usage message with sound r=salva ======== https://hg.mozilla.org/integration/gaia-central/rev/358ee56adbfe Author: mai Desc: Bug 1032095 - Usage message with sound --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index b2a57245f4ab..d48e7f95813e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "aecb21f148433e19b86407603ccb0f6dfa0a5633", + "revision": "164dccd55fe6995e7947287d1f2fcfd4ad31690b", "repo_path": "/integration/gaia-central" } From 9e86ae206e300fbcc7fa9bf9d971e3fab5969a4b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 14 Jul 2014 05:16:19 -0700 Subject: [PATCH 13/60] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3952ba0fc70d..35dd3db130dd 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1347c4555a94..bab277b42934 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index eb7e9470c667..f1944192afbd 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3952ba0fc70d..35dd3db130dd 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0ff142a628d3..63782d2b1b6c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 3662826d93ea..d58a57a9dcfc 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 470fd2820469..5b938a9a69d7 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0cc2c9a83acd..96b1cd098126 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b5f6fa38472e..a22f6e4c7223 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 59676d2b32dd812fef41aeb83cafed3cf4f82ff8 Mon Sep 17 00:00:00 2001 From: Shawn Ku Date: Mon, 14 Jul 2014 14:05:59 +0800 Subject: [PATCH 14/60] Bug 1031640 - Part 1: RIL patch - B2G RIL: incorrect STK TR for handling SEND_SS/SEND_USSD/SEND_SHORT_MESSAGE/SEND_DTMF in ril_worker.js. r=echen --- dom/system/gonk/ril_worker.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index dad916afd4cd..69486c6f49a6 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -10680,13 +10680,9 @@ StkCommandParamsFactoryObject.prototype = { let ctlv = this.context.StkProactiveCmdHelper.searchForTag( COMPREHENSIONTLV_TAG_ALPHA_ID, ctlvs); - if (!ctlv) { - this.context.RIL.sendStkTerminalResponse({ - command: cmdDetails, - resultCode: STK_RESULT_REQUIRED_VALUES_MISSING}); - throw new Error("Stk Event Notfiy: Required value missing : Alpha ID"); + if (ctlv) { + textMsg.text = ctlv.value.identifier; } - textMsg.text = ctlv.value.identifier; return textMsg; }, From 14fc30f44b18466b1520a138858fb2e2fe598d8d Mon Sep 17 00:00:00 2001 From: Shawn Ku Date: Mon, 14 Jul 2014 17:06:45 +0800 Subject: [PATCH 15/60] Bug 1031640 - Part 2: test patch - B2G RIL: incorrect STK TR for handling SEND_SS/SEND_USSD/SEND_SHORT_MESSAGE/SEND_DTMF in ril_worker.js. r=echen --- .../tests/marionette/test_stk_send_dtmf.js | 167 ++++++------- dom/icc/tests/marionette/test_stk_send_sms.js | 227 ++++++++++-------- dom/icc/tests/marionette/test_stk_send_ss.js | 180 +++++++------- .../tests/marionette/test_stk_send_ussd.js | 184 +++++++------- 4 files changed, 389 insertions(+), 369 deletions(-) diff --git a/dom/icc/tests/marionette/test_stk_send_dtmf.js b/dom/icc/tests/marionette/test_stk_send_dtmf.js index 9760b5849bd3..4b7c9e06c8be 100644 --- a/dom/icc/tests/marionette/test_stk_send_dtmf.js +++ b/dom/icc/tests/marionette/test_stk_send_dtmf.js @@ -7,9 +7,7 @@ function testSendDTMF(command, expect) { log("STK CMD " + JSON.stringify(command)); is(command.typeOfCommand, iccManager.STK_CMD_SEND_DTMF, expect.name); is(command.commandQualifier, expect.commandQualifier, expect.name); - if (command.options.text) { - is(command.options.text, expect.text, expect.name); - } + is(command.options.text, expect.text, expect.name); runNextTest(); } @@ -17,174 +15,165 @@ function testSendDTMF(command, expect) { let tests = [ {command: "d01b810301140082028183850953656e642044544d46ac052143658709", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_1", + expect: {name: "send_dtmf_cmd_1_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF"}}, + {command: "d010810301140082028183ac052143658709", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_1_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0138103011400820281838500ac06c1cccccccc2c", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_2", + expect: {name: "send_dtmf_cmd_2_with_alpha_identifier", commandQualifier: 0x00, text: ""}}, + {command: "d011810301140082028183ac06c1cccccccc2c", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_2_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d01d810301140082028183850a42617369632049636f6eac02c1f29e020001", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_3", + expect: {name: "send_dtmf_cmd_3_with_alpha_identifier", commandQualifier: 0x00, text: "Basic Icon"}}, - {command: "d01b810301140082028183850953656e642044544d46ac052143658709", + {command: "d011810301140082028183ac02c1f29e020001", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_4", - commandQualifier: 0x00, - text: "Send DTMF"}}, + expect: {name: "send_dtmf_cmd_3_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d01c810301140082028183850953656e642044544d46ac02c1f29e020101", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_5", + expect: {name: "send_dtmf_cmd_4_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF"}}, + {command: "d011810301140082028183ac02c1f29e020101", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_4_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d028810301140082028183851980041704140420041004120421042204120423041904220415ac02c1f2", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_6", + expect: {name: "send_dtmf_cmd_5_with_alpha_identifier", commandQualifier: 0x00, text: "ЗДРАВСТВУЙТЕ"}}, + {command: "d00d810301140082028183ac02c1f2", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_5_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_7", + expect: {name: "send_dtmf_cmd_6_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, + {command: "d016810301140082028183ac052143658709d004000b00b4", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_6_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_8", + expect: {name: "send_dtmf_cmd_7_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 2"}}, + // send_dtmf_cmd_7_without_alpha_identifier has the same pdu as + // send_dtmf_cmd_1_without_alpha_identifier. {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b01b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_9", + expect: {name: "send_dtmf_cmd_8_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709", + {command: "d016810301140082028183ac052143658709d004000b01b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_10", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, + expect: {name: "send_dtmf_cmd_8_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d00400b002b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_11", + expect: {name: "send_dtmf_cmd_9_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709", + {command: "d016810301140082028183ac052143658709d00400b002b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_12", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, + expect: {name: "send_dtmf_cmd_9_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b04b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_13", + expect: {name: "send_dtmf_cmd_10_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, + {command: "d016810301140082028183ac052143658709d004000b04b4", + func: testSendDTMF, + expect: {name: "send_dtmf_cmd_10_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_14", + expect: {name: "send_dtmf_cmd_11_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 2"}}, + // send_dtmf_cmd_11_without_alpha_identifier has the same pdu as + // send_dtmf_cmd_6_without_alpha_identifier. {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_15", + expect: {name: "send_dtmf_cmd_12_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 3"}}, + // send_dtmf_cmd_12_without_alpha_identifier has the same pdu as + // send_dtmf_cmd_1_without_alpha_identifier. {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b08b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_16", + expect: {name: "send_dtmf_cmd_13_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", + {command: "d016810301140082028183ac052143658709d004000b08b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_17", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, - {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_18", - commandQualifier: 0x00, - text: "Send DTMF 3"}}, + expect: {name: "send_dtmf_cmd_13_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b10b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_19", + expect: {name: "send_dtmf_cmd_14_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", + {command: "d016810301140082028183ac052143658709d004000b10b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_20", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, - {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_21", - commandQualifier: 0x00, - text: "Send DTMF 3"}}, + expect: {name: "send_dtmf_cmd_14_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b20b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_22", + expect: {name: "send_dtmf_cmd_15_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", + {command: "d016810301140082028183ac052143658709d004000b20b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_23", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, - {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_24", - commandQualifier: 0x00, - text: "Send DTMF 3"}}, + expect: {name: "send_dtmf_cmd_15_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b40b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_25", + expect: {name: "send_dtmf_cmd_16_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", + {command: "d016810301140082028183ac052143658709d004000b40b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_26", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, - {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_27", - commandQualifier: 0x00, - text: "Send DTMF 3"}}, + expect: {name: "send_dtmf_cmd_16_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b80b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_28", + expect: {name: "send_dtmf_cmd_17_with_alpha_identifier", commandQualifier: 0x00, text: "Send DTMF 1"}}, - {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4", + {command: "d016810301140082028183ac052143658709d004000b80b4", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_29", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, - {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_30", - commandQualifier: 0x00, - text: "Send DTMF 3"}}, - {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_31", - commandQualifier: 0x00, - text: "Send DTMF 1"}}, - {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709", - func: testSendDTMF, - expect: {name: "send_dtmf_cmd_32", - commandQualifier: 0x00, - text: "Send DTMF 2"}}, + expect: {name: "send_dtmf_cmd_17_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0148103011400820281838505804f60597dac02c1f2", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_33", + expect: {name: "send_dtmf_cmd_18_with_alpha_identifier", commandQualifier: 0x00, text: "你好"}}, + // send_dtmf_cmd_18_without_alpha_identifier has the same pdu as + // send_dtmf_cmd_5_without_alpha_identifier. {command: "d01281030114008202818385038030ebac02c1f2", func: testSendDTMF, - expect: {name: "send_dtmf_cmd_34", + expect: {name: "send_dtmf_cmd_19_with_alpha_identifier", commandQualifier: 0x00, text: "ル"}} + // send_dtmf_cmd_19_without_alpha_identifier has the same pdu as + // send_dtmf_cmd_5_without_alpha_identifier. ]; runNextTest(); diff --git a/dom/icc/tests/marionette/test_stk_send_sms.js b/dom/icc/tests/marionette/test_stk_send_sms.js index dd12cb9cf11b..1e83ec14b96c 100644 --- a/dom/icc/tests/marionette/test_stk_send_sms.js +++ b/dom/icc/tests/marionette/test_stk_send_sms.js @@ -7,9 +7,7 @@ function testSendSMS(command, expect) { log("STK CMD " + JSON.stringify(command)); is(command.typeOfCommand, iccManager.STK_CMD_SEND_SMS, expect.name); is(command.commandQualifier, expect.commandQualifier, expect.name); - if (command.options.text) { - is(command.options.text, expect.title, expect.name); - } + is(command.options.text, expect.title, expect.name); runNextTest(); } @@ -17,224 +15,251 @@ function testSendSMS(command, expect) { let tests = [ {command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765", func: testSendSMS, - expect: {name: "send_sms_cmd_1", + expect: {name: "send_sms_cmd_1_with_alpha_identifier", commandQualifier: 0x00, title: "Send SM"}}, + {command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d657373616765", + func: testSendSMS, + expect: {name: "send_sms_cmd_1_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d", func: testSendSMS, - expect: {name: "send_sms_cmd_2", + expect: {name: "send_sms_cmd_2_with_alpha_identifier", commandQualifier: 0x01, title: "Send SM"}}, + {command: "d02981030113018202818386099111223344556677f88b130100099110325476f840f40753656e6420534d", + func: testSendSMS, + expect: {name: "send_sms_cmd_2_without_alpha_identifier", + commandQualifier: 0x01}}, {command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06", func: testSendSMS, - expect: {name: "send_sms_cmd_3", + expect: {name: "send_sms_cmd_3_with_alpha_identifier", commandQualifier: 0x00, title: "Short Message"}}, + {command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06", + func: testSendSMS, + expect: {name: "send_sms_cmd_3_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370", func: testSendSMS, - expect: {name: "send_sms_cmd_4", + expect: {name: "send_sms_cmd_4_with_alpha_identifier", commandQualifier: 0x01, title: "The address data object holds the RP_Destination_Address"}}, + {command: "d081c381030113018202818386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370", + func: testSendSMS, + expect: {name: "send_sms_cmd_4_without_alpha_identifier", + commandQualifier: 0x01}}, {command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1", func: testSendSMS, - expect: {name: "send_sms_cmd_5", + expect: {name: "send_sms_cmd_5_with_alpha_identifier", commandQualifier: 0x00, title: "The address data object holds the RP Destination Address"}}, + {command: "d081af81030113008202818386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1", + func: testSendSMS, + expect: {name: "send_sms_cmd_5_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120", func: testSendSMS, - expect: {name: "send_sms_cmd_6", + expect: {name: "send_sms_cmd_6_with_alpha_identifier", commandQualifier: 0x00, title: "Two types are defined: - A short message to be sent to the network in an SMS-SUBMIT message, or an SMS-COMMAND message, where the user data can be passed transparently; - A short message to be sent to the network in an SMS-SUBMIT "}}, + {command: "d0148103011300820281838b09010002911040f00120", + func: testSendSMS, + expect: {name: "send_sms_cmd_6_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765", func: testSendSMS, - expect: {name: "send_sms_cmd_7", + expect: {name: "send_sms_cmd_7_with_alpha_identifier", commandQualifier: 0x00, title: ""}}, + // send_sms_cmd_7_without_alpha_identifier has the same pdu as + // send_sms_cmd_1_without_alpha_identifier. {command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", func: testSendSMS, - expect: {name: "send_sms_cmd_8", + expect: {name: "send_sms_cmd_8_with_alpha_identifier", commandQualifier: 0x00, title: "ЗДРАВСТВУЙТЕ"}}, + {command: "d03a81030113008202818386099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", + func: testSendSMS, + expect: {name: "send_sms_cmd_8_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", func: testSendSMS, - expect: {name: "send_sms_cmd_9", - commandQualifier: 0x00, - title: "ЗДРАВСТВУЙТЕ"}}, - {command: "d04c8103011300820281838510820c041087849080829192829389928586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", - func: testSendSMS, - expect: {name: "send_sms_cmd_9", + expect: {name: "send_sms_cmd_9_with_alpha_identifier", commandQualifier: 0x00, title: "ЗДРАВСТВУЙТЕ"}}, + // send_sms_cmd_9_without_alpha_identifier has the same pdu as + // send_sms_cmd_8_without_alpha_identifier. {command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001", func: testSendSMS, - expect: {name: "send_sms_cmd_10", + expect: {name: "send_sms_cmd_10_with_alpha_identifier", commandQualifier: 0x00, title: "NO ICON"}}, + {command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001", + func: testSendSMS, + expect: {name: "send_sms_cmd_10_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101", func: testSendSMS, - expect: {name: "send_sms_cmd_11", + expect: {name: "send_sms_cmd_11_with_alpha_identifier", commandQualifier: 0x00, title: "Send SM"}}, + {command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101", + func: testSendSMS, + expect: {name: "send_sms_cmd_11_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4", func: testSendSMS, - expect: {name: "send_sms_cmd_12", + expect: {name: "send_sms_cmd_12_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d01a8103011300820281838b09010002911040f00120d004001000b4", + func: testSendSMS, + expect: {name: "send_sms_cmd_12_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", func: testSendSMS, - expect: {name: "send_sms_cmd_13", + expect: {name: "send_sms_cmd_13_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_sms_cmd_18_without_alpha_identifier has the same pdu as + // send_sms_cmd_6_without_alpha_identifier. {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4", func: testSendSMS, - expect: {name: "send_sms_cmd_14", + expect: {name: "send_sms_cmd_14_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", + {command: "d01a8103011300820281838b09010002911040f00120d004001001b4", func: testSendSMS, - expect: {name: "send_sms_cmd_15", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_sms_cmd_14_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4", func: testSendSMS, - expect: {name: "send_sms_cmd_16", + expect: {name: "send_sms_cmd_15_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", + {command: "d01a8103011300820281838b09010002911040f00120d004001002b4", func: testSendSMS, - expect: {name: "send_sms_cmd_17", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_sms_cmd_15_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4", func: testSendSMS, - expect: {name: "send_sms_cmd_18", + expect: {name: "send_sms_cmd_16_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d01a8103011300820281838b09010002911040f00120d004001004b4", + func: testSendSMS, + expect: {name: "send_sms_cmd_16_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", func: testSendSMS, - expect: {name: "send_sms_cmd_19", + expect: {name: "send_sms_cmd_17_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_sms_cmd_17_without_alpha_identifier has the same pdu as + // send_sms_cmd_12_without_alpha_identifier. {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", func: testSendSMS, - expect: {name: "send_sms_cmd_20", + expect: {name: "send_sms_cmd_18_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 3"}}, + // send_sms_cmd_18_without_alpha_identifier has the same pdu as + // send_sms_cmd_6_without_alpha_identifier. {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4", func: testSendSMS, - expect: {name: "send_sms_cmd_21", + expect: {name: "send_sms_cmd_19_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", + {command: "d01a8103011300820281838b09010002911040f00120d004001008b4", func: testSendSMS, - expect: {name: "send_sms_cmd_22", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_23", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_sms_cmd_19_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4", func: testSendSMS, - expect: {name: "send_sms_cmd_24", + expect: {name: "send_sms_cmd_20_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", + {command: "d01a8103011300820281838b09010002911040f00120d004001010b4", func: testSendSMS, - expect: {name: "send_sms_cmd_25", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_26", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_sms_cmd_20_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4", func: testSendSMS, - expect: {name: "send_sms_cmd_27", + expect: {name: "send_sms_cmd_21_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", + {command: "d01a8103011300820281838b09010002911040f00120d004001020b4", func: testSendSMS, - expect: {name: "send_sms_cmd_28", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_29", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_sms_cmd_21_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4", func: testSendSMS, - expect: {name: "send_sms_cmd_30", + expect: {name: "send_sms_cmd_22_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", + {command: "d01a8103011300820281838b09010002911040f00120d004001040b4", func: testSendSMS, - expect: {name: "send_sms_cmd_31", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_32", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_sms_cmd_22_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4", func: testSendSMS, - expect: {name: "send_sms_cmd_33", + expect: {name: "send_sms_cmd_23_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", + {command: "d01a8103011300820281838b09010002911040f00120d004001080b4", func: testSendSMS, - expect: {name: "send_sms_cmd_34", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_35", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, - {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4", - func: testSendSMS, - expect: {name: "send_sms_cmd_36", - commandQualifier: 0x00, - title: "Text Attribute 1"}}, - {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", - func: testSendSMS, - expect: {name: "send_sms_cmd_37", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_sms_cmd_23_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00", func: testSendSMS, - expect: {name: "send_sms_cmd_38", + expect: {name: "send_sms_cmd_24_with_alpha_identifier", commandQualifier: 0x00, title: "中一"}}, + {command: "d02681030113008202818386099111223344556677f88b100100099110325476f84008044e2d4e00", + func: testSendSMS, + expect: {name: "send_sms_cmd_24_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00", func: testSendSMS, - expect: {name: "send_sms_cmd_39", + expect: {name: "send_sms_cmd_25_with_alpha_identifier", commandQualifier: 0x00, title: "中一"}}, + // send_sms_cmd_25_without_alpha_identifier has the same pdu as + // send_sms_cmd_24_without_alpha_identifier. {command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00", func: testSendSMS, - expect: {name: "send_sms_cmd_40", + expect: {name: "send_sms_cmd_26_with_alpha_identifier", commandQualifier: 0x00, title: "中一"}}, + // send_sms_cmd_26_without_alpha_identifier has the same pdu as + // send_sms_cmd_24_without_alpha_identifier. {command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031", func: testSendSMS, - expect: {name: "send_sms_cmd_41", + expect: {name: "send_sms_cmd_27_with_alpha_identifier", commandQualifier: 0x00, title: "80ル0"}}, + {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0031", + func: testSendSMS, + expect: {name: "send_sms_cmd_27_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032", func: testSendSMS, - expect: {name: "send_sms_cmd_42", + expect: {name: "send_sms_cmd_28_with_alpha_identifier", commandQualifier: 0x00, title: "81ル1"}}, + {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0032", + func: testSendSMS, + expect: {name: "send_sms_cmd_28_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033", func: testSendSMS, - expect: {name: "send_sms_cmd_43", + expect: {name: "send_sms_cmd_29_with_alpha_identifier", commandQualifier: 0x00, - title: "82ル2"}} + title: "82ル2"}}, + {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0033", + func: testSendSMS, + expect: {name: "send_sms_cmd_29_without_alpha_identifier", + commandQualifier: 0x00}} ]; runNextTest(); diff --git a/dom/icc/tests/marionette/test_stk_send_ss.js b/dom/icc/tests/marionette/test_stk_send_ss.js index 48dfcdc047d4..d10cc5ef36b9 100644 --- a/dom/icc/tests/marionette/test_stk_send_ss.js +++ b/dom/icc/tests/marionette/test_stk_send_ss.js @@ -7,9 +7,7 @@ function testSendSS(command, expect) { log("STK CMD " + JSON.stringify(command)); is(command.typeOfCommand, iccManager.STK_CMD_SEND_SS, expect.name); is(command.commandQualifier, expect.commandQualifier, expect.name); - if (command.options.text) { - is(command.options.text, expect.title, expect.name); - } + is(command.options.text, expect.title, expect.name); runNextTest(); } @@ -17,184 +15,188 @@ function testSendSS(command, expect) { let tests = [ {command: "d029810301110082028183850c43616c6c20466f7277617264891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_1", + expect: {name: "send_ss_cmd_1_with_alpha_identifier", commandQualifier: 0x00, title: "Call Forward"}}, + {command: "d01b810301110082028183891091aa120a214365870921436587a901fb", + func: testSendSS, + expect: {name: "send_ss_cmd_1_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02d810301110082028183850c43616c6c20466f7277617264891491aa120a21436587092143658709214365a711fb", func: testSendSS, - expect: {name: "send_ss_cmd_2", + expect: {name: "send_ss_cmd_2_with_alpha_identifier", commandQualifier: 0x00, title: "Call Forward"}}, + {command: "d01f810301110082028183891491aa120a21436587092143658709214365a711fb", + func: testSendSS, + expect: {name: "send_ss_cmd_2_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d081fd8103011100820281838581eb4576656e20696620746865204669786564204469616c6c696e67204e756d626572207365727669636520697320656e61626c65642c2074686520737570706c656d656e74617279207365727669636520636f6e74726f6c20737472696e6720696e636c7564656420696e207468652053454e442053532070726f61637469766520636f6d6d616e64207368616c6c206e6f7420626520636865636b656420616761696e73742074686f7365206f66207468652046444e206c6973742e2055706f6e20726563656976696e67207468697320636f6d6d616e642c20746865204d45207368616c6c20646563698904ffba13fb", func: testSendSS, - expect: {name: "send_ss_cmd_3", + expect: {name: "send_ss_cmd_3_with_alpha_identifier", commandQualifier: 0x00, title: "Even if the Fixed Dialling Number service is enabled, the supplementary service control string included in the SEND SS proactive command shall not be checked against those of the FDN list. Upon receiving this command, the ME shall deci"}}, + {command: "d00f8103011100820281838904ffba13fb", + func: testSendSS, + expect: {name: "send_ss_cmd_3_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d01d8103011100820281838500891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_4", + expect: {name: "send_ss_cmd_4_with_alpha_identifier", commandQualifier: 0x00, title: ""}}, + // send_ss_cmd_4_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. {command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020001", func: testSendSS, - expect: {name: "send_ss_cmd_5", + expect: {name: "send_ss_cmd_5_with_alpha_identifier", commandQualifier: 0x00, title: "Basic Icon"}}, + {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020001", + func: testSendSS, + expect: {name: "send_ss_cmd_5_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02c810301110082028183850b436f6c6f75722049636f6e891091aa120a214365870921436587a901fb9e020002", func: testSendSS, - expect: {name: "send_ss_cmd_6", + expect: {name: "send_ss_cmd_6_with_alpha_identifier", commandQualifier: 0x00, title: "Colour Icon"}}, + {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020002", + func: testSendSS, + expect: {name: "send_ss_cmd_6_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020101", func: testSendSS, - expect: {name: "send_ss_cmd_7", + expect: {name: "send_ss_cmd_7_with_alpha_identifier", commandQualifier: 0x00, title: "Basic Icon"}}, + {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020101", + func: testSendSS, + expect: {name: "send_ss_cmd_7_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d036810301110082028183851980041704140420041004120421042204120423041904220415891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_8", + expect: {name: "send_ss_cmd_8_with_alpha_identifier", commandQualifier: 0x00, title: "ЗДРАВСТВУЙТЕ"}}, + // send_ss_cmd_8_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001000b4", func: testSendSS, - expect: {name: "send_ss_cmd_9", + expect: {name: "send_ss_cmd_9_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001000b4", + func: testSendSS, + expect: {name: "send_ss_cmd_9_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_10", + expect: {name: "send_ss_cmd_10_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_ss_cmd_10_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001001b4", func: testSendSS, - expect: {name: "send_ss_cmd_11", + expect: {name: "send_ss_cmd_11_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001001b4", func: testSendSS, - expect: {name: "send_ss_cmd_12", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ss_cmd_11_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001002b4", func: testSendSS, - expect: {name: "send_ss_cmd_13", + expect: {name: "send_ss_cmd_12_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001002b4", func: testSendSS, - expect: {name: "send_ss_cmd_14", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ss_cmd_12_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001004b4", func: testSendSS, - expect: {name: "send_ss_cmd_15", + expect: {name: "send_ss_cmd_13_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001004b4", + func: testSendSS, + expect: {name: "send_ss_cmd_13_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", func: testSendSS, - expect: {name: "send_ss_cmd_16", + expect: {name: "send_ss_cmd_14_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_ss_cmd_14_without_alpha_identifier has the same pdu as + // send_ss_cmd_9_without_alpha_identifier. {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_17", + expect: {name: "send_ss_cmd_15_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 3"}}, + // send_ss_cmd_15_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001008b4", func: testSendSS, - expect: {name: "send_ss_cmd_18", + expect: {name: "send_ss_cmd_16_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001008b4", func: testSendSS, - expect: {name: "send_ss_cmd_19", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_20", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ss_cmd_16_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001010b4", func: testSendSS, - expect: {name: "send_ss_cmd_21", + expect: {name: "send_ss_cmd_17_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001010b4", func: testSendSS, - expect: {name: "send_ss_cmd_22", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_23", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ss_cmd_17_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001020b4", func: testSendSS, - expect: {name: "send_ss_cmd_24", + expect: {name: "send_ss_cmd_18_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001020b4", func: testSendSS, - expect: {name: "send_ss_cmd_25", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_26", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ss_cmd_18_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001040b4", func: testSendSS, - expect: {name: "send_ss_cmd_27", + expect: {name: "send_ss_cmd_19_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001040b4", func: testSendSS, - expect: {name: "send_ss_cmd_28", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_29", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ss_cmd_19_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001080b4", func: testSendSS, - expect: {name: "send_ss_cmd_30", + expect: {name: "send_ss_cmd_20_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4", + {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001080b4", func: testSendSS, - expect: {name: "send_ss_cmd_31", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_32", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, - {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001000b4", - func: testSendSS, - expect: {name: "send_ss_cmd_33", - commandQualifier: 0x00, - title: "Text Attribute 1"}}, - {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb", - func: testSendSS, - expect: {name: "send_ss_cmd_34", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ss_cmd_20_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0228103011100820281838505804f60597d891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_35", + expect: {name: "send_ss_cmd_21_with_alpha_identifier", commandQualifier: 0x00, title: "你好"}}, + // send_ss_cmd_21_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. {command: "d02081030111008202818385038030eb891091aa120a214365870921436587a901fb", func: testSendSS, - expect: {name: "send_ss_cmd_36", + expect: {name: "send_ss_cmd_22_with_alpha_identifier", commandQualifier: 0x00, - title: "ル"}} + title: "ル"}}, + // send_ss_cmd_22_without_alpha_identifier has the same pdu as + // send_ss_cmd_1_without_alpha_identifier. ]; runNextTest(); diff --git a/dom/icc/tests/marionette/test_stk_send_ussd.js b/dom/icc/tests/marionette/test_stk_send_ussd.js index 41812a63056c..c051cc6856cc 100644 --- a/dom/icc/tests/marionette/test_stk_send_ussd.js +++ b/dom/icc/tests/marionette/test_stk_send_ussd.js @@ -7,9 +7,7 @@ function testSendUSSD(command, expect) { log("STK CMD " + JSON.stringify(command)); is(command.typeOfCommand, iccManager.STK_CMD_SEND_USSD, expect.name); is(command.commandQualifier, expect.commandQualifier, expect.name); - if (command.options.text) { - is(command.options.text, expect.title, expect.name); - } + is(command.options.text, expect.title, expect.name); runNextTest(); } @@ -17,189 +15,195 @@ function testSendUSSD(command, expect) { let tests = [ {command: "d050810301120082028183850a372d62697420555353448a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_1", + expect: {name: "send_ussd_cmd_1_with_alpha_identifier", commandQualifier: 0x00, title: "7-bit USSD"}}, + {command: "d0448103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_1_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d058810301120082028183850a382d62697420555353448a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930", func: testSendUSSD, - expect: {name: "send_ussd_cmd_2", + expect: {name: "send_ussd_cmd_2_with_alpha_identifier", commandQualifier: 0x00, title: "8-bit USSD"}}, + {command: "d04c8103011200820281838a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_2_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d02f81030112008202818385095543533220555353448a1948041704140420041004120421042204120423041904220415", func: testSendUSSD, - expect: {name: "send_ussd_cmd_3", + expect: {name: "send_ussd_cmd_3_with_alpha_identifier", commandQualifier: 0x00, title: "UCS2 USSD"}}, + {command: "d0248103011200820281838a1948041704140420041004120421042204120423041904220415", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_3_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d081fd8103011200820281838581b66f6e636520612052454c4541534520434f4d504c455445206d65737361676520636f6e7461696e696e672074686520555353442052657475726e20526573756c74206d657373616765206e6f7420636f6e7461696e696e6720616e206572726f7220686173206265656e2072656365697665642066726f6d20746865206e6574776f726b2c20746865204d45207368616c6c20696e666f726d207468652053494d20746861742074686520636f6d6d616e64206861738a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_4", + expect: {name: "send_ussd_cmd_4_with_alpha_identifier", commandQualifier: 0x00, title: "once a RELEASE COMPLETE message containing the USSD Return Result message not containing an error has been received from the network, the ME shall inform the SIM that the command has"}}, + // send_ussd_cmd_4_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d04681030112008202818385008a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_5", + expect: {name: "send_ussd_cmd_5_with_alpha_identifier", commandQualifier: 0x00, title: ""}}, + // send_ussd_cmd_5_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001", func: testSendUSSD, - expect: {name: "send_ussd_cmd_6", + expect: {name: "send_ussd_cmd_6_with_alpha_identifier", commandQualifier: 0x00, title: "Basic Icon"}}, + {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_6_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002", func: testSendUSSD, - expect: {name: "send_ussd_cmd_7", + expect: {name: "send_ussd_cmd_7_with_alpha_identifier", commandQualifier: 0x00, title: "Color Icon"}}, + {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_7_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101", func: testSendUSSD, - expect: {name: "send_ussd_cmd_8", + expect: {name: "send_ussd_cmd_8_with_alpha_identifier", commandQualifier: 0x00, title: "Basic Icon"}}, + {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_8_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_9", + expect: {name: "send_ussd_cmd_9_with_alpha_identifier", commandQualifier: 0x00, title: "ЗДРАВСТВУЙТЕ"}}, + // send_ussd_cmd_9_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_10", + expect: {name: "send_ussd_cmd_10_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_10_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_11", + expect: {name: "send_ussd_cmd_11_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_ussd_cmd_11_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_12", + expect: {name: "send_ussd_cmd_12_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_13", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ussd_cmd_12_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_14", + expect: {name: "send_ussd_cmd_13_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_15", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ussd_cmd_13_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_16", + expect: {name: "send_ussd_cmd_14_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4", + func: testSendUSSD, + expect: {name: "send_ussd_cmd_14_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_17", + expect: {name: "send_ussd_cmd_15_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 2"}}, + // send_ussd_cmd_15_without_alpha_identifier has the same pdu as + // send_ussd_cmd_10_with_alpha_identifier. {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_18", + expect: {name: "send_ussd_cmd_16_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 3"}}, + // send_ussd_cmd_16_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_19", + expect: {name: "send_ussd_cmd_17_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_20", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_21", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ussd_cmd_17_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_22", + expect: {name: "send_ussd_cmd_18_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_23", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_24", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ussd_cmd_18_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_25", + expect: {name: "send_ussd_cmd_19_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_26", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_27", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ussd_cmd_19_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_28", + expect: {name: "send_ussd_cmd_20_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_29", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_30", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, + expect: {name: "send_ussd_cmd_20_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_31", + expect: {name: "send_ussd_cmd_21_with_alpha_identifier", commandQualifier: 0x00, title: "Text Attribute 1"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", + {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4", func: testSendUSSD, - expect: {name: "send_ussd_cmd_32", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, - {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_33", - commandQualifier: 0x00, - title: "Text Attribute 3"}}, - {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_34", - commandQualifier: 0x00, - title: "Text Attribute 1"}}, - {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", - func: testSendUSSD, - expect: {name: "send_ussd_cmd_35", - commandQualifier: 0x00, - title: "Text Attribute 2"}}, + expect: {name: "send_ussd_cmd_21_without_alpha_identifier", + commandQualifier: 0x00}}, {command: "d04b8103011200820281838505804f60597d8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_36", + expect: {name: "send_ussd_cmd_22_with_alpha_identifier", commandQualifier: 0x00, title: "你好"}}, + // send_ussd_cmd_22_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. {command: "d04981030112008202818385038030eb8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", func: testSendUSSD, - expect: {name: "send_ussd_cmd_37", + expect: {name: "send_ussd_cmd_23_with_alpha_identifier", commandQualifier: 0x00, - title: "ル"}} + title: "ル"}}, + // send_ussd_cmd_23_without_alpha_identifier has the same pdu as + // send_ussd_cmd_1_without_alpha_identifier. ]; runNextTest(); From f2f1df4946301a2d8bfcd3bbc15e2c62563c262d Mon Sep 17 00:00:00 2001 From: Martijn Wargers Date: Fri, 20 Sep 2013 12:50:26 +0200 Subject: [PATCH 16/60] Bug 873403 - Convert test_bug260264.html to use SpecialPowers. r=jst --- dom/tests/mochitest/bugs/child_bug260264.html | 7 +- dom/tests/mochitest/bugs/test_bug260264.html | 232 ++++++++++-------- .../mochitest/bugs/test_bug260264_nested.html | 178 ++++++++------ dom/tests/mochitest/bugs/utils_bug260264.js | 114 +-------- 4 files changed, 240 insertions(+), 291 deletions(-) diff --git a/dom/tests/mochitest/bugs/child_bug260264.html b/dom/tests/mochitest/bugs/child_bug260264.html index a40e1750269b..e8f7d578b996 100644 --- a/dom/tests/mochitest/bugs/child_bug260264.html +++ b/dom/tests/mochitest/bugs/child_bug260264.html @@ -1,14 +1,11 @@ - - diff --git a/dom/tests/mochitest/bugs/test_bug260264.html b/dom/tests/mochitest/bugs/test_bug260264.html index 5f6fd3e99f45..d54db909f8fc 100644 --- a/dom/tests/mochitest/bugs/test_bug260264.html +++ b/dom/tests/mochitest/bugs/test_bug260264.html @@ -25,117 +25,157 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=260264 SimpleTest.waitForExplicitFinish(); -/** - * These functions can be called without arguments to retrieve the current - * value of the preference/privilege, or called with a single argument to set - * the preference/privilege to a new value. - * - * In other words, they obey the interface that |hold| expects its |accessor| - * parameter to obey. - */ -var popupMax = makePrefAccessor("dom.popup_maximum"), - popupEvents = makePrefAccessor("dom.popup_allowed_events"), - blockPopups = makePrefAccessor("dom.disable_open_during_load"), - ownPopupPriv = makePopupPrivAccessor(location.href); - var a = $("link"), checkOpened = function() { ok(window.open("http://example.com"), "not properly opened") }, checkBlocked = function() { ok(!window.open("http://example.com"), "not properly blocked") }; -/** - * Intentional popups are not limited by dom.popup_maximum. - */ -function testIntentional(event) { - hold(popupMax, 3, function() { - send(a, event, checkOpened); - send(a, event, checkOpened); - send(a, event, checkOpened); - send(a, event, checkOpened); - }); - window.open.close(); -} -/** - * Probably-intentional popups are limited only by dom.popup_maximum, and - * closing the popup window immediately allows another to open. - */ -function testProbablyIntentional(event) { - var max = 3; - hold(popupMax, max, function() { - for (var count = 0, n = 0; n < max; n++) - send(a, event, function() { if (window.open("http://example.com")) count++ }); - send(a, event, checkBlocked); - window.open.close(1); - send(a, event, checkOpened); - send(a, event, checkBlocked); - send(a, event, checkBlocked); - window.open.close(); - ok(count > 0, "Windows left open by previous tests?"); - while (count --> 0) - send(a, event, checkOpened); - send(a, event, checkBlocked); - }); - window.open.close(); -} - -/** - * Probably-unintentional popups are forbidden entirely. - */ -function testProbablyUnintentional(event) { - hold(popupMax, 2, function() { - send(a, event, checkBlocked); - }); - window.open.close(); -} - -/** - * Please be patient; run_tests opens/closes a LOT of windows. - */ function run_tests() { - hold(popupEvents, "click mouseup", function() { - // Note: UNKNOWN_ACTION is the same as DENY_ACTION. - hold(ownPopupPriv, DENY_ACTION, function() { - testIntentional("click"); - testProbablyIntentional("mouseup"); - testProbablyUnintentional("mouseover"); - }); - hold(ownPopupPriv, ALLOW_ACTION, function() { - testIntentional("click"); - testIntentional("mouseup"); - testProbablyIntentional("mouseover"); - }); - }); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + window.open.close(); - hold(popupEvents, "click", function() { - // Note: UNKNOWN_ACTION is the same as DENY_ACTION. - hold(ownPopupPriv, DENY_ACTION, function() { - testIntentional("click"); - testProbablyUnintentional("mouseup"); - testProbablyUnintentional("mouseover"); - }); - hold(ownPopupPriv, ALLOW_ACTION, function() { - testIntentional("click"); - testProbablyIntentional("mouseup"); - testProbablyIntentional("mouseover"); - }); - }); + SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests2); +} - window.open.close(); // just in case +function run_tests2() { + for (var count = 0, n = 0; n < 3; n++) + send(a, "mouseup", function() { if (window.open("http://example.com")) count++ }); + send(a, "mouseup", checkBlocked); + window.open.close(1); + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkBlocked); + send(a, "mouseup", checkBlocked); + window.open.close(); + ok(count > 0, "Windows left open by previous tests?"); + while (count --> 0) + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkBlocked); + window.open.close(); + + SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 2]]}, run_tests3); +} + +function run_tests3() { + send(a, "mouseover", checkBlocked); + window.open.close(); + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': ALLOW_ACTION, 'context': document}], function() { + SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests4); + }); +} + +function run_tests4() { + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + window.open.close(); + + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkOpened); + window.open.close(); + + for (var count = 0, n = 0; n < 3; n++) + send(a, "mouseover", function() { if (window.open("http://example.com")) count++ }); + send(a, "mouseover", checkBlocked); + window.open.close(1); + send(a, "mouseover", checkOpened); + send(a, "mouseover", checkBlocked); + send(a, "mouseover", checkBlocked); + window.open.close(); + ok(count > 0, "Windows left open by previous tests?"); + while (count --> 0) + send(a, "mouseover", checkOpened); + send(a, "mouseover", checkBlocked); + window.open.close(); + + SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events", "click"]]}, run_tests5); +} + +function run_tests5() { + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': DENY_ACTION, 'context': document}], run_tests6); +} + +function run_tests6() { + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + window.open.close(); + + SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 2]]}, run_tests7); +} + +function run_tests7() { + send(a, "mouseup", checkBlocked); + window.open.close(); + send(a, "mouseover", checkBlocked); + window.open.close(); + + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': ALLOW_ACTION, 'context': document}], function() { + SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests8); + }); +} + +function run_tests8() { + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + send(a, "click", checkOpened); + window.open.close(); + + for (var count = 0, n = 0; n < 3; n++) + send(a, "mouseup", function() { if (window.open("http://example.com")) count++ }); + send(a, "mouseup", checkBlocked); + window.open.close(1); + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkBlocked); + send(a, "mouseup", checkBlocked); + window.open.close(); + ok(count > 0, "Windows left open by previous tests?"); + while (count --> 0) + send(a, "mouseup", checkOpened); + send(a, "mouseup", checkBlocked); + window.open.close(); + + for (var count = 0, n = 0; n < 3; n++) + send(a, "mouseover", function() { if (window.open("http://example.com")) count++ }); + send(a, "mouseover", checkBlocked); + window.open.close(1); + send(a, "mouseover", checkOpened); + send(a, "mouseover", checkBlocked); + send(a, "mouseover", checkBlocked); + window.open.close(); + ok(count > 0, "Windows left open by previous tests?"); + while (count --> 0) + send(a, "mouseover", checkOpened); + send(a, "mouseover", checkBlocked); + window.open.close(); + + SimpleTest.finish(); } function check_sanity() { - hold(ownPopupPriv, UNKNOWN_ACTION, function(unknown) { - hold(ownPopupPriv, ALLOW_ACTION, function(allow) { - is(ownPopupPriv(), allow, "properly set to allow"); - }); - is(ownPopupPriv(), unknown, "properly reset to unknown"); + ok(SpecialPowers.testPermission('popup', UNKNOWN_ACTION, document), 'popup value should have UNKNOWN permission'); + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': true, 'context': document}], check_sanity2); +} + +function check_sanity2() { + ok(SpecialPowers.testPermission('popup', ALLOW_ACTION, document), 'popup value should have ALLOW permission'); + SpecialPowers.pushPrefEnv({"set": [["dom.disable_open_during_load", true], + ["dom.popup_allowed_events", "click mouseup"], + ["dom.popup_maximum", 3]]}, function() { + // Note: UNKNOWN_ACTION is the same as DENY_ACTION. + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': DENY_ACTION, 'context': document}], run_tests); }); } setTimeout(function() { - check_sanity(); - hold(blockPopups, true, run_tests); - SimpleTest.finish(); + SpecialPowers.pushPermissions([{'type': 'popup', 'remove': true, 'context': document}], check_sanity); }, 200); diff --git a/dom/tests/mochitest/bugs/test_bug260264_nested.html b/dom/tests/mochitest/bugs/test_bug260264_nested.html index 341ace1b6579..230324389a25 100644 --- a/dom/tests/mochitest/bugs/test_bug260264_nested.html +++ b/dom/tests/mochitest/bugs/test_bug260264_nested.html @@ -22,96 +22,112 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=260264 SimpleTest.waitForExplicitFinish(); -netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); -var popupEvents = makePrefAccessor("dom.popup_allowed_events"), - blockPopups = makePrefAccessor("dom.disable_open_during_load"), - ownPopupPriv = makePopupPrivAccessor(location.href), - ecPopupPriv = makePopupPrivAccessor("http://example.com"); +function makeIframe(aEvent) { + var tempURL = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')+1); + tempURL = 'http://example.com' + tempURL + "child_bug260264.html#" + aEvent; + $("display").appendChild(document.createElement("iframe")).src = tempURL; +} function test_nested_frames() { + SpecialPowers.pushPrefEnv({"set": [["dom.disable_open_during_load", true]]}, test_nested_frames2); +} - var savedBlockPopups = blockPopups(true); - +function test_nested_frames2() { // Grandchild will use this name to refer to the current window: window.name = "parent260264"; - function performer(event) { - $("display").appendChild(document.createElement("iframe")).src = - alter_file(alter_host(location.href, "example.com"), - "child_bug260264.html#" + event); + if (tests[0]) { + tests[0].setup(function() {makeIframe(tests[0].event);}); + } else { + ok(false, "There should have run 8 tests here"); + SimpleTest.finish(); } +} - function finisher(old) { - popupEvents(old.events); - ownPopupPriv(old.ownPriv); - ecPopupPriv(old.ecPriv); +function should_have_blocked(popup) { + ok(!popup, "popup should have been blocked"); +} + +function should_not_have_blocked(popup) { + ok(popup, "popup should not have been blocked"); +} + +function setupPP(aAllowedEvents, aPopup1, aPopup2, aNext) { + SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events", aAllowedEvents]]}, function() { + SpecialPowers.pushPermissions([{'type': 'popup', 'allow': aPopup1, 'context': document}, + {'type': 'popup', 'allow': aPopup2, 'context': 'http://example.com'}], aNext); + }); +} + +/** + * The example_priv (DENY_ACTION) parameter controls whether or not the child frame has + * popup clearance. Neither the top window nor the grandchild frame have + * this clearance. The point of these tests is to make sure the child's + * clearance (or lack thereof) is properly considered when opening a popup + * from the grandchild. +*/ + +var tests = [ + { event: "mouseup", + setup: function(aNext) { + setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext); + }, + report: should_not_have_blocked + }, + { event: "mouseup", + setup: function(aNext) { + setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext); + }, + report: should_not_have_blocked + }, + { event: "mouseup", + setup: function(aNext) { + setupPP("click", ALLOW_ACTION, ALLOW_ACTION, aNext); + }, + report: should_not_have_blocked + }, + { event: "mouseup", + setup: function(aNext) { + setupPP("click", DENY_ACTION, DENY_ACTION, aNext); + }, + report: should_have_blocked + }, + { event: "mouseover", + setup: function(aNext) { + setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext); + }, + report: should_have_blocked + }, + { event: "mouseover", + setup: function(aNext) { + setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext); + }, + report: should_not_have_blocked + }, + { event: "click", + setup: function(aNext) { + setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext); + }, + report: should_not_have_blocked + }, + { event: "click", + setup: function(aNext) { + setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext); + }, + report: should_not_have_blocked + } +]; + +// Visible to child windows: +function report(popup) { + tests[0].report(popup); + tests.shift(); + + if (tests[0]) { + tests[0].setup(function() {makeIframe(tests[0].event);}); + } else { + SimpleTest.finish(); } - - function should_have_blocked(popup) { - ok(!popup, "popup should have been blocked"); - } - - function should_not_have_blocked(popup) { - ok(popup, "popup should not have been blocked"); - } - - /** - * The example_priv parameter controls whether or not the child frame has - * popup clearance. Neither the top window nor the grandchild frame have - * this clearance. The point of these tests is to make sure the child's - * clearance (or lack thereof) is properly considered when opening a popup - * from the grandchild. - */ - function makeTest(event, example_priv, reporter, allowed_events) { - return { - event: event, - setup: function(old) { - old.events = popupEvents(allowed_events || "click mouseup"); - old.ownPriv = ownPopupPriv(DENY_ACTION); - old.ecPriv = ecPopupPriv(example_priv); - }, - report: reporter, - perform: performer, - finish: finisher - }; - }; - - var tests = [ - makeTest("mouseup", DENY_ACTION, should_not_have_blocked), - makeTest("mouseup", ALLOW_ACTION, should_not_have_blocked), - makeTest("mouseup", ALLOW_ACTION, should_not_have_blocked, "click"), - makeTest("mouseup", DENY_ACTION, should_have_blocked, "click"), - makeTest("mouseover", DENY_ACTION, should_have_blocked), - makeTest("mouseover", ALLOW_ACTION, should_not_have_blocked), - makeTest("click", DENY_ACTION, should_not_have_blocked), - makeTest("click", ALLOW_ACTION, should_not_have_blocked) - ]; - - function resume() { - var options = tests[0]; - if (options) { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - options.setup(tests[0].old = {}); - options.perform(options.event); - } else { - blockPopups(savedBlockPopups); - SimpleTest.finish(); - } - } - - // Visible to child windows: - window.report = function(popup) { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - try { tests[0].report(popup) } - finally { - tests[0].finish(tests[0].old); - tests.shift(); - resume(); - } - } - - resume(); - } test_nested_frames(); diff --git a/dom/tests/mochitest/bugs/utils_bug260264.js b/dom/tests/mochitest/bugs/utils_bug260264.js index 67b267068f08..90e349e5818f 100644 --- a/dom/tests/mochitest/bugs/utils_bug260264.js +++ b/dom/tests/mochitest/bugs/utils_bug260264.js @@ -1,3 +1,8 @@ +const ALLOW_ACTION = SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION; +const DENY_ACTION = SpecialPowers.Ci.nsIPermissionManager.DENY_ACTION; +const UNKNOWN_ACTION = SpecialPowers.Ci.nsIPermissionManager.UNKNOWN_ACTION; +const PROMPT_ACTION = SpecialPowers.Ci.nsIPermissionManager.PROMPT_ACTION; + /** * Dispatches |handler| to |element|, as if fired in response to |event|. */ @@ -29,112 +34,3 @@ function send(element, event, handler) { } }; })(window.open); - -function _alter_helper(uri, fn) { - var hash_splat = uri.split("#"), - splat = hash_splat.shift().split("/"); - fn(splat); - hash_splat.unshift(splat.join("/")); - return hash_splat.join("#"); -} - -function alter_host(uri, host) { - return _alter_helper(uri, function(splat) { - splat.splice(2, 1, host); - }); -} - -function alter_file(uri, file) { - return _alter_helper(uri, function(splat) { - splat[splat.length - 1] = file; - }); -} - -(function() { - - var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"] - .getService(SpecialPowers.Ci.nsIPrefService), - pm = SpecialPowers.Cc["@mozilla.org/permissionmanager;1"] - .getService(SpecialPowers.Ci.nsIPermissionManager), - ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] - .getService(SpecialPowers.Ci.nsIIOService); - - ALLOW_ACTION = pm.ALLOW_ACTION; - DENY_ACTION = pm.DENY_ACTION; - UNKNOWN_ACTION = pm.UNKNOWN_ACTION; - - /** - * This ridiculously over-engineered function makes an accessor function from - * any given preference string. Such accessors may be passed as the first - * parameter to the |hold| function defined below. - */ - makePrefAccessor = function(pref) { - var splat = pref.split('.'), - basePref = splat.pop(), - branch, kind; - - try { - branch = prefService.getBranch(splat.join('.') + '.'); - } catch (x) { - alert("Calling prefService.getBranch failed: " + - "did you forget to enable UniversalXPConnect?"); - throw x; - } - - switch (branch.getPrefType(basePref)) { - case branch.PREF_STRING: kind = "CharPref"; break; - case branch.PREF_INT: kind = "IntPref"; break; - case branch.PREF_BOOL: kind = "BoolPref"; break; - case branch.PREF_INVALID: kind = "ComplexValue"; - } - - return function(value) { - var oldValue = branch['get' + kind](basePref); - if (arguments.length > 0) - branch['set' + kind](basePref, value); - return oldValue; - }; - }; - - makePopupPrivAccessor = function(uri) { - uri = ioService.newURI(uri, null, null); - var principal = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"] - .getService(SpecialPowers.Ci.nsIScriptSecurityManager) - .getNoAppCodebasePrincipal(uri); - - return function(permission) { - var old = pm.testPermissionFromPrincipal(principal, "popup"); - if (arguments.length) { - pm.removeFromPrincipal(principal, "popup"); - pm.addFromPrincipal(principal, "popup", permission); - } - return old; - }; - }; - -})(); - -/** - * This function takes an accessor function, a new value, and a callback - * function. It assigns the new value to the accessor, saving the old value, - * then calls the callback function with the new and old values. Before - * returning, |hold| sets the accessor back to the old value, even if the - * callback function misbehaved (i.e., threw). - * - * For sanity's sake, |hold| also ensures that the accessor still has the new - * value at the time the old value is reassigned. The accessor's value might - * have changed to something entirely different during the execution of the - * callback function, but it must have changed back. - * - * Without such a mechanism it would be very difficult to verify that these - * tests leave the browser's preferences/privileges as they were originally. - */ -function hold(accessor, value, body) { - var old_value = accessor(value); - try { return body(value, old_value) } - finally { - old_value = accessor(old_value); - if (old_value !== value) - throw [accessor, value, old_value]; - } -} From c96b89f3e84759b596d740c11a81c1e43d0d2ea6 Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Fri, 11 Jul 2014 18:02:00 +0200 Subject: [PATCH 17/60] Bug 1037446 - [rule view] Adding new rules fails when document.head is undefined. r=harth --- toolkit/devtools/server/actors/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/devtools/server/actors/styles.js b/toolkit/devtools/server/actors/styles.js index d0b422c76b3b..63256b91c8af 100644 --- a/toolkit/devtools/server/actors/styles.js +++ b/toolkit/devtools/server/actors/styles.js @@ -559,9 +559,9 @@ var PageStyleActor = protocol.ActorClass({ get styleElement() { if (!this._styleElement) { let document = this.inspector.window.document; - let style = document.createElement("style"); + let style = document.createElementNS("http://www.w3.org/1999/xhtml", "style"); style.setAttribute("type", "text/css"); - document.head.appendChild(style); + document.documentElement.appendChild(style); this._styleElement = style; } From 783398a251403af818c61636132539619c76baf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Mon, 14 Jul 2014 14:35:30 +0200 Subject: [PATCH 18/60] Bug 1037411 - Set the appropriate text color for -moz-appearance: menubar. r=gijs --- toolkit/themes/linux/global/toolbar.css | 1 + 1 file changed, 1 insertion(+) diff --git a/toolkit/themes/linux/global/toolbar.css b/toolkit/themes/linux/global/toolbar.css index e8e082f15acb..f988fe59103e 100644 --- a/toolkit/themes/linux/global/toolbar.css +++ b/toolkit/themes/linux/global/toolbar.css @@ -25,6 +25,7 @@ toolbar { menubar, toolbar[type="menubar"] { -moz-appearance: menubar; + color: -moz-menubartext; min-width: 1px; min-height: 20px; padding: 1px 0px; From 801b3755283f6b17da2a66f35ddd9d18500d71c1 Mon Sep 17 00:00:00 2001 From: Paolo Amadini Date: Mon, 14 Jul 2014 13:51:56 +0100 Subject: [PATCH 19/60] Bug 1020865 - Implement the dialog displayed upon form.requestAutocomplete(). r=MattN --HG-- rename : toolkit/components/formautofill/test/chrome/test_requestAutocomplete_disabled.html => toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.html --- b2g/installer/package-manifest.in | 1 + browser/installer/package-manifest.in | 1 + mobile/android/installer/package-manifest.in | 1 + .../FormAutofillContentService.js | 38 ++++++++--- .../formautofill/FormAutofillIntegration.jsm | 4 +- .../content/RequestAutocompleteUI.jsm | 52 +++++++++++++++ .../content/requestAutocomplete.js | 44 +++++++++++++ .../content/requestAutocomplete.xhtml | 31 +++++++++ toolkit/components/formautofill/jar.mn | 8 +++ toolkit/components/formautofill/moz.build | 5 ++ .../formautofill/test/browser/browser.ini | 1 + .../browser/browser_ui_requestAutocomplete.js | 43 ++++++++++++ .../formautofill/test/chrome/chrome.ini | 2 +- ...l => test_requestAutocomplete_cancel.html} | 15 +++-- .../formautofill/test/head_common.js | 65 ++++++++++++++++++- .../test/xpcshell/test_integration.js | 19 ++++-- .../formautofill/requestAutocomplete.dtd | 5 ++ toolkit/locales/jar.mn | 2 + toolkit/themes/osx/mozapps/jar.mn | 1 + .../formautofill/requestAutocomplete.css | 11 ++++ toolkit/themes/windows/mozapps/jar.mn | 2 + 21 files changed, 332 insertions(+), 19 deletions(-) create mode 100644 toolkit/components/formautofill/content/RequestAutocompleteUI.jsm create mode 100644 toolkit/components/formautofill/content/requestAutocomplete.js create mode 100644 toolkit/components/formautofill/content/requestAutocomplete.xhtml create mode 100644 toolkit/components/formautofill/jar.mn create mode 100644 toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js rename toolkit/components/formautofill/test/chrome/{test_requestAutocomplete_disabled.html => test_requestAutocomplete_cancel.html} (58%) create mode 100644 toolkit/locales/en-US/chrome/formautofill/requestAutocomplete.dtd create mode 100644 toolkit/themes/shared/formautofill/requestAutocomplete.css diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 92e8f9486e42..68c40a6be977 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -293,6 +293,7 @@ @BINPATH@/components/storage.xpt @BINPATH@/components/telemetry.xpt @BINPATH@/components/toolkit_finalizationwitness.xpt +@BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt @BINPATH@/components/toolkitprofile.xpt #ifdef MOZ_ENABLE_XREMOTE diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 4ed6f2847c70..f79c21ffb329 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -300,6 +300,7 @@ @BINPATH@/components/spellchecker.xpt @BINPATH@/components/storage.xpt @BINPATH@/components/toolkit_finalizationwitness.xpt +@BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt @BINPATH@/components/toolkitprofile.xpt #ifdef MOZ_ENABLE_XREMOTE diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 353cfd84facd..732a332438b6 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -247,6 +247,7 @@ @BINPATH@/components/storage.xpt @BINPATH@/components/telemetry.xpt @BINPATH@/components/toolkit_finalizationwitness.xpt +@BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt @BINPATH@/components/toolkitprofile.xpt #ifdef MOZ_ENABLE_XREMOTE diff --git a/toolkit/components/formautofill/FormAutofillContentService.js b/toolkit/components/formautofill/FormAutofillContentService.js index 99f16c247e09..966f5c57b9b3 100644 --- a/toolkit/components/formautofill/FormAutofillContentService.js +++ b/toolkit/components/formautofill/FormAutofillContentService.js @@ -16,6 +16,11 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "FormAutofill", + "resource://gre/modules/FormAutofill.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); + function FormAutofillContentService() { } @@ -25,16 +30,33 @@ FormAutofillContentService.prototype = { // nsIFormAutofillContentService requestAutocomplete: function (aForm, aWindow) { - Services.console.logStringMessage("requestAutocomplete not implemented."); + Task.spawn(function* () { + // Start processing the request asynchronously. At the end, the "reason" + // variable will contain the outcome of the operation, where an empty + // string indicates that an unexpected exception occurred. + let reason = ""; + try { + let ui = yield FormAutofill.integration.createRequestAutocompleteUI({}); + let result = yield ui.show(); - // We will return "disabled" for now. - let event = new aWindow.AutocompleteErrorEvent("autocompleteerror", - { bubbles: true, - reason: "disabled" }); + // At present, we only have cancellation and success cases, since we + // don't do any validation or precondition check. + reason = result.canceled ? "cancel" : "success"; + } catch (ex) { + Cu.reportError(ex); + } - // Ensure the event is always dispatched on the next tick. - Services.tm.currentThread.dispatch(() => aForm.dispatchEvent(event), - Ci.nsIThread.DISPATCH_NORMAL); + // The type of event depends on whether this is a success condition. + let event = (reason == "success") + ? new aWindow.Event("autocomplete", { bubbles: true }) + : new aWindow.AutocompleteErrorEvent("autocompleteerror", + { bubbles: true, + reason: reason }); + + // Ensure the event is always dispatched on the next tick. + Services.tm.currentThread.dispatch(() => aForm.dispatchEvent(event), + Ci.nsIThread.DISPATCH_NORMAL); + }.bind(this)).catch(Cu.reportError); }, }; diff --git a/toolkit/components/formautofill/FormAutofillIntegration.jsm b/toolkit/components/formautofill/FormAutofillIntegration.jsm index 9c7001f9ce15..ac063996a575 100644 --- a/toolkit/components/formautofill/FormAutofillIntegration.jsm +++ b/toolkit/components/formautofill/FormAutofillIntegration.jsm @@ -24,6 +24,8 @@ Cu.import("resource://gre/modules/Services.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "RequestAutocompleteUI", + "resource://gre/modules/RequestAutocompleteUI.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); @@ -43,6 +45,6 @@ this.FormAutofillIntegration = { * @rejects JavaScript exception. */ createRequestAutocompleteUI: Task.async(function* (aProperties) { - return {}; + return new RequestAutocompleteUI(aProperties); }), }; diff --git a/toolkit/components/formautofill/content/RequestAutocompleteUI.jsm b/toolkit/components/formautofill/content/RequestAutocompleteUI.jsm new file mode 100644 index 000000000000..d8a0dece1ca1 --- /dev/null +++ b/toolkit/components/formautofill/content/RequestAutocompleteUI.jsm @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Handles the requestAutocomplete user interface. + */ + +"use strict"; + +this.EXPORTED_SYMBOLS = [ + "RequestAutocompleteUI", +]; + +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); + +/** + * Handles the requestAutocomplete user interface. + */ +this.RequestAutocompleteUI = function (aProperties) { +} + +this.RequestAutocompleteUI.prototype = { + show: Task.async(function* () { + // Create a new promise and store the function that will resolve it. This + // will be called by the UI once the selection has been made. + let resolveFn; + let uiPromise = new Promise(resolve => resolveFn = resolve); + + // Wrap the callback function so that it survives XPCOM. + let args = { resolveFn: resolveFn }; + args.wrappedJSObject = args; + + // Open the window providing the function to call when it closes. + Services.ww.openWindow(null, + "chrome://formautofill/content/requestAutocomplete.xhtml", + "Toolkit:RequestAutocomplete", + "chrome,dialog=no,resizable", + args); + + // Wait for the window to be closed and the operation confirmed. + return yield uiPromise; + }), +}; diff --git a/toolkit/components/formautofill/content/requestAutocomplete.js b/toolkit/components/formautofill/content/requestAutocomplete.js new file mode 100644 index 000000000000..0b0f431ac5da --- /dev/null +++ b/toolkit/components/formautofill/content/requestAutocomplete.js @@ -0,0 +1,44 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Implementation of "requestAutocomplete.xhtml". + */ + +"use strict"; + +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); + +const RequestAutocompleteDialog = { + resolveFn: null, + + onLoad: function () { + Task.spawn(function* () { + this.resolveFn = window.arguments[0].wrappedJSObject.resolveFn; + + window.sizeToContent(); + + Services.obs.notifyObservers(window, + "formautofill-window-initialized", ""); + }.bind(this)).catch(Cu.reportError); + }, + + onAccept: function () { + window.close(); + this.resolveFn({ email: "email@example.org" }); + }, + + onCancel: function () { + window.close(); + this.resolveFn({ canceled: true }); + }, +}; diff --git a/toolkit/components/formautofill/content/requestAutocomplete.xhtml b/toolkit/components/formautofill/content/requestAutocomplete.xhtml new file mode 100644 index 000000000000..269e55bd6830 --- /dev/null +++ b/toolkit/components/formautofill/content/requestAutocomplete.xhtml @@ -0,0 +1,31 @@ + + + + + %htmlDTD; + + %requestAutocompleteDTD; + + %globalDTD; +]> + + + + requestAutocomplete demo window + +