This commit is contained in:
Ryan VanderMeulen 2014-07-14 16:19:58 -04:00
Родитель 5d17335955 73bd274fb7
Коммит 0809471bf8
64 изменённых файлов: 1712 добавлений и 1341 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
@ -131,7 +131,7 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c61e5f15fd62888f2c33d7d542b5b65c38102e8b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="832f4acaf481a19031e479a40b03d9ce5370ddee"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
<project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
</manifest>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
@ -143,7 +143,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>

Просмотреть файл

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "168c5ba3a072b6c6b30bcc93586f833cc97fff4a",
"revision": "4a5a2ee1fd7ef549f4289bec42046a116b3251c0",
"repo_path": "/integration/gaia-central"
}

Просмотреть файл

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

Просмотреть файл

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -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

Просмотреть файл

@ -48,6 +48,11 @@ const kSubviewEvents = [
"ViewHiding"
];
/**
* The current version. We can use this to auto-add new default widgets as necessary.
*/
const kVersion = 0;
/**
* gPalette is a map of every widget that CustomizableUI.jsm knows about, keyed
* on their IDs.
@ -145,6 +150,7 @@ let CustomizableUIInternal = {
this.addListener(this);
this._defineBuiltInWidgets();
this.loadSavedState();
this._introduceNewBuiltinWidgets();
let panelPlacements = [
"edit-controls",
@ -276,6 +282,25 @@ let CustomizableUIInternal = {
}
},
_introduceNewBuiltinWidgets: function() {
if (!gSavedState || gSavedState.currentVersion >= kVersion) {
return;
}
let currentVersion = gSavedState.currentVersion;
for (let [id, widget] of gPalette) {
if (widget._introducedInVersion > currentVersion &&
widget.defaultArea) {
let futurePlacements = gFuturePlacements.get(widget.defaultArea);
if (futurePlacements) {
futurePlacements.add(id);
} else {
gFuturePlacements.set(widget.defaultArea, new Set([id]));
}
}
}
},
wrapWidget: function(aWidgetId) {
if (gGroupWrapperCache.has(aWidgetId)) {
return gGroupWrapperCache.get(aWidgetId);
@ -359,7 +384,9 @@ let CustomizableUIInternal = {
if (props.get("legacy") && !gPlacements.has(aName)) {
// Guarantee this area exists in gFuturePlacements, to avoid checking it in
// various places elsewhere.
gFuturePlacements.set(aName, new Set());
if (!gFuturePlacements.has(aName)) {
gFuturePlacements.set(aName, new Set());
}
} else {
this.restoreStateForArea(aName);
}
@ -1746,6 +1773,10 @@ let CustomizableUIInternal = {
gSavedState.placements = {};
}
if (!("currentVersion" in gSavedState)) {
gSavedState.currentVersion = 0;
}
gSeenWidgets = new Set(gSavedState.seen || []);
gDirtyAreaCache = new Set(gSavedState.dirtyAreaCache || []);
gNewElementCount = gSavedState.newElementCount || 0;
@ -1804,6 +1835,7 @@ let CustomizableUIInternal = {
if (gFuturePlacements.has(aArea)) {
for (let id of gFuturePlacements.get(aArea))
this.addWidgetToArea(id, aArea);
gFuturePlacements.delete(aArea);
}
LOG("Placements for " + aArea + ":\n\t" + gPlacements.get(aArea).join("\n\t"));
@ -1821,6 +1853,7 @@ let CustomizableUIInternal = {
let state = { placements: gPlacements,
seen: gSeenWidgets,
dirtyAreaCache: gDirtyAreaCache,
currentVersion: kVersion,
newElementCount: gNewElementCount };
LOG("Saving state.");
@ -1930,10 +1963,8 @@ let CustomizableUIInternal = {
if (widget.defaultArea) {
let addToDefaultPlacements = false;
let area = gAreas.get(widget.defaultArea);
if (widget.source == CustomizableUI.SOURCE_BUILTIN) {
addToDefaultPlacements = true;
} else if (!CustomizableUI.isBuiltinToolbar(widget.defaultArea) &&
widget.defaultArea != CustomizableUI.AREA_PANEL) {
if (!CustomizableUI.isBuiltinToolbar(widget.defaultArea) &&
widget.defaultArea != CustomizableUI.AREA_PANEL) {
addToDefaultPlacements = true;
}
@ -2060,6 +2091,7 @@ let CustomizableUIInternal = {
shortcutId: null,
tooltiptext: null,
showInPrivateBrowsing: true,
_introducedInVersion: -1,
};
if (typeof aData.id != "string" || !/^[a-z0-9-_]{1,}$/i.test(aData.id)) {
@ -2094,7 +2126,9 @@ let CustomizableUIInternal = {
}
}
if (aData.defaultArea && gAreas.has(aData.defaultArea)) {
// When we normalize builtin widgets, areas have not yet been registered:
if (aData.defaultArea &&
(aSource == CustomizableUI.SOURCE_BUILTIN || gAreas.has(aData.defaultArea))) {
widget.defaultArea = aData.defaultArea;
} else if (!widget.removable) {
ERROR("Widget '" + widget.id + "' is not removable but does not specify " +
@ -2111,6 +2145,10 @@ let CustomizableUIInternal = {
widget.disabled = aData.disabled === true;
if (aSource == CustomizableUI.SOURCE_BUILTIN) {
widget._introducedInVersion = aData.introducedInVersion || 0;
}
this.wrapWidgetEventHandler("onBeforeCreated", widget);
this.wrapWidgetEventHandler("onClick", widget);
this.wrapWidgetEventHandler("onCreated", widget);

Просмотреть файл

@ -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

Просмотреть файл

@ -436,13 +436,12 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(tim
[test_iframe_sandbox_general.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_iframe_sandbox_inheritance.html]
skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
[test_iframe_sandbox_modal.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #modal tests fail on android # b2g(modal tests fail on B2G) b2g-debug(modal tests fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_iframe_sandbox_navigation.html]
skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #time out on b2g desktop specific
[test_iframe_sandbox_navigation2.html]
skip-if = buildapp == 'b2g' || e10s # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #time out on b2g desktop specific
[test_iframe_sandbox_plugins.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
[test_iframe_sandbox_popups.html]

Просмотреть файл

@ -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 <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include "base/message_loop.h"
#include "BluetoothInterface.h"

Просмотреть файл

@ -20,10 +20,6 @@
#define BAND_76000_108000_kHz 2
#define BAND_76000_90000_kHz 3
#define CHANNEL_WIDTH_200KHZ 200
#define CHANNEL_WIDTH_100KHZ 100
#define CHANNEL_WIDTH_50KHZ 50
#define MOZSETTINGS_CHANGED_ID "mozsettings-changed"
#define SETTING_KEY_AIRPLANEMODE_ENABLED "airplaneMode.enabled"
@ -77,20 +73,31 @@ FMRadioService::FMRadioService()
break;
}
switch (Preferences::GetInt("dom.fmradio.channelWidth",
CHANNEL_WIDTH_100KHZ)) {
case CHANNEL_WIDTH_200KHZ:
mChannelWidthInKHz = 200;
mChannelWidthInKHz = Preferences::GetInt("dom.fmradio.channelWidth", 100);
switch (mChannelWidthInKHz) {
case 50:
case 100:
case 200:
break;
case CHANNEL_WIDTH_50KHZ:
mChannelWidthInKHz = 50;
break;
case CHANNEL_WIDTH_100KHZ:
default:
NS_WARNING("Invalid channel width specified in dom.fmradio.channelwidth");
mChannelWidthInKHz = 100;
break;
}
mPreemphasis = Preferences::GetInt("dom.fmradio.preemphasis", 50);
switch (mPreemphasis) {
// values in microseconds
case 0:
case 50:
case 75:
break;
default:
NS_WARNING("Invalid preemphasis specified in dom.fmradio.preemphasis");
mPreemphasis = 50;
break;
}
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
if (obs && NS_FAILED(obs->AddObserver(this,
@ -110,10 +117,13 @@ FMRadioService::~FMRadioService()
class EnableRunnable MOZ_FINAL : public nsRunnable
{
public:
EnableRunnable(int32_t aUpperLimit, int32_t aLowerLimit, int32_t aSpaceType)
EnableRunnable(uint32_t aUpperLimit, uint32_t aLowerLimit, uint32_t aSpaceType, uint32_t aPreemphasis)
: mUpperLimit(aUpperLimit)
, mLowerLimit(aLowerLimit)
, mSpaceType(aSpaceType) { }
, mSpaceType(aSpaceType)
, mPreemphasis(aPreemphasis)
{
}
NS_IMETHOD Run()
{
@ -121,6 +131,7 @@ public:
info.upperLimit() = mUpperLimit;
info.lowerLimit() = mLowerLimit;
info.spaceType() = mSpaceType;
info.preEmphasis() = mPreemphasis;
EnableFMRadio(info);
@ -128,9 +139,10 @@ public:
}
private:
int32_t mUpperLimit;
int32_t mLowerLimit;
int32_t mSpaceType;
uint32_t mUpperLimit;
uint32_t mLowerLimit;
uint32_t mSpaceType;
uint32_t mPreemphasis;
};
/**
@ -165,7 +177,8 @@ public:
EnableRunnable* runnable =
new EnableRunnable(fmRadioService->mUpperBoundInKHz,
fmRadioService->mLowerBoundInKHz,
fmRadioService->mChannelWidthInKHz);
fmRadioService->mChannelWidthInKHz,
fmRadioService->mPreemphasis);
NS_DispatchToMainThread(runnable);
} else {
// Airplane mode is enabled, set the state back to Disabled.
@ -457,7 +470,8 @@ FMRadioService::Enable(double aFrequencyInMHz,
NS_DispatchToMainThread(new EnableRunnable(mUpperBoundInKHz,
mLowerBoundInKHz,
mChannelWidthInKHz));
mChannelWidthInKHz,
mPreemphasis));
}
void

Просмотреть файл

@ -197,9 +197,10 @@ private:
bool mHasReadAirplaneModeSetting;
bool mAirplaneModeEnabled;
double mUpperBoundInKHz;
double mLowerBoundInKHz;
double mChannelWidthInKHz;
uint32_t mUpperBoundInKHz;
uint32_t mLowerBoundInKHz;
uint32_t mChannelWidthInKHz;
uint32_t mPreemphasis;
nsRefPtr<FMRadioReplyRunnable> mPendingRequest;

Просмотреть файл

@ -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();

Просмотреть файл

@ -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();

Просмотреть файл

@ -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();

Просмотреть файл

@ -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();

Просмотреть файл

@ -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;
},
@ -12267,6 +12263,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 +12741,11 @@ ICCRecordHelperObject.prototype = {
});
},
/**
* Cache the possible free record id for all files.
*/
_freeRecordIds: null,
/**
* Find free record id.
*
@ -12769,8 +12772,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 +12787,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 +12800,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 +14375,11 @@ ICCContactHelperObject.prototype = {
}
},
/**
* Cache the pbr index of the possible free record.
*/
_freePbrIndex: 0,
/**
* Find free ADN record id in USIM.
*
@ -14374,8 +14390,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 +14409,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);
},
/**

Просмотреть файл

@ -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);

Просмотреть файл

@ -1,14 +1,11 @@
<html>
<head>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="utils_bug260264.js"></script>
</head>
<body>
<iframe id="frame"></iframe>
<script type="application/javascript">
document.getElementById("frame").src =
alter_file(alter_host(location.href, "mochi.test:8888"),
"grandchild_bug260264.html");
var tempstr = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')+1);
document.getElementById("frame").src = "http://mochi.test:8888" + tempstr + "grandchild_bug260264.html" + window.location.hash;
</script>
</body>
</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);
</script>

Просмотреть файл

@ -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();

Просмотреть файл

@ -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];
}
}

Просмотреть файл

@ -27,6 +27,20 @@
#include <sys/stat.h>
#include <sys/types.h>
/* Bionic might not have the newer version of the v4l2 headers that
* define these controls, so we define them here if they're not found.
*/
#ifndef V4L2_CTRL_CLASS_FM_RX
#define V4L2_CTRL_CLASS_FM_RX 0x00a10000
#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900)
#define V4L2_CID_TUNE_DEEMPHASIS (V4L2_CID_FM_RX_CLASS_BASE + 1)
#define V4L2_DEEMPHASIS_DISABLED 0
#define V4L2_DEEMPHASIS_50_uS 1
#define V4L2_DEEMPHASIS_75_uS 2
#define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2)
#endif
namespace mozilla {
namespace hal_impl {
@ -318,6 +332,26 @@ EnableFMRadio(const hal::FMRadioSettings& aInfo)
HAL_LOG(("Unable to adjust band limits"));
}
int emphasis;
switch (aInfo.preEmphasis()) {
case 0:
emphasis = V4L2_DEEMPHASIS_DISABLED;
break;
case 50:
emphasis = V4L2_DEEMPHASIS_50_uS;
break;
case 75:
emphasis = V4L2_DEEMPHASIS_75_uS;
break;
default:
MOZ_CRASH("Invalid preemphasis setting");
break;
}
rc = setControl(V4L2_CID_TUNE_DEEMPHASIS, emphasis);
if (rc < 0) {
HAL_LOG(("Unable to configure deemphasis"));
}
sRadioFD = fd.forget();
sRadioEnabled = true;

Просмотреть файл

@ -697,12 +697,6 @@ class GCRuntime
GCHelperState helperState;
/*
* During incremental sweeping, this field temporarily holds the arenas of
* the current AllocKind being swept in order of increasing free space.
*/
SortedArenaList incrementalSweepList;
ConservativeGCData conservativeGC;
friend class js::GCHelperState;

Просмотреть файл

@ -39,7 +39,6 @@ namespace gc {
struct Arena;
class ArenaList;
class SortedArenaList;
struct ArenaHeader;
struct Chunk;
@ -598,7 +597,7 @@ struct Arena
void setAsFullyUnused(AllocKind thingKind);
template <typename T>
size_t finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize);
bool finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize);
};
static_assert(sizeof(Arena) == ArenaSize, "The hardcoded arena size must match the struct size.");
@ -829,8 +828,7 @@ struct Chunk
ArenaHeader *allocateArena(JS::Zone *zone, AllocKind kind);
void releaseArena(ArenaHeader *aheader);
void recycleArena(ArenaHeader *aheader, SortedArenaList &dest, AllocKind thingKind,
size_t thingsPerArena);
void recycleArena(ArenaHeader *aheader, ArenaList &dest, AllocKind thingKind);
static Chunk *allocate(JSRuntime *rt);

Просмотреть файл

@ -175,7 +175,6 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/MacroForEach.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Move.h"
@ -262,14 +261,7 @@ const AllocKind gc::slotsToThingKind[] = {
static_assert(JS_ARRAY_LENGTH(slotsToThingKind) == SLOTS_TO_THING_KIND_LIMIT,
"We have defined a slot count for each kind.");
// Assert that SortedArenaList::MinThingSize is <= the real minimum thing size.
#define CHECK_MIN_THING_SIZE_INNER(x_) \
static_assert(x_ >= SortedArenaList::MinThingSize, \
#x_ " is less than SortedArenaList::MinThingSize!");
#define CHECK_MIN_THING_SIZE(...) { __VA_ARGS__ }; /* Define the array. */ \
MOZ_FOR_EACH(CHECK_MIN_THING_SIZE_INNER, (), (__VA_ARGS__ UINT32_MAX))
const uint32_t Arena::ThingSizes[] = CHECK_MIN_THING_SIZE(
const uint32_t Arena::ThingSizes[] = {
sizeof(JSObject), /* FINALIZE_OBJECT0 */
sizeof(JSObject), /* FINALIZE_OBJECT0_BACKGROUND */
sizeof(JSObject_Slots2), /* FINALIZE_OBJECT2 */
@ -292,10 +284,7 @@ const uint32_t Arena::ThingSizes[] = CHECK_MIN_THING_SIZE(
sizeof(JSExternalString), /* FINALIZE_EXTERNAL_STRING */
sizeof(JS::Symbol), /* FINALIZE_SYMBOL */
sizeof(jit::JitCode), /* FINALIZE_JITCODE */
);
#undef CHECK_MIN_THING_SIZE_INNER
#undef CHECK_MIN_THING_SIZE
};
#define OFFSET(type) uint32_t(sizeof(ArenaHeader) + (ArenaSize - sizeof(ArenaHeader)) % sizeof(type))
@ -467,7 +456,7 @@ Arena::setAsFullyUnused(AllocKind thingKind)
}
template<typename T>
inline size_t
inline bool
Arena::finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize)
{
/* Enforce requirements on size of T. */
@ -513,7 +502,7 @@ Arena::finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize)
// Do nothing. The caller will update the arena header appropriately.
JS_ASSERT(newListTail == &newListHead);
JS_EXTRA_POISON(data, JS_SWEPT_TENURED_PATTERN, sizeof(data));
return nmarked;
return true;
}
JS_ASSERT(firstThingOrSuccessorOfLastMarkedThing != firstThing);
@ -534,38 +523,20 @@ Arena::finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize)
JS_ASSERT(nfree + nmarked == thingsPerArena(thingSize));
#endif
aheader.setFirstFreeSpan(&newListHead);
return nmarked;
}
ArenaList
SortedArenaList::toArenaList()
{
// Link the non-empty segment tails up to the non-empty segment heads.
size_t tailIndex = 0;
for (size_t headIndex = 1; headIndex <= thingsPerArena_; ++headIndex) {
if (headAt(headIndex)) {
segments[tailIndex].linkTo(headAt(headIndex));
tailIndex = headIndex;
}
}
// Point the tail of the final non-empty segment at null. Note that if the
// list is empty, this will just set segments[0].head to null, a noop.
segments[tailIndex].linkTo(nullptr);
// Return an ArenaList representing the flattened list.
return ArenaList(segments[0]);
return false;
}
template<typename T>
static inline bool
FinalizeTypedArenas(FreeOp *fop,
ArenaHeader **src,
SortedArenaList &dest,
ArenaList &dest,
AllocKind thingKind,
SliceBudget &budget)
{
/*
* Finalize arenas from src list, releasing empty arenas and inserting the
* others into the appropriate destination size bins.
* others into dest in an appropriate position.
*/
/*
@ -576,24 +547,22 @@ FinalizeTypedArenas(FreeOp *fop,
bool releaseArenas = !InParallelSection();
size_t thingSize = Arena::thingSize(thingKind);
size_t thingsPerArena = Arena::thingsPerArena(thingSize);
while (ArenaHeader *aheader = *src) {
*src = aheader->next;
size_t nmarked = aheader->getArena()->finalize<T>(fop, thingKind, thingSize);
size_t nfree = thingsPerArena - nmarked;
if (nmarked)
dest.insertAt(aheader, nfree);
bool allClear = aheader->getArena()->finalize<T>(fop, thingKind, thingSize);
if (!allClear)
dest.insertAtCursor(aheader);
else if (releaseArenas)
aheader->chunk()->releaseArena(aheader);
else
aheader->chunk()->recycleArena(aheader, dest, thingKind, thingsPerArena);
aheader->chunk()->recycleArena(aheader, dest, thingKind);
budget.step(thingsPerArena);
budget.step(Arena::thingsPerArena(thingSize));
if (budget.isOverBudget())
return false;
}
dest.deepCheck();
return true;
}
@ -605,7 +574,7 @@ FinalizeTypedArenas(FreeOp *fop,
static bool
FinalizeArenas(FreeOp *fop,
ArenaHeader **src,
SortedArenaList &dest,
ArenaList &dest,
AllocKind thingKind,
SliceBudget &budget)
{
@ -1004,11 +973,10 @@ Chunk::addArenaToFreeList(JSRuntime *rt, ArenaHeader *aheader)
}
void
Chunk::recycleArena(ArenaHeader *aheader, SortedArenaList &dest, AllocKind thingKind,
size_t thingsPerArena)
Chunk::recycleArena(ArenaHeader *aheader, ArenaList &dest, AllocKind thingKind)
{
aheader->getArena()->setAsFullyUnused(thingKind);
dest.insertAt(aheader, thingsPerArena);
dest.insertAtCursor(aheader);
}
void
@ -1933,6 +1901,10 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind,
* While we still hold the GC lock get an arena from some chunk, mark it
* as full as its single free span is moved to the free lists, and insert
* it to the list as a fully allocated arena.
*
* We add the arena before the the head, so that after the GC the most
* recently added arena will be used first for allocations. This improves
* cache locality.
*/
JS_ASSERT(al->isCursorAtEnd());
aheader = chunk->allocateArena(zone, thingKind);
@ -1941,7 +1913,7 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind,
if (MOZ_UNLIKELY(zone->wasGCStarted()))
rt->gc.arenaAllocatedDuringGC(zone, aheader);
al->insertAtCursor(aheader);
al->insertAtStart(aheader);
/*
* Allocate from a newly allocated arena. The arena will have been set up
@ -2014,14 +1986,9 @@ ArenaLists::forceFinalizeNow(FreeOp *fop, AllocKind thingKind)
ArenaHeader *arenas = arenaLists[thingKind].head();
arenaLists[thingKind].clear();
size_t thingsPerArena = Arena::thingsPerArena(Arena::thingSize(thingKind));
SortedArenaList finalizedSorted(thingsPerArena);
SliceBudget budget;
FinalizeArenas(fop, &arenas, finalizedSorted, thingKind, budget);
FinalizeArenas(fop, &arenas, arenaLists[thingKind], thingKind, budget);
JS_ASSERT(!arenas);
arenaLists[thingKind] = finalizedSorted.toArenaList();
}
void
@ -2069,31 +2036,23 @@ ArenaLists::backgroundFinalize(FreeOp *fop, ArenaHeader *listHead, bool onBackgr
AllocKind thingKind = listHead->getAllocKind();
Zone *zone = listHead->zone;
size_t thingsPerArena = Arena::thingsPerArena(Arena::thingSize(thingKind));
SortedArenaList finalizedSorted(thingsPerArena);
ArenaList finalized;
SliceBudget budget;
FinalizeArenas(fop, &listHead, finalizedSorted, thingKind, budget);
FinalizeArenas(fop, &listHead, finalized, thingKind, budget);
JS_ASSERT(!listHead);
// When arenas are queued for background finalization, all arenas are moved
// to arenaListsToSweep[], leaving the arenaLists[] empty. However, new
// arenas may be allocated before background finalization finishes; now that
// finalization is complete, we want to merge these lists back together.
// When arenas are queued for background finalization, all
// arenas are moved to arenaListsToSweep[], leaving the arenaLists[] empty.
// Then, if new arenas are allocated before background finalization
// finishes they are always added to the front of the list. Therefore,
// at this point, |al|'s cursor will always be at the end of its list.
ArenaLists *lists = &zone->allocator.arenas;
ArenaList *al = &lists->arenaLists[thingKind];
// Flatten |finalizedSorted| into a regular ArenaList.
ArenaList finalized = finalizedSorted.toArenaList();
// Store this for later, since merging may change the state of |finalized|.
bool allClear = finalized.isEmpty();
AutoLockGC lock(fop->runtime());
JS_ASSERT(lists->backgroundFinalizeState[thingKind] == BFS_RUN);
// Join |al| and |finalized| into a single list.
*al = finalized.insertListWithCursorAtEnd(*al);
al->appendToListWithCursorAtEnd(finalized);
/*
* We must set the state to BFS_JUST_FINISHED if we are running on the
@ -2104,7 +2063,7 @@ ArenaLists::backgroundFinalize(FreeOp *fop, ArenaHeader *listHead, bool onBackgr
* allocating new arenas from the chunks we can set the state to BFS_DONE if
* we have released all finalized arenas back to their chunks.
*/
if (onBackgroundThread && !allClear)
if (onBackgroundThread && !finalized.isEmpty())
lists->backgroundFinalizeState[thingKind] = BFS_JUST_FINISHED;
else
lists->backgroundFinalizeState[thingKind] = BFS_DONE;
@ -4363,17 +4322,13 @@ GCRuntime::beginSweepPhase(bool lastGC)
}
bool
ArenaLists::foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget,
SortedArenaList &sweepList)
ArenaLists::foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget)
{
if (!FinalizeArenas(fop, &arenaListsToSweep[thingKind], sweepList, thingKind, sliceBudget))
return false;
if (!arenaListsToSweep[thingKind])
return true;
// Join |arenaLists[thingKind]| and |sweepList| into a single list.
ArenaList finalized = sweepList.toArenaList();
arenaLists[thingKind] = finalized.insertListWithCursorAtEnd(arenaLists[thingKind]);
return true;
ArenaList &dest = arenaLists[thingKind];
return FinalizeArenas(fop, &arenaListsToSweep[thingKind], dest, thingKind, sliceBudget);
}
bool
@ -4405,17 +4360,9 @@ GCRuntime::sweepPhase(SliceBudget &sliceBudget)
while (sweepKindIndex < FinalizePhaseLength[finalizePhase]) {
AllocKind kind = FinalizePhases[finalizePhase][sweepKindIndex];
/* Set the number of things per arena for this AllocKind. */
size_t thingsPerArena = Arena::thingsPerArena(Arena::thingSize(kind));
incrementalSweepList.setThingsPerArena(thingsPerArena);
if (!zone->allocator.arenas.foregroundFinalize(&fop, kind, sliceBudget,
incrementalSweepList))
if (!zone->allocator.arenas.foregroundFinalize(&fop, kind, sliceBudget))
return false; /* Yield to the mutator. */
/* Reset the slots of the sweep list that we used. */
incrementalSweepList.reset(thingsPerArena);
++sweepKindIndex;
}
sweepKindIndex = 0;
@ -5788,8 +5735,8 @@ ArenaLists::adoptArenas(JSRuntime *rt, ArenaLists *fromArenaLists)
#endif
ArenaList *fromList = &fromArenaLists->arenaLists[thingKind];
ArenaList *toList = &arenaLists[thingKind];
fromList->check();
toList->check();
fromList->deepCheck();
toList->deepCheck();
ArenaHeader *next;
for (ArenaHeader *fromHeader = fromList->head(); fromHeader; fromHeader = next) {
// Copy fromHeader->next before releasing/reinserting.
@ -5805,7 +5752,7 @@ ArenaLists::adoptArenas(JSRuntime *rt, ArenaLists *fromArenaLists)
toList->insertAtCursor(fromHeader);
}
fromList->clear();
toList->check();
toList->deepCheck();
}
}

Просмотреть файл

@ -383,90 +383,6 @@ GetGCKindSlots(AllocKind thingKind, const Class *clasp)
// above locks is held.
class AutoMaybeStartBackgroundAllocation;
// A single segment of a SortedArenaList. Each segment has a head and a tail,
// which track the start and end of a segment for O(1) append and concatenation.
struct SortedArenaListSegment
{
ArenaHeader *head;
ArenaHeader **tailp;
void clear() {
head = nullptr;
tailp = &head;
}
bool isEmpty() const {
return tailp == &head;
}
// Appends |aheader| to this segment.
void append(ArenaHeader *aheader) {
JS_ASSERT(aheader);
JS_ASSERT_IF(head, head->getAllocKind() == aheader->getAllocKind());
*tailp = aheader;
tailp = &aheader->next;
}
// Points the tail of this segment at |aheader|, which may be null.
void linkTo(ArenaHeader *aheader) {
*tailp = aheader;
}
};
// A class that holds arenas in sorted order by appending arenas to specific
// segments. SortedArenaLists can be flattened to a regular ArenaList.
class SortedArenaList
{
public:
// The minimum size, in bytes, of a GC thing.
static const size_t MinThingSize = 16;
static_assert(ArenaSize <= 4096, "When increasing the Arena size, please consider how"\
" this will affect the size of a SortedArenaList.");
static_assert(MinThingSize >= 16, "When decreasing the minimum thing size, please consider"\
" how this will affect the size of a SortedArenaList.");
private:
// The maximum number of GC things that an arena can hold.
static const size_t MaxThingsPerArena = (ArenaSize - sizeof(ArenaHeader)) / MinThingSize;
size_t thingsPerArena_;
SortedArenaListSegment segments[MaxThingsPerArena + 1];
// Convenience functions to get the nth head and tail.
ArenaHeader *headAt(size_t n) { return segments[n].head; }
ArenaHeader **tailAt(size_t n) { return segments[n].tailp; }
public:
explicit SortedArenaList(size_t thingsPerArena = MaxThingsPerArena) {
reset(thingsPerArena);
}
void setThingsPerArena(size_t thingsPerArena) {
JS_ASSERT(thingsPerArena && thingsPerArena <= MaxThingsPerArena);
thingsPerArena_ = thingsPerArena;
}
// Resets the first |thingsPerArena| segments of this list for further use.
void reset(size_t thingsPerArena = MaxThingsPerArena) {
setThingsPerArena(thingsPerArena);
// Initialize the segments.
for (size_t i = 0; i <= thingsPerArena; ++i)
segments[i].clear();
}
// Inserts a header, which has room for |nfree| more things, in its segment.
void insertAt(ArenaHeader *aheader, size_t nfree) {
JS_ASSERT(nfree <= thingsPerArena_);
segments[nfree].append(aheader);
}
// Flattens the SortedArenaList into a regular ArenaList. Although we don't
// expect to do this more than once, note this operation is not destructive.
ArenaList toArenaList();
};
/*
* Arena lists have a head and a cursor. The cursor conceptually lies on arena
* boundaries, i.e. before the first arena, between two arenas, or after the
@ -509,33 +425,11 @@ class ArenaList {
ArenaHeader *head_;
ArenaHeader **cursorp_;
void copy(const ArenaList &other) {
other.check();
head_ = other.head_;
cursorp_ = other.isCursorAtHead() ? &head_ : other.cursorp_;
check();
}
public:
ArenaList() {
clear();
}
ArenaList(const ArenaList &other) {
copy(other);
}
ArenaList &operator=(const ArenaList &other) {
copy(other);
return *this;
}
ArenaList(const SortedArenaListSegment &segment) {
head_ = segment.head;
cursorp_ = segment.isEmpty() ? &head_ : segment.tailp;
check();
}
// This does checking just of |head_| and |cursorp_|.
void check() const {
#ifdef DEBUG
@ -548,6 +442,28 @@ class ArenaList {
#endif
}
// This does checking involving all the arenas in the list.
void deepCheck() const {
#ifdef DEBUG
check();
// All full arenas must precede all non-full arenas.
//
// XXX: this is currently commented out because it fails moderately
// often. I'm not sure if this is because (a) it's not true that all
// full arenas must precede all non-full arenas, or (b) we have some
// defective list-handling code.
//
// bool havePassedFullArenas = false;
// for (ArenaHeader *aheader = head_; aheader; aheader = aheader->next) {
// if (havePassedFullArenas) {
// JS_ASSERT(aheader->hasFreeThings());
// } else if (aheader->hasFreeThings()) {
// havePassedFullArenas = true;
// }
// }
#endif
}
void clear() {
head_ = nullptr;
cursorp_ = &head_;
@ -565,11 +481,6 @@ class ArenaList {
return head_;
}
bool isCursorAtHead() const {
check();
return cursorp_ == &head_;
}
bool isCursorAtEnd() const {
check();
return !*cursorp_;
@ -604,19 +515,33 @@ class ArenaList {
check();
}
// This inserts |other|, which must be full, at the cursor of |this|.
ArenaList &insertListWithCursorAtEnd(const ArenaList &other) {
// This inserts |a| at the start of the list, and doesn't change the
// cursor.
void insertAtStart(ArenaHeader *a) {
check();
other.check();
JS_ASSERT(other.isCursorAtEnd());
if (other.isCursorAtHead())
return *this;
// Insert the full arenas of |other| after those of |this|.
*other.cursorp_ = *cursorp_;
*cursorp_ = other.head_;
cursorp_ = other.cursorp_;
a->next = head_;
if (isEmpty())
cursorp_ = &a->next; // The cursor remains null.
head_ = a;
check();
return *this;
}
// Appends |list|. |this|'s cursor must be at the end.
void appendToListWithCursorAtEnd(ArenaList &other) {
JS_ASSERT(isCursorAtEnd());
deepCheck();
other.deepCheck();
if (!other.isEmpty()) {
// Because |this|'s cursor is at the end, |cursorp_| points to the
// list-ending null. So this assignment appends |other| to |this|.
*cursorp_ = other.head_;
// If |other|'s cursor isn't at the start of the list, then update
// |this|'s cursor accordingly.
if (other.cursorp_ != &other.head_)
cursorp_ = other.cursorp_;
}
deepCheck();
}
};
@ -875,8 +800,7 @@ class ArenaLists
void queueScriptsForSweep(FreeOp *fop);
void queueJitCodeForSweep(FreeOp *fop);
bool foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget,
SortedArenaList &sweepList);
bool foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget);
static void backgroundFinalize(FreeOp *fop, ArenaHeader *listHead, bool onBackgroundThread);
void wipeDuringParallelExecution(JSRuntime *rt);

Просмотреть файл

@ -431,8 +431,6 @@ public class BrowserContract {
public static final String BOOKMARK_ID = "bookmark_id";
public static final String HISTORY_ID = "history_id";
public static final String DISPLAY = "display";
public static final String TYPE = "type";
}

Просмотреть файл

@ -40,7 +40,6 @@ public class TopSitesCursorWrapper implements Cursor {
TopSites.TITLE,
TopSites.BOOKMARK_ID,
TopSites.HISTORY_ID,
TopSites.DISPLAY,
TopSites.TYPE
};

Просмотреть файл

@ -7,6 +7,7 @@
<style name="TabsList" parent="TabsListBase">
<item name="android:orientation">horizontal</item>
<item name="android:scrollbars">horizontal</item>
</style>
<style name="TabsItem">

Просмотреть файл

@ -7,6 +7,7 @@
<style name="TabsList" parent="TabsListBase">
<item name="android:orientation">vertical</item>
<item name="android:scrollbars">vertical</item>
</style>
<style name="Widget.BookmarkFolderView" parent="Widget.TwoLinePageRow.Title">

Просмотреть файл

@ -30,6 +30,7 @@
<style name="TabsList" parent="TabsListBase">
<item name="android:orientation">horizontal</item>
<item name="android:scrollbars">horizontal</item>
</style>
<style name="TabsItem">

Просмотреть файл

@ -122,81 +122,10 @@
</declare-styleable>
<declare-styleable name="TwoWayView">
<!-- Imported from View -->
<attr name="android:id"/>
<attr name="android:tag"/>
<attr name="android:scrollX"/>
<attr name="android:scrollY"/>
<attr name="android:background"/>
<attr name="android:padding"/>
<attr name="android:paddingLeft"/>
<attr name="android:paddingTop"/>
<attr name="android:paddingRight"/>
<attr name="android:paddingBottom"/>
<attr name="android:paddingStart"/>
<attr name="android:paddingEnd"/>
<attr name="android:focusable"/>
<attr name="android:focusableInTouchMode"/>
<attr name="android:visibility"/>
<attr name="android:fitsSystemWindows"/>
<attr name="android:scrollbars"/>
<attr name="android:scrollbarStyle"/>
<attr name="android:isScrollContainer"/>
<attr name="android:fadeScrollbars"/>
<attr name="android:scrollbarFadeDuration"/>
<attr name="android:scrollbarDefaultDelayBeforeFade"/>
<attr name="android:scrollbarSize"/>
<attr name="android:scrollbarThumbHorizontal"/>
<attr name="android:scrollbarThumbVertical"/>
<attr name="android:scrollbarTrackHorizontal"/>
<attr name="android:scrollbarTrackVertical"/>
<attr name="android:scrollbarAlwaysDrawHorizontalTrack"/>
<attr name="android:scrollbarAlwaysDrawVerticalTrack"/>
<attr name="android:fadingEdge"/>
<attr name="android:requiresFadingEdge"/>
<attr name="android:fadingEdgeLength"/>
<attr name="android:nextFocusLeft"/>
<attr name="android:nextFocusRight"/>
<attr name="android:nextFocusUp"/>
<attr name="android:nextFocusDown"/>
<attr name="android:nextFocusForward"/>
<attr name="android:clickable"/>
<attr name="android:longClickable"/>
<attr name="android:saveEnabled"/>
<attr name="android:filterTouchesWhenObscured"/>
<attr name="android:drawingCacheQuality"/>
<attr name="android:keepScreenOn"/>
<attr name="android:duplicateParentState"/>
<attr name="android:minHeight"/>
<attr name="android:minWidth"/>
<attr name="android:soundEffectsEnabled"/>
<attr name="android:hapticFeedbackEnabled"/>
<attr name="android:contentDescription"/>
<attr name="android:onClick"/>
<attr name="android:overScrollMode"/>
<attr name="android:alpha"/>
<attr name="android:translationX"/>
<attr name="android:translationY"/>
<attr name="android:transformPivotX"/>
<attr name="android:transformPivotY"/>
<attr name="android:rotation"/>
<attr name="android:rotationX"/>
<attr name="android:rotationY"/>
<attr name="android:scaleX"/>
<attr name="android:scaleY"/>
<attr name="android:verticalScrollbarPosition"/>
<attr name="android:layerType"/>
<attr name="android:layoutDirection"/>
<attr name="android:textDirection"/>
<attr name="android:textAlignment"/>
<!-- Imported from Android -->
<attr name="android:orientation"/>
<!-- Imported from AbsListView -->
<attr name="android:choiceMode"/>
<attr name="android:drawSelectorOnTop"/>
<attr name="android:listSelector"/>
<attr name="android:drawSelectorOnTop"/>
</declare-styleable>
<declare-styleable name="HomeListView">

Просмотреть файл

@ -435,6 +435,7 @@
<style name="TabsList" parent="TabsListBase">
<item name="android:orientation">vertical</item>
<item name="android:scrollbars">vertical</item>
</style>
<style name="TabsItem">

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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

Просмотреть файл

@ -222,25 +222,21 @@ public class TestTopSitesCursorWrapper extends BrowserTestCase {
if (rowType == TopSites.TYPE_BLANK) {
assertTrue(c.isNull(c.getColumnIndex(TopSites.URL)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.TITLE)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.DISPLAY)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.BOOKMARK_ID)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.HISTORY_ID)));
} else if (rowType == TopSites.TYPE_PINNED) {
assertFalse(c.isNull(c.getColumnIndex(TopSites.URL)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.TITLE)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.DISPLAY)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.BOOKMARK_ID)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.HISTORY_ID)));
} else if (rowType == TopSites.TYPE_TOP) {
assertFalse(c.isNull(c.getColumnIndex(TopSites.URL)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.TITLE)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.DISPLAY)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.BOOKMARK_ID)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.HISTORY_ID)));
} else if (rowType == TopSites.TYPE_SUGGESTED) {
assertFalse(c.isNull(c.getColumnIndex(TopSites.URL)));
assertFalse(c.isNull(c.getColumnIndex(TopSites.TITLE)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.DISPLAY)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.BOOKMARK_ID)));
assertTrue(c.isNull(c.getColumnIndex(TopSites.HISTORY_ID)));
} else {
@ -283,7 +279,7 @@ public class TestTopSitesCursorWrapper extends BrowserTestCase {
Integer[] pinnedPositions = new Integer[] { 0, 1, 4 };
TopSitesCursorWrapper c = createTopSitesCursorWrapper(2, pinnedPositions, 3);
assertEquals(7, c.getColumnCount());
assertEquals(6, c.getColumnCount());
String[] columnNames = c.getColumnNames();
assertEquals(columnNames.length, c.getColumnCount());

Просмотреть файл

@ -359,12 +359,52 @@ void AMPEG4ElementaryAssembler::submitAccessUnit() {
LOGV("Access unit complete (%d nal units)", mPackets.size());
for (List<sp<ABuffer> >::iterator it = mPackets.begin();
it != mPackets.end(); ++it) {
sp<ABuffer> accessUnit = new ABuffer((*it)->size());
sp<ABuffer> 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<sp<ABuffer> >::iterator it = mPackets.begin();
it != mPackets.end(); ++it) {
sp<ABuffer> accessUnit = new ABuffer((*it)->size());
sp<ABuffer> nal = *it;
memcpy(accessUnit->data(), nal->data(), nal->size());
CopyTimes(accessUnit, nal);
if (mAccessUnitDamaged) {
accessUnit->meta()->setInt32("damaged", true);
}
sp<AMessage> 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<sp<ABuffer> >::iterator it = mPackets.begin();
it != mPackets.end(); ++it) {
totalSize += (*it)->size();
}
sp<ABuffer> accessUnit = new ABuffer(totalSize);
size_t offset = 0;
for (List<sp<ABuffer> >::iterator it = mPackets.begin();
it != mPackets.end(); ++it) {
sp<ABuffer> nal = *it;
memcpy(accessUnit->data() + offset, nal->data(), nal->size());
offset += nal->size();
}
CopyTimes(accessUnit, *mPackets.begin());
if (mAccessUnitDamaged) {
accessUnit->meta()->setInt32("damaged", true);

Просмотреть файл

@ -16,6 +16,216 @@ 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");
/**
* Handles requestAutocomplete for a DOM Form element.
*/
function FormHandler(aForm, aWindow) {
this.form = aForm;
this.window = aWindow;
this.fieldDetails = [];
}
FormHandler.prototype = {
/**
* DOM Form element to which this object is attached.
*/
form: null,
/**
* nsIDOMWindow to which this object is attached.
*/
window: null,
/**
* Array of collected data about relevant form fields. Each item is an object
* storing the identifying details of the field and a reference to the
* originally associated element from the form.
*
* The "section", "addressType", "contactType", and "fieldName" values are
* used to identify the exact field when the serializable data is received
* from the requestAutocomplete user interface. There cannot be multiple
* fields which have the same exact combination of these values.
*
* A direct reference to the associated element cannot be sent to the user
* interface because processing may be done in the parent process.
*/
fieldDetails: null,
/**
* Handles requestAutocomplete and generates the DOM events when finished.
*/
handleRequestAutocomplete: Task.async(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 {
reason = yield this.promiseRequestAutocomplete();
} catch (ex) {
Cu.reportError(ex);
}
// The type of event depends on whether this is a success condition.
let event = (reason == "success")
? new this.window.Event("autocomplete", { bubbles: true })
: new this.window.AutocompleteErrorEvent("autocompleteerror",
{ bubbles: true,
reason: reason });
yield this.waitForTick();
this.form.dispatchEvent(event);
}),
/**
* Handles requestAutocomplete and returns the outcome when finished.
*
* @return {Promise}
* @resolves The "reason" value indicating the outcome of the
* requestAutocomplete operation, including "success" if the
* operation completed successfully.
*/
promiseRequestAutocomplete: Task.async(function* () {
let data = this.collectFormFields();
if (!data) {
return "disabled";
}
let ui = yield FormAutofill.integration.createRequestAutocompleteUI(data);
let result = yield ui.show();
if (result.canceled) {
return "cancel";
}
this.autofillFormFields(result);
return "success";
}),
/**
* Returns information from the form about fields that can be autofilled, and
* populates the fieldDetails array on this object accordingly.
*
* @returns Serializable data structure that can be sent to the user
* interface, or null if the operation failed because the constraints
* on the allowed fields were not honored.
*/
collectFormFields: function () {
let autofillData = {
sections: [],
};
for (let element of this.form.elements) {
// Query the interface and exclude elements that cannot be autocompleted.
if (!(element instanceof Ci.nsIDOMHTMLInputElement)) {
continue;
}
// Exclude elements to which no autocomplete field has been assigned.
let info = element.getAutocompleteInfo();
if (!info.fieldName || ["on", "off"].indexOf(info.fieldName) != -1) {
continue;
}
// Store the association between the field metadata and the element.
if (this.fieldDetails.some(f => f.section == info.section &&
f.addressType == info.addressType &&
f.contactType == info.contactType &&
f.fieldName == info.fieldName)) {
// A field with the same identifier already exists.
return null;
}
this.fieldDetails.push({
section: info.section,
addressType: info.addressType,
contactType: info.contactType,
fieldName: info.fieldName,
element: element,
});
// The first level is the custom section.
let section = autofillData.sections
.find(s => s.name == info.section);
if (!section) {
section = {
name: info.section,
addressSections: [],
};
autofillData.sections.push(section);
}
// The second level is the address section.
let addressSection = section.addressSections
.find(s => s.addressType == info.addressType);
if (!addressSection) {
addressSection = {
addressType: info.addressType,
fields: [],
};
section.addressSections.push(addressSection);
}
// The third level contains all the fields within the section.
let field = {
fieldName: info.fieldName,
contactType: info.contactType,
};
addressSection.fields.push(field);
}
return autofillData;
},
/**
* Processes form fields that can be autofilled, and populates them with the
* data provided by RequestAutocompleteUI.
*
* @param aAutofillResult
* Data returned by the user interface.
* {
* fields: [
* section: Value originally provided to the user interface.
* addressType: Value originally provided to the user interface.
* contactType: Value originally provided to the user interface.
* fieldName: Value originally provided to the user interface.
* value: String with which the field should be updated.
* ],
* }
*/
autofillFormFields: function (aAutofillResult) {
for (let field of aAutofillResult.fields) {
// Get the field details, if it was processed by the user interface.
let fieldDetail = this.fieldDetails
.find(f => f.section == field.section &&
f.addressType == field.addressType &&
f.contactType == field.contactType &&
f.fieldName == field.fieldName);
if (!fieldDetail) {
continue;
}
fieldDetail.element.value = field.value;
}
},
/**
* Waits for one tick of the event loop before resolving the returned promise.
*/
waitForTick: function () {
return new Promise(function (resolve) {
Services.tm.currentThread.dispatch(resolve, Ci.nsIThread.DISPATCH_NORMAL);
});
},
};
/**
* Implements a service used by DOM content to request Form Autofill, in
* particular when the requestAutocomplete method of Form objects is invoked.
*/
function FormAutofillContentService() {
}
@ -25,16 +235,8 @@ FormAutofillContentService.prototype = {
// nsIFormAutofillContentService
requestAutocomplete: function (aForm, aWindow) {
Services.console.logStringMessage("requestAutocomplete not implemented.");
// We will return "disabled" for now.
let event = new aWindow.AutocompleteErrorEvent("autocompleteerror",
{ bubbles: true,
reason: "disabled" });
// Ensure the event is always dispatched on the next tick.
Services.tm.currentThread.dispatch(() => aForm.dispatchEvent(event),
Ci.nsIThread.DISPATCH_NORMAL);
new FormHandler(aForm, aWindow).handleRequestAutocomplete()
.catch(Cu.reportError);
},
};

Просмотреть файл

@ -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");
@ -35,14 +37,26 @@ this.FormAutofillIntegration = {
/**
* Creates a new RequestAutocompleteUI object.
*
* @param aProperties
* Provides the initial properties for the newly created object.
* @param aAutofillData
* Provides the initial data required to display the user interface.
* {
* sections: [{
* name: User-specified section name, or empty string.
* addressSections: [{
* addressType: "shipping", "billing", or empty string.
* fields: [{
* fieldName: Type of information requested, like "email".
* contactType: For example "work", "home", or empty string.
* }],
* }],
* }],
* }
*
* @return {Promise}
* @resolves The newly created RequestAutocompleteUI object.
* @rejects JavaScript exception.
*/
createRequestAutocompleteUI: Task.async(function* (aProperties) {
return {};
createRequestAutocompleteUI: Task.async(function* (aAutofillData) {
return new RequestAutocompleteUI(aAutofillData);
}),
};

Просмотреть файл

@ -0,0 +1,58 @@
/* 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 (aAutofillData) {
this._autofillData = aAutofillData;
}
this.RequestAutocompleteUI.prototype = {
_autofillData: null,
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,
autofillData: this._autofillData,
};
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;
}),
};

Просмотреть файл

@ -0,0 +1,85 @@
/* 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,
autofillData: null,
onLoad: function () {
Task.spawn(function* () {
let args = window.arguments[0].wrappedJSObject;
this.resolveFn = args.resolveFn;
this.autofillData = args.autofillData;
window.sizeToContent();
Services.obs.notifyObservers(window,
"formautofill-window-initialized", "");
}.bind(this)).catch(Cu.reportError);
},
onAccept: function () {
// TODO: Replace with autofill storage module (bug 1018304).
const dummyDB = {
"": {
"name": "Mozzy La",
"street-address": "331 E Evelyn Ave",
"address-level2": "Mountain View",
"address-level1": "CA",
"country": "US",
"postal-code": "94041",
"email": "email@example.org",
}
};
let result = { fields: [] };
for (let section of this.autofillData.sections) {
for (let addressSection of section.addressSections) {
let addressType = addressSection.addressType;
if (!(addressType in dummyDB)) {
continue;
}
for (let field of addressSection.fields) {
let fieldName = field.fieldName;
if (!(fieldName in dummyDB[addressType])) {
continue;
}
result.fields.push({
section: section.name,
addressType: addressType,
contactType: field.contactType,
fieldName: field.fieldName,
value: dummyDB[addressType][fieldName],
});
}
}
}
window.close();
this.resolveFn(result);
},
onCancel: function () {
window.close();
this.resolveFn({ canceled: true });
},
};

Просмотреть файл

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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/. -->
<!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % requestAutocompleteDTD SYSTEM "chrome://formautofill/locale/requestAutocomplete.dtd">
%requestAutocompleteDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
%globalDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>requestAutocomplete demo window</title>
<link rel="stylesheet"
href="chrome://mozapps/skin/formautofill/requestAutocomplete.css" />
<script type="application/javascript;version=1.7"
src="chrome://formautofill/content/requestAutocomplete.js" />
</head>
<body dir="&locale.dir;" onload="RequestAutocompleteDialog.onLoad();">
<h1>requestAutocomplete</h1>
<p>This is a demo window.</p>
<input id="accept" type="button" value="(OK)"
onclick="RequestAutocompleteDialog.onAccept();" />
<input id="cancel" type="button" value="(Cancel)"
onclick="RequestAutocompleteDialog.onCancel();" />
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
# 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/.
toolkit.jar:
% content formautofill %content/formautofill/
content/formautofill/requestAutocomplete.js (content/requestAutocomplete.js)
content/formautofill/requestAutocomplete.xhtml (content/requestAutocomplete.xhtml)

Просмотреть файл

@ -29,6 +29,11 @@ EXTRA_COMPONENTS += [
]
EXTRA_JS_MODULES += [
'content/RequestAutocompleteUI.jsm',
'FormAutofill.jsm',
'FormAutofillIntegration.jsm',
]
JAR_MANIFESTS += [
'jar.mn',
]

Просмотреть файл

@ -4,3 +4,4 @@ support-files =
head.js
[browser_infrastructure.js]
[browser_ui_requestAutocomplete.js]

Просмотреть файл

@ -0,0 +1,48 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Tests the requestAutocomplete user interface.
*/
"use strict";
/**
* Open the requestAutocomplete UI and test that selecting a profile results in
* the correct data being sent back to the opener.
*/
add_task(function* test_select_profile() {
// Request an e-mail address.
let { uiWindow, promiseResult } = yield FormAutofillTest.showUI(
TestData.requestEmailOnly);
// Accept the dialog.
let acceptButton = uiWindow.document.getElementById("accept");
EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow);
let result = yield promiseResult;
Assert.equal(result.fields.length, 1);
Assert.equal(result.fields[0].section, "");
Assert.equal(result.fields[0].addressType, "");
Assert.equal(result.fields[0].contactType, "");
Assert.equal(result.fields[0].fieldName, "email");
Assert.equal(result.fields[0].value, "email@example.org");
});
/**
* Open the requestAutocomplete UI and cancel the dialog.
*/
add_task(function* test_cancel() {
// Request an e-mail address.
let { uiWindow, promiseResult } = yield FormAutofillTest.showUI(
TestData.requestEmailOnly);
// Cancel the dialog.
let acceptButton = uiWindow.document.getElementById("cancel");
EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow);
let result = yield promiseResult;
Assert.ok(result.canceled);
});
add_task(terminationTaskFn);

Просмотреть файл

@ -4,4 +4,4 @@ support-files =
head.js
[test_infrastructure.html]
[test_requestAutocomplete_disabled.html]
[test_requestAutocomplete_cancel.html]

Просмотреть файл

@ -9,20 +9,27 @@
<script type="application/javascript;version=1.7">
/*
* Tests the cases where the requestAutocomplete method returns "disabled".
* Tests the response sent when requestAutocomplete is canceled by the user.
*/
"use strict";
/**
* Tests the case where the feature is disabled globally.
* The requestAutocomplete UI will not be displayed during these tests.
*/
add_task(function* test_disabled_globally() {
add_task(function* test_initialize() {
FormAutofillTest.requestAutocompleteResponse = { canceled: true };
});
/**
* Tests the case where the feature is canceled.
*/
add_task(function* test_cancel() {
let promise = TestUtils.waitForEvent($("form"), "autocompleteerror");
$("form").requestAutocomplete();
let errorEvent = yield promise;
Assert.equal(errorEvent.reason, "disabled");
Assert.equal(errorEvent.reason, "cancel");
});
add_task(terminationTaskFn);

Просмотреть файл

@ -163,7 +163,67 @@ let TestUtils = {
return path;
}),
}
};
/* --- Local helpers --- */
let FormAutofillTest = {
/**
* Stores the response that the next call to the mock requestAutocomplete UI
* will return to the requester, or null to enable displaying the default UI.
*/
requestAutocompleteResponse: null,
/**
* Displays the requestAutocomplete user interface using the specified data.
*
* @param aFormAutofillData
* Serializable object containing the set of requested fields.
*
* @return {Promise}
* @resolves An object with the following properties:
* {
* uiWindow: Reference to the initialized window.
* promiseResult: Promise resolved by the UI when it closes.
* }
*/
showUI: Task.async(function* (aFormAutofillData) {
Output.print("Opening UI with data: " + JSON.stringify(aFormAutofillData));
// Wait for the initialization event before opening the window.
let promiseUIWindow =
TestUtils.waitForNotification("formautofill-window-initialized");
let ui = yield FormAutofill.integration.createRequestAutocompleteUI(
aFormAutofillData);
let promiseResult = ui.show();
// The window is the subject of the observer notification.
return {
uiWindow: (yield promiseUIWindow)[0],
promiseResult: promiseResult,
};
}),
};
let TestData = {
/**
* Autofill UI request for the e-mail field only.
*/
get requestEmailOnly() {
return {
sections: [{
name: "",
addressSections: [{
addressType: "",
fields: [{
fieldName: "email",
contactType: "",
}],
}],
}],
};
},
};
/* --- Initialization and termination functions common to all tests --- */
@ -173,4 +233,28 @@ add_task(function* test_common_initialize() {
add_termination_task(function* () {
Services.prefs.clearUserPref("dom.forms.requestAutocomplete");
});
// If required, we return a mock response instead of displaying the UI.
let mockIntegrationFn = base => ({
createRequestAutocompleteUI: Task.async(function* () {
// Call the base method to display the UI if override is not requested.
if (FormAutofillTest.requestAutocompleteResponse === null) {
return yield base.createRequestAutocompleteUI.apply(this, arguments);
}
// Return a mock RequestAutocompleteUI object.
return {
show: Task.async(function* () {
let response = FormAutofillTest.requestAutocompleteResponse;
Output.print("Mock UI response: " + JSON.stringify(response));
return response;
}),
};
}),
});
FormAutofill.registerIntegration(mockIntegrationFn);
add_termination_task(function* () {
FormAutofill.unregisterIntegration(mockIntegrationFn);
});
});

Просмотреть файл

@ -7,6 +7,13 @@
"use strict";
/**
* The requestAutocomplete UI will not be displayed during these tests.
*/
add_task(function* test_initialize() {
FormAutofillTest.requestAutocompleteResponse = { canceled: true };
});
/**
* Registers and unregisters an integration override function.
*/
@ -15,14 +22,16 @@ add_task(function* test_integration_override() {
let newIntegrationFn = base => ({
createRequestAutocompleteUI: Task.async(function* () {
yield base.createRequestAutocompleteUI.apply(this, arguments);
overrideCalled = true;
return yield base.createRequestAutocompleteUI.apply(this, arguments);
}),
});
FormAutofill.registerIntegration(newIntegrationFn);
try {
yield FormAutofill.integration.createRequestAutocompleteUI({});
let ui = yield FormAutofill.integration.createRequestAutocompleteUI({});
let result = yield ui.show();
Assert.ok(result.canceled);
} finally {
FormAutofill.unregisterIntegration(newIntegrationFn);
}
@ -41,15 +50,17 @@ add_task(function* test_integration_override_error() {
let newIntegrationFn = base => ({
createRequestAutocompleteUI: Task.async(function* () {
yield base.createRequestAutocompleteUI.apply(this, arguments);
overrideCalled = true;
return yield base.createRequestAutocompleteUI.apply(this, arguments);
}),
});
FormAutofill.registerIntegration(errorIntegrationFn);
FormAutofill.registerIntegration(newIntegrationFn);
try {
yield FormAutofill.integration.createRequestAutocompleteUI({});
let ui = yield FormAutofill.integration.createRequestAutocompleteUI({});
let result = yield ui.show();
Assert.ok(result.canceled);
} finally {
FormAutofill.unregisterIntegration(errorIntegrationFn);
FormAutofill.unregisterIntegration(newIntegrationFn);

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -0,0 +1,5 @@
<!-- 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/. -->
<!-- This file has no entities because the feature is still experimental. -->

Просмотреть файл

@ -121,6 +121,8 @@
% locale cookie @AB_CD@ %locale/@AB_CD@/cookie/
locale/@AB_CD@/cookie/cookieAcceptDialog.dtd (%chrome/cookie/cookieAcceptDialog.dtd)
locale/@AB_CD@/cookie/cookieAcceptDialog.properties (%chrome/cookie/cookieAcceptDialog.properties)
% locale formautofill @AB_CD@ %locale/@AB_CD@/formautofill/
locale/@AB_CD@/formautofill/requestAutocomplete.dtd (%chrome/formautofill/requestAutocomplete.dtd)
% locale passwordmgr @AB_CD@ %locale/@AB_CD@/passwordmgr/
locale/@AB_CD@/passwordmgr/passwordmgr.properties (%chrome/passwordmgr/passwordmgr.properties)
locale/@AB_CD@/passwordmgr/passwordManager.dtd (%chrome/passwordmgr/passwordManager.dtd)

Просмотреть файл

@ -25,6 +25,7 @@ toolbar {
menubar, toolbar[type="menubar"] {
-moz-appearance: menubar;
color: -moz-menubartext;
min-width: 1px;
min-height: 20px;
padding: 1px 0px;

Просмотреть файл

@ -57,6 +57,7 @@ toolkit.jar:
skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png)
skin/classic/mozapps/passwordmgr/key-16@2x.png (passwordmgr/key-16@2x.png)
skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png)
skin/classic/mozapps/formautofill/requestAutocomplete.css (../../shared/formautofill/requestAutocomplete.css)
skin/classic/mozapps/plugins/pluginProblem.css (../../shared/plugins/pluginProblem.css)
skin/classic/mozapps/aboutNetworking.css (../../shared/aboutNetworking.css)
skin/classic/mozapps/plugins/contentPluginActivate.png (../../shared/plugins/contentPluginActivate.png)

Просмотреть файл

@ -0,0 +1,11 @@
/* 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/. */
@import url(chrome://global/skin/inContentUI.css);
:root {
height: 100%;
width: 100%;
padding: 0;
}

Просмотреть файл

@ -61,6 +61,7 @@ toolkit.jar:
#ifdef MOZ_PLACES
skin/classic/mozapps/places/defaultFavicon.png (places/defaultFavicon.png)
#endif
skin/classic/mozapps/formautofill/requestAutocomplete.css (../../shared/formautofill/requestAutocomplete.css)
skin/classic/mozapps/plugins/pluginProblem.css (../../shared/plugins/pluginProblem.css)
skin/classic/mozapps/aboutNetworking.css (../../shared/aboutNetworking.css)
skin/classic/mozapps/plugins/contentPluginActivate.png (../../shared/plugins/contentPluginActivate.png)
@ -144,6 +145,7 @@ toolkit.jar:
#ifdef MOZ_PLACES
skin/classic/aero/mozapps/places/defaultFavicon.png (places/defaultFavicon.png)
#endif
skin/classic/aero/mozapps/formautofill/requestAutocomplete.css (../../shared/formautofill/requestAutocomplete.css)
skin/classic/aero/mozapps/plugins/pluginProblem.css (../../shared/plugins/pluginProblem.css)
skin/classic/aero/mozapps/aboutNetworking.css (../../shared/aboutNetworking.css)
skin/classic/aero/mozapps/plugins/contentPluginActivate.png (../../shared/plugins/contentPluginActivate.png)