Merge mozilla-central to mozilla-inbound

--HG--
extra : rebase_source : 113d8ba0ffd34716ddb08a607f07fb0131a5ec01
This commit is contained in:
Carsten "Tomcat" Book 2015-02-25 12:09:30 +01:00
Родитель 983df62b3a 476e8299a2
Коммит aa4293282a
83 изменённых файлов: 1196 добавлений и 1188 удалений

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -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="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -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="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "f6bfd854fe4746f21bc006eac145365e85f98808",
"git_revision": "cc235a867161e0000ea55a4f009b3be19021f066",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "e6b6631570eae8356747b4d4f0e8c1257da9a195",
"revision": "6b12bdb3c5f22c6ec98bd43cdcae2d0a6d6a0d1e",
"repo_path": "integration/gaia-central"
}

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f6bfd854fe4746f21bc006eac145365e85f98808"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="cc235a867161e0000ea55a4f009b3be19021f066"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -149,8 +149,8 @@
label="&options.disableJavaScript.label;"
tooltiptext="&options.disableJavaScript.tooltip;"/>
<hbox class="hidden-labels-box">
<checkbox label="&options.enableChrome.label4;"
tooltiptext="&options.enableChrome.tooltip2;"
<checkbox label="&options.enableChrome.label5;"
tooltiptext="&options.enableChrome.tooltip3;"
data-pref="devtools.chrome.enabled"/>
</hbox>
<hbox class="hidden-labels-box">

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

@ -72,8 +72,8 @@
<!-- LOCALIZATION NOTE (options.enableChrome.label4): This is the label for the
- checkbox that toggles chrome debugging, i.e. devtools.chrome.enabled
- boolean preference in about:config, in the options panel. -->
<!ENTITY options.enableChrome.label4 "Enable chrome and add-on debugging">
<!ENTITY options.enableChrome.tooltip2 "Turning this option on will allow you to use various developer tools in browser context and debug add-ons from the Add-ons Manager">
<!ENTITY options.enableChrome.label5 "Enable browser chrome and add-on debugging toolboxes">
<!ENTITY options.enableChrome.tooltip3 "Turning this option on will allow you to use various developer tools in browser context (via Tools > Web Developer > Browser Toolbox) and debug add-ons from the Add-ons Manager">
<!-- LOCALIZATION NOTE (options.enableRemote.label3): This is the label for the
- checkbox that toggles remote debugging, i.e. devtools.debugger.remote-enabled

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

@ -191,36 +191,3 @@ function newIncomingParcel(fakeParcelSize, response, request, data) {
return bytes;
}
/**
* Test whether specified function throws exception with expected
* result.
*
* @param func
* Function to be tested.
* @param message
* Message of expected exception. <code>null</code> for no throws.
* @param stack
* Optional stack object to be printed. <code>null</code> for
* Components#stack#caller.
*/
function do_check_throws(func, message, stack)
{
if (!stack)
stack = Components.stack.caller;
try {
func();
} catch (exc) {
if (exc.message === message) {
return;
}
do_throw("expecting exception '" + message
+ "', caught '" + exc.message + "'", stack);
}
if (message) {
do_throw("expecting exception '" + message + "', none thrown", stack);
}
}

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

@ -18,16 +18,16 @@ add_test(function test_change_call_barring_password() {
function do_test(facility, pin, newPin) {
buf.sendParcel = function fakeSendParcel () {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_CHANGE_BARRING_PASSWORD);
equal(this.readInt32(), REQUEST_CHANGE_BARRING_PASSWORD);
// Token : we don't care.
this.readInt32();
let parcel = this.readStringList();
do_check_eq(parcel.length, 3);
do_check_eq(parcel[0], facility);
do_check_eq(parcel[1], pin);
do_check_eq(parcel[2], newPin);
equal(parcel.length, 3);
equal(parcel[0], facility);
equal(parcel[1], pin);
equal(parcel[2], newPin);
};
let options = {facility: facility, pin: pin, newPin: newPin};
@ -43,9 +43,9 @@ add_test(function test_check_change_call_barring_password_result() {
let barringPasswordOptions;
let worker = newWorker({
postMessage: function(message) {
do_check_eq(barringPasswordOptions.pin, PIN);
do_check_eq(barringPasswordOptions.newPin, NEW_PIN);
do_check_eq(message.errorMsg, GECKO_ERROR_SUCCESS);
equal(barringPasswordOptions.pin, PIN);
equal(barringPasswordOptions.newPin, NEW_PIN);
equal(message.errorMsg, GECKO_ERROR_SUCCESS);
}
});

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

@ -50,10 +50,12 @@ function add_test_incoming_parcel(parcel, handler) {
add_test_incoming_parcel(null,
function test_normal_parcel_handling() {
let self = this;
do_check_throws(function normal_handler() {
try {
// reads exactly the same size, should not throw anything.
self.context.Buf.readInt32();
});
} catch (e) {
ok(false, "Got exception: " + e);
}
}
);
@ -61,10 +63,12 @@ add_test_incoming_parcel(null,
add_test_incoming_parcel(null,
function test_parcel_under_read() {
let self = this;
do_check_throws(function under_read_handler() {
try {
// reads less than parcel size, should not throw.
self.context.Buf.readUint16();
});
} catch (e) {
ok(false, "Got exception: " + e);
}
}
);
@ -78,7 +82,7 @@ add_test_incoming_parcel(null,
buf.readUint8();
}
do_check_throws(function over_read_handler() {
throws(function over_read_handler() {
// reads more than parcel size, should throw an error.
buf.readUint8();
},"Trying to read data beyond the parcel end!");
@ -133,14 +137,14 @@ add_test(function test_incoming_parcel_buffer_overwritten() {
let p1 = pA.subarray(0, pA.length - 1);
worker.onRILMessage(0, p1);
// The parcel should not have been processed.
do_check_eq(buf.readAvailable, 0);
equal(buf.readAvailable, 0);
// buf.currentParcelSize should have been set because incoming data has more
// than 4 octets.
do_check_eq(buf.currentParcelSize, pA_parcelSize);
equal(buf.currentParcelSize, pA_parcelSize);
// buf.readIncoming should contains remaining unconsumed octets count.
do_check_eq(buf.readIncoming, p1.length - buf.PARCEL_SIZE_SIZE);
equal(buf.readIncoming, p1.length - buf.PARCEL_SIZE_SIZE);
// buf.incomingWriteIndex should be ready to accept the last octet.
do_check_eq(buf.incomingWriteIndex, p1.length);
equal(buf.incomingWriteIndex, p1.length);
// Second, send the last octet of pA and whole pB. The Buf should now expand
// to cover both pA & pB.
@ -149,13 +153,13 @@ add_test(function test_incoming_parcel_buffer_overwritten() {
p2.set(pB, 1);
worker.onRILMessage(0, p2);
// The parcels should have been both consumed.
do_check_eq(buf.readAvailable, 0);
equal(buf.readAvailable, 0);
// No parcel data remains.
do_check_eq(buf.currentParcelSize, 0);
equal(buf.currentParcelSize, 0);
// No parcel data remains.
do_check_eq(buf.readIncoming, 0);
equal(buf.readIncoming, 0);
// The Buf should now expand to cover both pA & pB.
do_check_eq(buf.incomingWriteIndex, pA.length + pB.length);
equal(buf.incomingWriteIndex, pA.length + pB.length);
// end of incoming parcel's trip, let's do next test.
run_next_test();
@ -167,15 +171,15 @@ add_test_incoming_parcel(null,
let buf = this.context.Buf;
let u8array = buf.readUint8Array(1);
do_check_eq(u8array instanceof Uint8Array, true);
do_check_eq(u8array.length, 1);
do_check_eq(buf.readAvailable, 3);
equal(u8array instanceof Uint8Array, true);
equal(u8array.length, 1);
equal(buf.readAvailable, 3);
u8array = buf.readUint8Array(2);
do_check_eq(u8array.length, 2);
do_check_eq(buf.readAvailable, 1);
equal(u8array.length, 2);
equal(buf.readAvailable, 1);
do_check_throws(function over_read_handler() {
throws(function over_read_handler() {
// reads more than parcel size, should throw an error.
u8array = buf.readUint8Array(2);
}, "Trying to read data beyond the parcel end!");

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

@ -59,7 +59,7 @@ add_test(function test_display() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].display, "Test Info");
equal(records[0].display, "Test Info");
run_next_test();
});
@ -79,7 +79,7 @@ add_test(function test_extended_display() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].display, "Test Extended Info");
equal(records[0].display, "Test Extended Info");
run_next_test();
});
@ -102,8 +102,8 @@ add_test(function test_mixed() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].display, "Test Info 1");
do_check_eq(records[1].display, "Test Info 2");
equal(records[0].display, "Test Info 1");
equal(records[1].display, "Test Info 2");
run_next_test();
});
@ -126,8 +126,8 @@ add_test(function test_multiple() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].display, "Test Info 1");
do_check_eq(records[1].display, "Test Info 2");
equal(records[0].display, "Test Info 1");
equal(records[1].display, "Test Info 2");
run_next_test();
});
@ -147,9 +147,9 @@ add_test(function test_signal() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].signal.type, 0x00);
do_check_eq(records[0].signal.alertPitch, 0x01);
do_check_eq(records[0].signal.signal, 0x03);
equal(records[0].signal.type, 0x00);
equal(records[0].signal.alertPitch, 0x01);
equal(records[0].signal.signal, 0x03);
run_next_test();
});
@ -169,7 +169,7 @@ add_test(function test_signal_not_present() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records.length, 0);
equal(records.length, 0);
run_next_test();
});
@ -189,10 +189,10 @@ add_test(function test_line_control() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].lineControl.polarityIncluded, 1);
do_check_eq(records[0].lineControl.toggle, 0);
do_check_eq(records[0].lineControl.reverse, 1);
do_check_eq(records[0].lineControl.powerDenial, 255);
equal(records[0].lineControl.polarityIncluded, 1);
equal(records[0].lineControl.toggle, 0);
equal(records[0].lineControl.reverse, 1);
equal(records[0].lineControl.powerDenial, 255);
run_next_test();
});
@ -209,7 +209,7 @@ add_test(function test_clir() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].clirCause, 1);
equal(records[0].clirCause, 1);
run_next_test();
});
@ -227,8 +227,8 @@ add_test(function test_clir() {
let helper = context.CdmaPDUHelper;
let records = helper.decodeInformationRecord();
do_check_eq(records[0].audioControl.upLink, 1);
do_check_eq(records[0].audioControl.downLink, 255);
equal(records[0].audioControl.upLink, 1);
equal(records[0].audioControl.downLink, 255);
run_next_test();
});

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

@ -34,15 +34,15 @@ function hexStringToParcelByteArrayData(hexString) {
add_test(function test_ril_consts_cellbroadcast_misc() {
// Must be 16 for indexing.
do_check_eq(CB_DCS_LANG_GROUP_1.length, 16);
do_check_eq(CB_DCS_LANG_GROUP_2.length, 16);
equal(CB_DCS_LANG_GROUP_1.length, 16);
equal(CB_DCS_LANG_GROUP_2.length, 16);
// Array length must be even.
do_check_eq(CB_NON_MMI_SETTABLE_RANGES.length & 0x01, 0);
equal(CB_NON_MMI_SETTABLE_RANGES.length & 0x01, 0);
for (let i = 0; i < CB_NON_MMI_SETTABLE_RANGES.length;) {
let from = CB_NON_MMI_SETTABLE_RANGES[i++];
let to = CB_NON_MMI_SETTABLE_RANGES[i++];
do_check_eq(from < to, true);
equal(from < to, true);
}
run_next_test();
@ -67,11 +67,11 @@ add_test(function test_ril_worker_GsmPDUHelper_readCbDataCodingScheme() {
let msg = {};
context.GsmPDUHelper.readCbDataCodingScheme(msg);
do_check_eq(msg.dcs, dcs);
do_check_eq(msg.encoding, encoding);
do_check_eq(msg.language, language);
do_check_eq(msg.hasLanguageIndicator, hasLanguageIndicator);
do_check_eq(msg.messageClass, messageClass);
equal(msg.dcs, dcs);
equal(msg.encoding, encoding);
equal(msg.language, language);
equal(msg.hasLanguageIndicator, hasLanguageIndicator);
equal(msg.messageClass, messageClass);
}
function test_dcs_throws(dcs) {
@ -79,7 +79,7 @@ add_test(function test_ril_worker_GsmPDUHelper_readCbDataCodingScheme() {
return dcs;
};
do_check_throws(function() {
throws(function() {
context.GsmPDUHelper.readCbDataCodingScheme({});
}, "Unsupported CBS data coding scheme: " + dcs);
}
@ -189,15 +189,15 @@ add_test(function test_ril_worker_GsmPDUHelper_readGsmCbData() {
};
context.GsmPDUHelper.readGsmCbData(msg, options[3].length);
do_check_eq(msg.body, expected[0]);
do_check_eq(msg.data == null, expected[1] == null);
equal(msg.body, expected[0]);
equal(msg.data == null, expected[1] == null);
if (expected[1] != null) {
do_check_eq(msg.data.length, expected[1].length);
equal(msg.data.length, expected[1].length);
for (let i = 0; i < expected[1].length; i++) {
do_check_eq(msg.data[i], expected[1][i]);
equal(msg.data[i], expected[1][i]);
}
}
do_check_eq(msg.language, expected[2]);
equal(msg.language, expected[2]);
}
// We're testing Cell Broadcast message body with all zeros octet stream. As
@ -249,7 +249,7 @@ add_test(function test_ril_worker__checkCellBroadcastMMISettable() {
let ril = context.RIL;
function test(from, to, expected) {
do_check_eq(expected, ril._checkCellBroadcastMMISettable(from, to));
equal(expected, ril._checkCellBroadcastMMISettable(from, to));
}
test(-2, -1, false);
@ -301,7 +301,7 @@ add_test(function test_ril_worker__mergeCellBroadcastConfigs() {
function test(olist, from, to, expected) {
let result = ril._mergeCellBroadcastConfigs(olist, from, to);
do_check_eq(JSON.stringify(expected), JSON.stringify(result));
equal(JSON.stringify(expected), JSON.stringify(result));
}
test(null, 0, 1, [0, 1]);
@ -488,8 +488,8 @@ add_test(function test_GsmPDUHelper_readUmtsCbMessage_MultiParts() {
hexStringToParcelByteArrayData(pdu)));
let postedMessage = workerHelper.postedMessage;
do_check_eq("cellbroadcast-received", postedMessage.rilMessageType);
do_check_eq(postedMessage.fullBody.length,
equal("cellbroadcast-received", postedMessage.rilMessageType);
equal(postedMessage.fullBody.length,
aNumOfPages * CB_MAX_CONTENT_PER_PAGE_7BIT);
}
@ -534,11 +534,11 @@ add_test(function test_GsmPDUHelper_readUmtsCbMessage_Binary() {
hexStringToParcelByteArrayData(pdu)));
let postedMessage = workerHelper.postedMessage;
do_check_eq("cellbroadcast-received", postedMessage.rilMessageType);
do_check_eq(postedMessage.fullData.length,
equal("cellbroadcast-received", postedMessage.rilMessageType);
equal(postedMessage.fullData.length,
aNumOfPages * CB_UMTS_MESSAGE_PAGE_SIZE);
for (let i = 0; i < postedMessage.fullData.length; i++) {
do_check_eq(postedMessage.fullData[i], 255);
equal(postedMessage.fullData[i], 255);
}
}

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

@ -36,8 +36,8 @@ add_test(function test_ril_worker_cellbroadcast_activate() {
setup(isCdma);
context.RIL.setCellBroadcastDisabled({disabled: true});
// Makesure that request parcel is sent out.
do_check_neq(parcelTypes.indexOf(expectedRequest), -1);
do_check_eq(context.RIL.cellBroadcastDisabled, true);
notEqual(parcelTypes.indexOf(expectedRequest), -1);
equal(context.RIL.cellBroadcastDisabled, true);
}
test(false, REQUEST_GSM_SMS_BROADCAST_ACTIVATION);
@ -81,14 +81,14 @@ add_test(function test_ril_worker_cellbroadcast_config() {
found = true;
// Check parcel. Data start from 4th word (32bit)
do_check_eq(u32Parcel.slice(3).toString(), expected);
equal(u32Parcel.slice(3).toString(), expected);
};
context.RIL._isCdma = isCdma;
context.RIL.setSmsBroadcastConfig(configs);
// Makesure that request parcel is sent out.
do_check_true(found);
ok(found);
}
// (GSM) RIL writes the following data to outgoing parcel:
@ -121,7 +121,7 @@ add_test(function test_ril_worker_cellbroadcast_merge_config() {
context.RIL._isCdma = isCdma;
context.RIL.cellBroadcastConfigs = configs;
context.RIL._mergeAllCellBroadcastConfigs();
do_check_eq(context.RIL.mergedCellBroadcastConfig.toString(), expected);
equal(context.RIL.mergedCellBroadcastConfig.toString(), expected);
}
let configs = {
@ -155,8 +155,8 @@ add_test(function test_ril_worker_cellbroadcast_set_search_list() {
let options = { searchList: aSearchList };
context.RIL.setCellBroadcastSearchList(options);
// Enforce the MMI result to string for comparison.
do_check_eq("" + context.RIL.cellBroadcastConfigs.MMI, aExpected);
do_check_eq(options.success, true);
equal("" + context.RIL.cellBroadcastConfigs.MMI, aExpected);
equal(options.success, true);
}
let searchListStr = "1,2,3,4";

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

@ -23,7 +23,7 @@ function toaFromString(number) {
add_test(function test_toaFromString_empty() {
let retval = toaFromString("");
do_check_eq(retval, TOA_UNKNOWN);
equal(retval, TOA_UNKNOWN);
run_next_test();
});
@ -31,7 +31,7 @@ add_test(function test_toaFromString_empty() {
add_test(function test_toaFromString_undefined() {
let retval = toaFromString();
do_check_eq(retval, TOA_UNKNOWN);
equal(retval, TOA_UNKNOWN);
run_next_test();
});
@ -39,7 +39,7 @@ add_test(function test_toaFromString_undefined() {
add_test(function test_toaFromString_unknown() {
let retval = toaFromString("666222333");
do_check_eq(retval, TOA_UNKNOWN);
equal(retval, TOA_UNKNOWN);
run_next_test();
});
@ -47,7 +47,7 @@ add_test(function test_toaFromString_unknown() {
add_test(function test_toaFromString_international() {
let retval = toaFromString("+34666222333");
do_check_eq(retval, TOA_INTERNATIONAL);
equal(retval, TOA_INTERNATIONAL);
run_next_test();
});
@ -73,8 +73,8 @@ add_test(function test_setCallForward_unconditional() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -122,13 +122,13 @@ add_test(function test_queryCallForwardStatus_unconditional() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
do_check_true(Array.isArray(postedMessage.rules));
equal(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
ok(Array.isArray(postedMessage.rules));
do_print(postedMessage.rules.length);
do_check_eq(postedMessage.rules.length, 1);
do_check_true(postedMessage.rules[0].active);
do_check_eq(postedMessage.rules[0].reason, CALL_FORWARD_REASON_UNCONDITIONAL);
do_check_eq(postedMessage.rules[0].number, "+34666222333");
equal(postedMessage.rules.length, 1);
ok(postedMessage.rules[0].active);
equal(postedMessage.rules[0].reason, CALL_FORWARD_REASON_UNCONDITIONAL);
equal(postedMessage.rules[0].number, "+34666222333");
run_next_test();
});

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

@ -30,9 +30,9 @@ add_test(function test_queryCLIP_provisioned() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.provisioned, 1);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.provisioned, 1);
run_next_test();
});
@ -59,7 +59,7 @@ add_test(function test_getCLIP_error_generic_failure_invalid_length() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, "GenericFailure");
do_check_false(postedMessage.success);
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
run_next_test();
});

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

@ -34,8 +34,8 @@ add_test(function test_setCLIR_success() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
run_next_test();
});
@ -58,8 +58,8 @@ add_test(function test_setCLIR_generic_failure() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, "GenericFailure");
do_check_false(postedMessage.success);
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
run_next_test();
});
@ -90,10 +90,10 @@ add_test(function test_getCLIR_n0_m1() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.n, 0);
do_check_eq(postedMessage.m, 1);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.n, 0);
equal(postedMessage.m, 1);
run_next_test();
});
@ -123,7 +123,7 @@ add_test(function test_getCLIR_error_generic_failure_invalid_length() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, "GenericFailure");
do_check_false(postedMessage.success);
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
run_next_test();
});

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

@ -24,8 +24,8 @@ add_test(function test_setCallWaiting_success() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
run_next_test();
});
@ -47,8 +47,8 @@ add_test(function test_setCallWaiting_generic_failure() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, "GenericFailure");
do_check_false(postedMessage.success);
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
run_next_test();
});
@ -77,10 +77,10 @@ add_test(function test_queryCallWaiting_success_enabled_true() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.length, 1);
do_check_true(postedMessage.enabled);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.length, 1);
ok(postedMessage.enabled);
run_next_test();
});
@ -108,9 +108,9 @@ add_test(function test_queryCallWaiting_success_enabled_false() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.length, 1);
do_check_false(postedMessage.enabled);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.length, 1);
ok(!postedMessage.enabled);
run_next_test();
});

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

@ -17,17 +17,17 @@ const TIMEOUT_VALUE = 300000; // 5 mins.
function setTimeout(callback, timeoutMs) {
timeoutCallback = callback;
timeoutDelayMs = timeoutMs;
do_check_eq(timeoutMs, TIMEOUT_VALUE);
equal(timeoutMs, TIMEOUT_VALUE);
return TIMER_ID;
}
function clearTimeout(timeoutId) {
do_check_eq(timeoutId, TIMER_ID);
equal(timeoutId, TIMER_ID);
timeoutCallback = null;
}
function fireTimeout() {
do_check_neq(timeoutCallback, null);
notEqual(timeoutCallback, null);
if (timeoutCallback) {
timeoutCallback();
timeoutCallback = null;
@ -45,15 +45,15 @@ add_test(function test_enter_emergencyCbMode() {
let postedMessage = workerHelper.postedMessage;
// Should store the mode.
do_check_eq(context.RIL._isInEmergencyCbMode, true);
equal(context.RIL._isInEmergencyCbMode, true);
// Should notify change.
do_check_eq(postedMessage.rilMessageType, "emergencyCbModeChange");
do_check_eq(postedMessage.active, true);
do_check_eq(postedMessage.timeoutMs, TIMEOUT_VALUE);
equal(postedMessage.rilMessageType, "emergencyCbModeChange");
equal(postedMessage.active, true);
equal(postedMessage.timeoutMs, TIMEOUT_VALUE);
// Should start timer.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
equal(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
}
run_next_test();
@ -69,14 +69,14 @@ add_test(function test_exit_emergencyCbMode() {
let postedMessage = workerHelper.postedMessage;
// Should store the mode.
do_check_eq(context.RIL._isInEmergencyCbMode, false);
equal(context.RIL._isInEmergencyCbMode, false);
// Should notify change.
do_check_eq(postedMessage.rilMessageType, "emergencyCbModeChange");
do_check_eq(postedMessage.active, false);
equal(postedMessage.rilMessageType, "emergencyCbModeChange");
equal(postedMessage.active, false);
// Should clear timer.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);
equal(context.RIL._exitEmergencyCbModeTimeoutID, null);
run_next_test();
});
@ -87,8 +87,8 @@ add_test(function test_request_exit_emergencyCbMode_when_timeout() {
let context = worker.ContextPool._contexts[0];
context.RIL[UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE]();
do_check_eq(context.RIL._isInEmergencyCbMode, true);
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
equal(context.RIL._isInEmergencyCbMode, true);
equal(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
let parcelTypes = [];
context.Buf.newParcel = function(type, options) {
@ -99,10 +99,10 @@ add_test(function test_request_exit_emergencyCbMode_when_timeout() {
fireTimeout();
// Should clear timeout event.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);
equal(context.RIL._exitEmergencyCbModeTimeoutID, null);
// Check indeed sent out REQUEST_EXIT_EMERGENCY_CALLBACK_MODE.
do_check_neq(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
notEqual(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
run_next_test();
});
@ -113,8 +113,8 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() {
let context = worker.ContextPool._contexts[0];
context.RIL[UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE]();
do_check_eq(context.RIL._isInEmergencyCbMode, true);
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
equal(context.RIL._isInEmergencyCbMode, true);
equal(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
let parcelTypes = [];
context.Buf.newParcel = function(type, options) {
@ -127,10 +127,10 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() {
isDialEmergency: false});
// Should clear timeout event.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);
equal(context.RIL._exitEmergencyCbModeTimeoutID, null);
// Check indeed sent out REQUEST_EXIT_EMERGENCY_CALLBACK_MODE.
do_check_neq(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
notEqual(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
run_next_test();
});
@ -141,8 +141,8 @@ add_test(function test_request_exit_emergencyCbMode_explicitly() {
let context = worker.ContextPool._contexts[0];
context.RIL[UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE]();
do_check_eq(context.RIL._isInEmergencyCbMode, true);
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
equal(context.RIL._isInEmergencyCbMode, true);
equal(context.RIL._exitEmergencyCbModeTimeoutID, TIMER_ID);
let parcelTypes = [];
context.Buf.newParcel = function(type, options) {
@ -157,13 +157,13 @@ add_test(function test_request_exit_emergencyCbMode_explicitly() {
let postedMessage = workerHelper.postedMessage;
// Should clear timeout event.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);
equal(context.RIL._exitEmergencyCbModeTimeoutID, null);
// Check indeed sent out REQUEST_EXIT_EMERGENCY_CALLBACK_MODE.
do_check_neq(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
notEqual(parcelTypes.indexOf(REQUEST_EXIT_EMERGENCY_CALLBACK_MODE), -1);
// Send back the response.
do_check_eq(postedMessage.rilMessageType, "exitEmergencyCbMode");
equal(postedMessage.rilMessageType, "exitEmergencyCbMode");
run_next_test();
});

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

@ -35,13 +35,13 @@ add_test(function test_fcp_template_for_transparent_structure() {
let berTlv = berHelper.decode(tag_test.length);
let iter = Iterator(berTlv.value);
let tlv = berHelper.searchForNextTag(BER_FCP_FILE_DESCRIPTOR_TAG, iter);
do_check_eq(tlv.value.fileStructure, UICC_EF_STRUCTURE[EF_STRUCTURE_TRANSPARENT]);
equal(tlv.value.fileStructure, UICC_EF_STRUCTURE[EF_STRUCTURE_TRANSPARENT]);
tlv = berHelper.searchForNextTag(BER_FCP_FILE_IDENTIFIER_TAG, iter);
do_check_eq(tlv.value.fileId, 0x2FE2);
equal(tlv.value.fileId, 0x2FE2);
tlv = berHelper.searchForNextTag(BER_FCP_FILE_SIZE_DATA_TAG, iter);
do_check_eq(tlv.value.fileSizeData, 0x0A);
equal(tlv.value.fileSizeData, 0x0A);
run_next_test();
});
@ -73,15 +73,15 @@ add_test(function test_fcp_template_for_linear_fixed_structure() {
let berTlv = berHelper.decode(tag_test.length);
let iter = Iterator(berTlv.value);
let tlv = berHelper.searchForNextTag(BER_FCP_FILE_DESCRIPTOR_TAG, iter);
do_check_eq(tlv.value.fileStructure, UICC_EF_STRUCTURE[EF_STRUCTURE_LINEAR_FIXED]);
do_check_eq(tlv.value.recordLength, 0x1A);
do_check_eq(tlv.value.numOfRecords, 0x01);
equal(tlv.value.fileStructure, UICC_EF_STRUCTURE[EF_STRUCTURE_LINEAR_FIXED]);
equal(tlv.value.recordLength, 0x1A);
equal(tlv.value.numOfRecords, 0x01);
tlv = berHelper.searchForNextTag(BER_FCP_FILE_IDENTIFIER_TAG, iter);
do_check_eq(tlv.value.fileId, 0x6F40);
equal(tlv.value.fileId, 0x6F40);
tlv = berHelper.searchForNextTag(BER_FCP_FILE_SIZE_DATA_TAG, iter);
do_check_eq(tlv.value.fileSizeData, 0x1A);
equal(tlv.value.fileSizeData, 0x1A);
run_next_test();
});

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

@ -25,19 +25,19 @@ add_test(function test_icc_get_card_lock_enabled() {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_QUERY_FACILITY_LOCK)
equal(this.readInt32(), REQUEST_QUERY_FACILITY_LOCK)
// Token : we don't care.
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, ril.v5Legacy ? 3 : 4);
do_check_eq(parcel[0], GECKO_CARDLOCK_TO_FACILITY[aLock]);
do_check_eq(parcel[1], "");
do_check_eq(parcel[2], serviceClass.toString());
equal(parcel.length, ril.v5Legacy ? 3 : 4);
equal(parcel[0], GECKO_CARDLOCK_TO_FACILITY[aLock]);
equal(parcel[1], "");
equal(parcel[2], serviceClass.toString());
if (!ril.v5Legacy) {
do_check_eq(parcel[3], ril.aid);
equal(parcel[3], ril.aid);
}
};
@ -64,16 +64,16 @@ add_test(function test_path_id_for_spid_and_spn() {
// Test SIM
RIL.appType = CARD_APPTYPE_SIM;
do_check_eq(ICCFileHelper.getEFPath(ICC_EF_SPDI),
equal(ICCFileHelper.getEFPath(ICC_EF_SPDI),
EF_PATH_MF_SIM + EF_PATH_DF_GSM);
do_check_eq(ICCFileHelper.getEFPath(ICC_EF_SPN),
equal(ICCFileHelper.getEFPath(ICC_EF_SPN),
EF_PATH_MF_SIM + EF_PATH_DF_GSM);
// Test USIM
RIL.appType = CARD_APPTYPE_USIM;
do_check_eq(ICCFileHelper.getEFPath(ICC_EF_SPDI),
equal(ICCFileHelper.getEFPath(ICC_EF_SPDI),
EF_PATH_MF_SIM + EF_PATH_ADF_USIM);
do_check_eq(ICCFileHelper.getEFPath(ICC_EF_SPDI),
equal(ICCFileHelper.getEFPath(ICC_EF_SPDI),
EF_PATH_MF_SIM + EF_PATH_ADF_USIM);
run_next_test();
});
@ -96,20 +96,20 @@ add_test(function test_icc_set_card_lock_enabled() {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SET_FACILITY_LOCK);
equal(this.readInt32(), REQUEST_SET_FACILITY_LOCK);
// Token : we don't care
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, ril.v5Legacy ? 4 : 5);
do_check_eq(parcel[0], GECKO_CARDLOCK_TO_FACILITY[aLock]);
do_check_eq(parcel[1], aEnabled ? "1" : "0");
do_check_eq(parcel[2], aPassword);
do_check_eq(parcel[3], serviceClass.toString());
equal(parcel.length, ril.v5Legacy ? 4 : 5);
equal(parcel[0], GECKO_CARDLOCK_TO_FACILITY[aLock]);
equal(parcel[1], aEnabled ? "1" : "0");
equal(parcel[2], aPassword);
equal(parcel[3], serviceClass.toString());
if (!ril.v5Legacy) {
do_check_eq(parcel[4], ril.aid);
equal(parcel[4], ril.aid);
}
};
@ -144,18 +144,18 @@ add_test(function test_icc_change_card_lock_password() {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
equal(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
// Token : we don't care
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, ril.v5Legacy ? 2 : 3);
do_check_eq(parcel[0], aPassword);
do_check_eq(parcel[1], aNewPassword);
equal(parcel.length, ril.v5Legacy ? 2 : 3);
equal(parcel[0], aPassword);
equal(parcel[1], aNewPassword);
if (!ril.v5Legacy) {
do_check_eq(parcel[2], ril.aid);
equal(parcel[2], ril.aid);
}
};
@ -189,17 +189,17 @@ add_test(function test_icc_unlock_card_lock_pin() {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
equal(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
// Token : we don't care
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, ril.v5Legacy ? 1 : 2);
do_check_eq(parcel[0], aPassword);
equal(parcel.length, ril.v5Legacy ? 1 : 2);
equal(parcel[0], aPassword);
if (!ril.v5Legacy) {
do_check_eq(parcel[1], ril.aid);
equal(parcel[1], ril.aid);
}
};
@ -233,18 +233,18 @@ add_test(function test_icc_unlock_card_lock_puk() {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
equal(this.readInt32(), GECKO_CARDLOCK_TO_REQUEST[aLock]);
// Token : we don't care
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, ril.v5Legacy ? 2 : 3);
do_check_eq(parcel[0], aPassword);
do_check_eq(parcel[1], aNewPin);
equal(parcel.length, ril.v5Legacy ? 2 : 3);
equal(parcel[0], aPassword);
equal(parcel[1], aNewPin);
if (!ril.v5Legacy) {
do_check_eq(parcel[2], ril.aid);
equal(parcel[2], ril.aid);
}
};
@ -273,15 +273,15 @@ add_test(function test_icc_unlock_card_lock_depersonalization() {
function do_test(aPassword) {
buf.sendParcel = function fakeSendParcel() {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE);
equal(this.readInt32(), REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE);
// Token : we don't care
this.readInt32();
// Data
let parcel = this.readStringList();
do_check_eq(parcel.length, 1);
do_check_eq(parcel[0], aPassword);
equal(parcel.length, 1);
equal(parcel[0], aPassword);
};
ril.iccUnlockCardLock({

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

@ -28,7 +28,7 @@ add_test(function test_personalization_state() {
ril._isCdma = isCdma;
ril._processICCStatus(iccStatus);
do_check_eq(ril.cardState, geckoCardState);
equal(ril.cardState, geckoCardState);
}
// Test GSM personalization state.
@ -117,7 +117,7 @@ add_test(function test_card_app_state() {
};
ril._processICCStatus(iccStatus);
do_check_eq(ril.cardState, geckoCardState);
equal(ril.cardState, geckoCardState);
}
testCardAppState(CARD_APPSTATE_ILLEGAL,
@ -159,7 +159,7 @@ add_test(function test_icc_permanent_blocked() {
};
ril._processICCStatus(iccStatus);
do_check_eq(ril.cardState, Ci.nsIIccProvider.CARD_STATE_PERMANENT_BLOCKED);
equal(ril.cardState, Ci.nsIIccProvider.CARD_STATE_PERMANENT_BLOCKED);
}
testPermanentBlocked(1,
@ -202,9 +202,9 @@ add_test(function test_icc_without_app_index() {
ril._processICCStatus(iccStatus);
// Should read icc id event if the app index is -1.
do_check_eq(ril.iccInfo.iccid, ICCID);
equal(ril.iccInfo.iccid, ICCID);
// cardState is "unknown" if the app index is -1.
do_check_eq(ril.cardState, GECKO_CARDSTATE_UNKNOWN);
equal(ril.cardState, GECKO_CARDSTATE_UNKNOWN);
run_next_test();
});

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

@ -21,13 +21,13 @@ add_test(function test_write_timestamp() {
helper.writeTimestamp(dateInput);
dateOutput.setTime(helper.readTimestamp());
do_check_eq(dateInput.getFullYear(), dateOutput.getFullYear());
do_check_eq(dateInput.getMonth(), dateOutput.getMonth());
do_check_eq(dateInput.getDate(), dateOutput.getDate());
do_check_eq(dateInput.getHours(), dateOutput.getHours());
do_check_eq(dateInput.getMinutes(), dateOutput.getMinutes());
do_check_eq(dateInput.getSeconds(), dateOutput.getSeconds());
do_check_eq(dateInput.getTimezoneOffset(), dateOutput.getTimezoneOffset());
equal(dateInput.getFullYear(), dateOutput.getFullYear());
equal(dateInput.getMonth(), dateOutput.getMonth());
equal(dateInput.getDate(), dateOutput.getDate());
equal(dateInput.getHours(), dateOutput.getHours());
equal(dateInput.getMinutes(), dateOutput.getMinutes());
equal(dateInput.getSeconds(), dateOutput.getSeconds());
equal(dateInput.getTimezoneOffset(), dateOutput.getTimezoneOffset());
// 2034-01-23 12:34:56 -0800 GMT
let time = Date.UTC(2034, 1, 23, 12, 34, 56);
@ -36,13 +36,13 @@ add_test(function test_write_timestamp() {
helper.writeTimestamp(dateInput);
dateOutput.setTime(helper.readTimestamp());
do_check_eq(dateInput.getFullYear(), dateOutput.getFullYear());
do_check_eq(dateInput.getMonth(), dateOutput.getMonth());
do_check_eq(dateInput.getDate(), dateOutput.getDate());
do_check_eq(dateInput.getHours(), dateOutput.getHours());
do_check_eq(dateInput.getMinutes(), dateOutput.getMinutes());
do_check_eq(dateInput.getSeconds(), dateOutput.getSeconds());
do_check_eq(dateInput.getTimezoneOffset(), dateOutput.getTimezoneOffset());
equal(dateInput.getFullYear(), dateOutput.getFullYear());
equal(dateInput.getMonth(), dateOutput.getMonth());
equal(dateInput.getDate(), dateOutput.getDate());
equal(dateInput.getHours(), dateOutput.getHours());
equal(dateInput.getMinutes(), dateOutput.getMinutes());
equal(dateInput.getSeconds(), dateOutput.getSeconds());
equal(dateInput.getTimezoneOffset(), dateOutput.getTimezoneOffset());
run_next_test();
});
@ -58,22 +58,22 @@ add_test(function test_octect_BCD() {
// 23
let number = 23;
let octet = helper.BCDToOctet(number);
do_check_eq(helper.octetToBCD(octet), number);
equal(helper.octetToBCD(octet), number);
// 56
number = 56;
octet = helper.BCDToOctet(number);
do_check_eq(helper.octetToBCD(octet), number);
equal(helper.octetToBCD(octet), number);
// 0x23
octet = 0x23;
number = helper.octetToBCD(octet);
do_check_eq(helper.BCDToOctet(number), octet);
equal(helper.BCDToOctet(number), octet);
// 0x56
octet = 0x56;
number = helper.octetToBCD(octet);
do_check_eq(helper.BCDToOctet(number), octet);
equal(helper.BCDToOctet(number), octet);
run_next_test();
});

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

@ -17,7 +17,7 @@ add_test(function test_error_message_read_icc_contact () {
function do_test(options, expectedErrorMsg) {
ril.sendChromeMessage = function(message) {
do_check_eq(message.errorMsg, expectedErrorMsg);
equal(message.errorMsg, expectedErrorMsg);
}
ril.readICCContacts(options);
}
@ -51,7 +51,7 @@ add_test(function test_error_message_update_icc_contact() {
function do_test(options, expectedErrorMsg) {
ril.sendChromeMessage = function(message) {
do_check_eq(message.errorMsg, expectedErrorMsg);
equal(message.errorMsg, expectedErrorMsg);
}
ril.updateICCContact(options);
}
@ -371,7 +371,7 @@ add_test(function test_read_icc_contacts() {
let onerror = function onerror(errorMsg) {
do_print("readICCContacts failed: " + errorMsg);
do_check_true(false);
ok(false);
};
contactHelper.readICCContacts(aTestData.simType, aTestData.contactType, onsuccess, onerror);
@ -438,49 +438,49 @@ add_test(function test_update_icc_contact() {
recordHelper.updateADNLike = function(fileId, contact, pin2, onsuccess, onerror) {
if (aContactType === GECKO_CARDCONTACT_TYPE_FDN) {
do_check_eq(fileId, ICC_EF_FDN);
equal(fileId, ICC_EF_FDN);
} else if (aContactType === GECKO_CARDCONTACT_TYPE_ADN) {
do_check_eq(fileId, ICC_EF_ADN);
equal(fileId, ICC_EF_ADN);
}
do_check_eq(pin2, aPin2);
do_check_eq(contact.alphaId, aContact.alphaId);
do_check_eq(contact.number, aContact.number);
equal(pin2, aPin2);
equal(contact.alphaId, aContact.alphaId);
equal(contact.number, aContact.number);
onsuccess();
};
recordHelper.readIAP = function(fileId, recordNumber, onsuccess, onerror) {
do_check_eq(fileId, IAP_FILE_ID);
do_check_eq(recordNumber, ADN_RECORD_ID);
equal(fileId, IAP_FILE_ID);
equal(recordNumber, ADN_RECORD_ID);
onsuccess((aHaveIapIndex) ? [EMAIL_RECORD_ID, ANR0_RECORD_ID]
: [0xff, 0xff]);
};
recordHelper.updateIAP = function(fileId, recordNumber, iap, onsuccess, onerror) {
do_check_eq(fileId, IAP_FILE_ID);
do_check_eq(recordNumber, ADN_RECORD_ID);
equal(fileId, IAP_FILE_ID);
equal(recordNumber, ADN_RECORD_ID);
onsuccess();
};
recordHelper.updateEmail = function(pbr, recordNumber, email, adnRecordId, onsuccess, onerror) {
do_check_eq(pbr.email.fileId, EMAIL_FILE_ID);
equal(pbr.email.fileId, EMAIL_FILE_ID);
if (pbr.email.fileType === ICC_USIM_TYPE1_TAG) {
do_check_eq(recordNumber, ADN_RECORD_ID);
equal(recordNumber, ADN_RECORD_ID);
} else if (pbr.email.fileType === ICC_USIM_TYPE2_TAG) {
do_check_eq(recordNumber, EMAIL_RECORD_ID);
equal(recordNumber, EMAIL_RECORD_ID);
}
do_check_eq(email, aContact.email);
equal(email, aContact.email);
onsuccess();
};
recordHelper.updateANR = function(pbr, recordNumber, number, adnRecordId, onsuccess, onerror) {
do_check_eq(pbr.anr0.fileId, ANR0_FILE_ID);
equal(pbr.anr0.fileId, ANR0_FILE_ID);
if (pbr.anr0.fileType === ICC_USIM_TYPE1_TAG) {
do_check_eq(recordNumber, ADN_RECORD_ID);
equal(recordNumber, ADN_RECORD_ID);
} else if (pbr.anr0.fileType === ICC_USIM_TYPE2_TAG) {
do_check_eq(recordNumber, ANR0_RECORD_ID);
equal(recordNumber, ANR0_RECORD_ID);
}
if (Array.isArray(aContact.anr)) {
do_check_eq(number, aContact.anr[0]);
equal(number, aContact.anr[0]);
}
onsuccess();
};
@ -506,7 +506,7 @@ add_test(function test_update_icc_contact() {
};
contactHelper.updateICCContact(aSimType, aContactType, aContact, aPin2, onsuccess, onerror);
do_check_true(isSuccess);
ok(isSuccess);
}
let contacts = [
@ -619,12 +619,12 @@ add_test(function test_update_icc_contact_with_remove_type1_attr() {
};
recordHelper.updateEmail = function(pbr, recordNumber, email, adnRecordId, onsuccess, onerror) {
do_check_true(email == null);
ok(email == null);
onsuccess();
};
recordHelper.updateANR = function(pbr, recordNumber, number, adnRecordId, onsuccess, onerror) {
do_check_true(number == null);
ok(number == null);
onsuccess();
};
@ -651,12 +651,12 @@ add_test(function test_update_icc_contact_with_remove_type1_attr() {
};
let successCb = function() {
do_check_true(true);
ok(true);
};
let errorCb = function(errorMsg) {
do_print(errorMsg);
do_check_true(false);
ok(false);
};
contactHelper.updateICCContact(CARD_APPTYPE_USIM,
@ -693,13 +693,13 @@ add_test(function test_find_free_icc_contact_sim() {
};
let successCb = function(pbrIndex, recordId) {
do_check_eq(pbrIndex, PBR_INDEX);
equal(pbrIndex, PBR_INDEX);
records[recordId] = {};
};
let errorCb = function(errorMsg) {
do_print(errorMsg);
do_check_true(false);
ok(false);
};
for (let i = 0; i < MAX_RECORDS; i++) {
@ -708,15 +708,15 @@ add_test(function test_find_free_icc_contact_sim() {
successCb, errorCb);
}
// The 1st element, records[0], is null.
do_check_eq(records.length - 1, MAX_RECORDS);
equal(records.length - 1, MAX_RECORDS);
// Now the EF is full, so finding a free one should result failure.
successCb = function(pbrIndex, recordId) {
do_check_true(false);
ok(false);
};
errorCb = function(errorMsg) {
do_check_true(errorMsg === "No free record found.");
ok(errorMsg === "No free record found.");
};
contactHelper.findFreeICCContact(CARD_APPTYPE_SIM, GECKO_CARDCONTACT_TYPE_ADN,
successCb, errorCb);
@ -756,12 +756,12 @@ add_test(function test_find_free_icc_contact_usim() {
};
let successCb = function(pbrIndex, recordId) {
do_check_eq(pbrIndex, 0);
equal(pbrIndex, 0);
pbrs[pbrIndex].adn.records[recordId] = {};
};
let errorCb = function(errorMsg) {
do_check_true(false);
ok(false);
};
contactHelper.findFreeICCContact(CARD_APPTYPE_USIM,
@ -771,8 +771,8 @@ add_test(function test_find_free_icc_contact_usim() {
// Now the EF_ADN in the 1st phonebook set is full, so the next free contact
// will come from the 2nd phonebook set.
successCb = function(pbrIndex, recordId) {
do_check_eq(pbrIndex, 1);
do_check_eq(recordId, 1);
equal(pbrIndex, 1);
equal(recordId, 1);
}
contactHelper.findFreeICCContact(CARD_APPTYPE_USIM,
GECKO_CARDCONTACT_TYPE_ADN,

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

@ -18,12 +18,12 @@ add_test(function test_load_linear_fixed_ef() {
io.getResponse = function fakeGetResponse(options) {
// When recordSize is provided, loadLinearFixedEF should call iccIO directly.
do_check_true(false);
ok(false);
run_next_test();
};
ril.iccIO = function fakeIccIO(options) {
do_check_true(true);
ok(true);
run_next_test();
};
@ -40,13 +40,13 @@ add_test(function test_load_linear_fixed_ef() {
let io = context.ICCIOHelper;
io.getResponse = function fakeGetResponse(options) {
do_check_true(true);
ok(true);
run_next_test();
};
ril.iccIO = function fakeIccIO(options) {
// When recordSize is not provided, loadLinearFixedEF should call getResponse.
do_check_true(false);
ok(false);
run_next_test();
};
@ -65,7 +65,7 @@ add_test(function test_process_icc_io_error() {
let called = false;
function errorCb(errorMsg) {
called = true;
do_check_eq(errorMsg, expectedErrorMsg);
equal(errorMsg, expectedErrorMsg);
}
// Write sw1 and sw2 to buffer.
@ -78,7 +78,7 @@ add_test(function test_process_icc_io_error() {
onerror: errorCb});
// onerror callback should be triggered.
do_check_true(called);
ok(called);
}
let TEST_DATA = [
@ -126,7 +126,7 @@ add_test(function test_icc_io_get_response_for_transparent_structure() {
structure: EF_STRUCTURE_TRANSPARENT};
iccioHelper.processICCIOGetResponse(options);
do_check_eq(options.fileSize, 0x0A);
equal(options.fileSize, 0x0A);
}
run_next_test();
@ -164,9 +164,9 @@ add_test(function test_icc_io_get_response_for_linear_fixed_structure() {
structure: EF_STRUCTURE_LINEAR_FIXED};
iccioHelper.processICCIOGetResponse(options);
do_check_eq(options.fileSize, 0x1A);
do_check_eq(options.recordSize, 0x1A);
do_check_eq(options.totalRecords, 0x01);
equal(options.fileSize, 0x1A);
equal(options.recordSize, 0x1A);
equal(options.totalRecords, 0x01);
}
run_next_test();

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

@ -24,7 +24,7 @@ add_test(function test_read_icc_ucs2_string() {
for (let i = 0; i < ffLen; i++) {
helper.writeHexOctet(0xff);
}
do_check_eq(iccHelper.readICCUCS2String(0x80, (2 * text.length) + ffLen), text);
equal(iccHelper.readICCUCS2String(0x80, (2 * text.length) + ffLen), text);
// 0x81
let array = [0x08, 0xd2, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0xca,
@ -33,7 +33,7 @@ add_test(function test_read_icc_ucs2_string() {
for (let i = 0; i < len; i++) {
helper.writeHexOctet(array[i]);
}
do_check_eq(iccHelper.readICCUCS2String(0x81, len), "Mozilla\u694a");
equal(iccHelper.readICCUCS2String(0x81, len), "Mozilla\u694a");
// 0x82
let array2 = [0x08, 0x69, 0x00, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61,
@ -42,7 +42,7 @@ add_test(function test_read_icc_ucs2_string() {
for (let i = 0; i < len2; i++) {
helper.writeHexOctet(array2[i]);
}
do_check_eq(iccHelper.readICCUCS2String(0x82, len2), "Mozilla\u694a");
equal(iccHelper.readICCUCS2String(0x82, len2), "Mozilla\u694a");
run_next_test();
});
@ -66,7 +66,7 @@ add_test(function test_read_dialling_number() {
};
for (let i = 0; i < str.length; i++) {
do_check_eq(str.substring(0, i - 1), // -1 for the TON
equal(str.substring(0, i - 1), // -1 for the TON
iccHelper.readDiallingNumber(i));
}
@ -104,10 +104,10 @@ add_test(function test_read_8bit_unpacked_to_string() {
helper.writeHexOctet(0xff);
}
do_check_eq(iccHelper.read8BitUnpackedToString(PDU_NL_EXTENDED_ESCAPE),
equal(iccHelper.read8BitUnpackedToString(PDU_NL_EXTENDED_ESCAPE),
langTable.substring(0, PDU_NL_EXTENDED_ESCAPE));
do_check_eq(iccHelper.read8BitUnpackedToString(2), " ");
do_check_eq(iccHelper.read8BitUnpackedToString(langTable.length -
equal(iccHelper.read8BitUnpackedToString(2), " ");
equal(iccHelper.read8BitUnpackedToString(langTable.length -
PDU_NL_EXTENDED_ESCAPE - 1 + ffLen),
langTable.substring(PDU_NL_EXTENDED_ESCAPE + 1));
@ -118,19 +118,19 @@ add_test(function test_read_8bit_unpacked_to_string() {
}
// Read string before RESERVED_CONTROL.
do_check_eq(iccHelper.read8BitUnpackedToString(PDU_NL_RESERVED_CONTROL * 2),
equal(iccHelper.read8BitUnpackedToString(PDU_NL_RESERVED_CONTROL * 2),
langShiftTable.substring(0, PDU_NL_RESERVED_CONTROL));
// ESCAPE + RESERVED_CONTROL will become ' '.
do_check_eq(iccHelper.read8BitUnpackedToString(2), " ");
equal(iccHelper.read8BitUnpackedToString(2), " ");
// Read string between RESERVED_CONTROL and EXTENDED_ESCAPE.
do_check_eq(iccHelper.read8BitUnpackedToString(
equal(iccHelper.read8BitUnpackedToString(
(PDU_NL_EXTENDED_ESCAPE - PDU_NL_RESERVED_CONTROL - 1) * 2),
langShiftTable.substring(PDU_NL_RESERVED_CONTROL + 1,
PDU_NL_EXTENDED_ESCAPE));
// ESCAPE + ESCAPE will become ' '.
do_check_eq(iccHelper.read8BitUnpackedToString(2), " ");
equal(iccHelper.read8BitUnpackedToString(2), " ");
// Read remaining string.
do_check_eq(iccHelper.read8BitUnpackedToString(
equal(iccHelper.read8BitUnpackedToString(
(langShiftTable.length - PDU_NL_EXTENDED_ESCAPE - 1) * 2),
langShiftTable.substring(PDU_NL_EXTENDED_ESCAPE + 1));
@ -157,18 +157,18 @@ add_test(function test_write_string_to_8bit_unpacked() {
iccHelper.writeStringTo8BitUnpacked(langTable.length + ffLen, langTable);
for (let i = 0; i < langTable.length; i++) {
do_check_eq(helper.readHexOctet(), i);
equal(helper.readHexOctet(), i);
}
for (let i = 0; i < ffLen; i++) {
do_check_eq(helper.readHexOctet(), 0xff);
equal(helper.readHexOctet(), 0xff);
}
// Test 2, write GSM extended alphabets.
str = "\u000c\u20ac";
iccHelper.writeStringTo8BitUnpacked(4, str);
do_check_eq(iccHelper.read8BitUnpackedToString(4), str);
equal(iccHelper.read8BitUnpackedToString(4), str);
// Test 3, write GSM and GSM extended alphabets.
// \u000c, \u20ac are from gsm extended alphabets.
@ -181,7 +181,7 @@ add_test(function test_write_string_to_8bit_unpacked() {
// "Totally 7 octets are to be written."
iccHelper.writeStringTo8BitUnpacked(7, str);
do_check_eq(iccHelper.read8BitUnpackedToString(7), str);
equal(iccHelper.read8BitUnpackedToString(7), str);
run_next_test();
});
@ -202,26 +202,26 @@ add_test(function test_write_string_to_8bit_unpacked_with_max_octets_written() {
iccHelper.writeStringTo8BitUnpacked(3, langTable.substring(0, 4));
helper.writeHexOctet(0xff); // dummy octet.
for (let i = 0; i < 3; i++) {
do_check_eq(helper.readHexOctet(), i);
equal(helper.readHexOctet(), i);
}
do_check_false(helper.readHexOctet() == 4);
ok(helper.readHexOctet() != 4);
// \u000c is GSM extended alphabet, 2 octets.
// \u00a3 is GSM alphabet, 1 octet.
let str = "\u000c\u00a3";
iccHelper.writeStringTo8BitUnpacked(3, str);
do_check_eq(iccHelper.read8BitUnpackedToString(3), str);
equal(iccHelper.read8BitUnpackedToString(3), str);
str = "\u00a3\u000c";
iccHelper.writeStringTo8BitUnpacked(3, str);
do_check_eq(iccHelper.read8BitUnpackedToString(3), str);
equal(iccHelper.read8BitUnpackedToString(3), str);
// 2 GSM extended alphabets cost 4 octets, but maximum is 3, so only the 1st
// alphabet can be written.
str = "\u000c\u000c";
iccHelper.writeStringTo8BitUnpacked(3, str);
helper.writeHexOctet(0xff); // dummy octet.
do_check_eq(iccHelper.read8BitUnpackedToString(4), str.substring(0, 1));
equal(iccHelper.read8BitUnpackedToString(4), str.substring(0, 1));
run_next_test();
});
@ -244,28 +244,28 @@ add_test(function test_read_alpha_identifier() {
for (let i = 0; i < ffLen; i++) {
helper.writeHexOctet(0xff);
}
do_check_eq(iccHelper.readAlphaIdentifier(1 + (2 * text.length) + ffLen), text);
equal(iccHelper.readAlphaIdentifier(1 + (2 * text.length) + ffLen), text);
// UCS2: 0x81
let array = [0x81, 0x08, 0xd2, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0xca, 0xff, 0xff];
for (let i = 0; i < array.length; i++) {
helper.writeHexOctet(array[i]);
}
do_check_eq(iccHelper.readAlphaIdentifier(array.length), "Mozilla\u694a");
equal(iccHelper.readAlphaIdentifier(array.length), "Mozilla\u694a");
// UCS2: 0x82
let array2 = [0x82, 0x08, 0x69, 0x00, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0xca, 0xff, 0xff];
for (let i = 0; i < array2.length; i++) {
helper.writeHexOctet(array2[i]);
}
do_check_eq(iccHelper.readAlphaIdentifier(array2.length), "Mozilla\u694a");
equal(iccHelper.readAlphaIdentifier(array2.length), "Mozilla\u694a");
// GSM 8 Bit Unpacked
const langTable = PDU_NL_LOCKING_SHIFT_TABLES[PDU_NL_IDENTIFIER_DEFAULT];
for (let i = 0; i < PDU_NL_EXTENDED_ESCAPE; i++) {
helper.writeHexOctet(i);
}
do_check_eq(iccHelper.readAlphaIdentifier(PDU_NL_EXTENDED_ESCAPE),
equal(iccHelper.readAlphaIdentifier(PDU_NL_EXTENDED_ESCAPE),
langTable.substring(0, PDU_NL_EXTENDED_ESCAPE));
run_next_test();
@ -284,36 +284,36 @@ add_test(function test_write_alpha_identifier() {
// Removal
iccHelper.writeAlphaIdentifier(10, null);
do_check_eq(iccHelper.readAlphaIdentifier(10), "");
equal(iccHelper.readAlphaIdentifier(10), "");
// GSM 8 bit
let str = "Mozilla";
iccHelper.writeAlphaIdentifier(str.length + ffLen, str);
do_check_eq(iccHelper.readAlphaIdentifier(str.length + ffLen), str);
equal(iccHelper.readAlphaIdentifier(str.length + ffLen), str);
// UCS2
str = "Mozilla\u694a";
iccHelper.writeAlphaIdentifier(str.length * 2 + ffLen, str);
// * 2 for each character will be encoded to UCS2 alphabets.
do_check_eq(iccHelper.readAlphaIdentifier(str.length * 2 + ffLen), str);
equal(iccHelper.readAlphaIdentifier(str.length * 2 + ffLen), str);
// Test with maximum octets written.
// 1 coding scheme (0x80) and 1 UCS2 character, total 3 octets.
str = "\u694a";
iccHelper.writeAlphaIdentifier(3, str);
do_check_eq(iccHelper.readAlphaIdentifier(3), str);
equal(iccHelper.readAlphaIdentifier(3), str);
// 1 coding scheme (0x80) and 2 UCS2 characters, total 5 octets.
// numOctets is limited to 4, so only 1 UCS2 character can be written.
str = "\u694a\u694a";
iccHelper.writeAlphaIdentifier(4, str);
helper.writeHexOctet(0xff); // dummy octet.
do_check_eq(iccHelper.readAlphaIdentifier(5), str.substring(0, 1));
equal(iccHelper.readAlphaIdentifier(5), str.substring(0, 1));
// Write 0 octet.
iccHelper.writeAlphaIdentifier(0, "1");
helper.writeHexOctet(0xff); // dummy octet.
do_check_eq(iccHelper.readAlphaIdentifier(1), "");
equal(iccHelper.readAlphaIdentifier(1), "");
run_next_test();
});
@ -346,10 +346,10 @@ add_test(function test_read_alpha_id_dialling_number() {
let contactR = iccHelper.readAlphaIdDiallingNumber(recordSize);
if (contact.alphaId == "" && contact.number == "") {
do_check_eq(contactR, null);
equal(contactR, null);
} else {
do_check_eq(contactR.alphaId, contact.alphaId);
do_check_eq(contactR.number, contact.number);
equal(contactR.alphaId, contact.alphaId);
equal(contactR.number, contact.number);
}
}
@ -377,8 +377,8 @@ add_test(function test_write_alpha_id_dialling_number() {
contactW.number);
let contactR = helper.readAlphaIdDiallingNumber(recordSize);
do_check_eq(contactW.alphaId, contactR.alphaId);
do_check_eq(contactW.number, contactR.number);
equal(contactW.alphaId, contactR.alphaId);
equal(contactW.number, contactR.number);
// Write a contact with alphaId encoded in UCS2 and number has '+'.
let contactUCS2 = {
@ -388,13 +388,13 @@ add_test(function test_write_alpha_id_dialling_number() {
helper.writeAlphaIdDiallingNumber(recordSize, contactUCS2.alphaId,
contactUCS2.number);
contactR = helper.readAlphaIdDiallingNumber(recordSize);
do_check_eq(contactUCS2.alphaId, contactR.alphaId);
do_check_eq(contactUCS2.number, contactR.number);
equal(contactUCS2.alphaId, contactR.alphaId);
equal(contactUCS2.number, contactR.number);
// Write a null contact (Removal).
helper.writeAlphaIdDiallingNumber(recordSize);
contactR = helper.readAlphaIdDiallingNumber(recordSize);
do_check_eq(contactR, null);
equal(contactR, null);
// Write a longer alphaId/dialling number
// Dialling Number : Maximum 20 digits(10 octets).
@ -408,16 +408,16 @@ add_test(function test_write_alpha_id_dialling_number() {
helper.writeAlphaIdDiallingNumber(recordSize, longContact.alphaId,
longContact.number);
contactR = helper.readAlphaIdDiallingNumber(recordSize);
do_check_eq(contactR.alphaId, "AAAAAAAAABBBBBBBBB");
do_check_eq(contactR.number, "12345678901234567890");
equal(contactR.alphaId, "AAAAAAAAABBBBBBBBB");
equal(contactR.number, "12345678901234567890");
// Add '+' to number and test again.
longContact.number = "+123456789012345678901234567890";
helper.writeAlphaIdDiallingNumber(recordSize, longContact.alphaId,
longContact.number);
contactR = helper.readAlphaIdDiallingNumber(recordSize);
do_check_eq(contactR.alphaId, "AAAAAAAAABBBBBBBBB");
do_check_eq(contactR.number, "+12345678901234567890");
equal(contactR.alphaId, "AAAAAAAAABBBBBBBBB");
equal(contactR.number, "+12345678901234567890");
run_next_test();
});
@ -434,18 +434,18 @@ add_test(function test_write_dialling_number() {
let number = "+123456";
let len = 4;
helper.writeDiallingNumber(number);
do_check_eq(helper.readDiallingNumber(len), number);
equal(helper.readDiallingNumber(len), number);
// without +
number = "987654";
len = 4;
helper.writeDiallingNumber(number);
do_check_eq(helper.readDiallingNumber(len), number);
equal(helper.readDiallingNumber(len), number);
number = "9876543";
len = 5;
helper.writeDiallingNumber(number);
do_check_eq(helper.readDiallingNumber(len), number);
equal(helper.readDiallingNumber(len), number);
run_next_test();
});
@ -513,9 +513,9 @@ add_test(function test_write_number_with_length() {
expectedNumber = expectedNumber || number;
iccHelper.writeNumberWithLength(number);
let numLen = helper.readHexOctet();
do_check_eq(expectedNumber, iccHelper.readDiallingNumber(numLen));
equal(expectedNumber, iccHelper.readDiallingNumber(numLen));
for (let i = 0; i < (ADN_MAX_BCD_NUMBER_BYTES - numLen); i++) {
do_check_eq(0xff, helper.readHexOctet());
equal(0xff, helper.readHexOctet());
}
}
@ -539,7 +539,7 @@ add_test(function test_write_number_with_length() {
// null
iccHelper.writeNumberWithLength(null);
for (let i = 0; i < (ADN_MAX_BCD_NUMBER_BYTES + 1); i++) {
do_check_eq(0xff, helper.readHexOctet());
equal(0xff, helper.readHexOctet());
}
run_next_test();

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

@ -52,13 +52,13 @@ add_test(function test_read_pbr() {
};
let successCb = function successCb(pbrs) {
do_check_eq(pbrs[0].adn.fileId, 0x4f3a);
do_check_eq(pbrs.length, 1);
equal(pbrs[0].adn.fileId, 0x4f3a);
equal(pbrs.length, 1);
};
let errorCb = function errorCb(errorMsg) {
do_print("Reading EF_PBR failed, msg = " + errorMsg);
do_check_true(false);
ok(false);
};
record.readPBR(successCb, errorCb);
@ -69,7 +69,7 @@ add_test(function test_read_pbr() {
ifLoadEF = true;
}
record.readPBR(successCb, errorCb);
do_check_false(ifLoadEF);
ok(!ifLoadEF);
run_next_test();
});
@ -117,13 +117,13 @@ add_test(function test_read_email() {
// fileId and recordNumber are dummy arguments.
record.readEmail(fileId, type, recordNumber, function(email) {
do_check_eq(email, expectedResult);
equal(email, expectedResult);
});
};
doTestReadEmail(ICC_USIM_TYPE1_TAG, "email@mozilla.com$#");
doTestReadEmail(ICC_USIM_TYPE2_TAG, "email@mozilla.com");
do_check_eq(record._emailRecordSize, recordSize);
equal(record._emailRecordSize, recordSize);
run_next_test();
});
@ -164,29 +164,29 @@ add_test(function test_update_email() {
count++;
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SIM_IO);
equal(this.readInt32(), REQUEST_SIM_IO);
// Token : we don't care
this.readInt32();
// command.
do_check_eq(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
equal(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
// fileId.
do_check_eq(this.readInt32(), fileId);
equal(this.readInt32(), fileId);
// pathId.
do_check_eq(this.readString(),
equal(this.readString(),
EF_PATH_MF_SIM + EF_PATH_DF_TELECOM + EF_PATH_DF_PHONEBOOK);
// p1.
do_check_eq(this.readInt32(), recordNumber);
equal(this.readInt32(), recordNumber);
// p2.
do_check_eq(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
equal(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
// p3.
do_check_eq(this.readInt32(), recordSize);
equal(this.readInt32(), recordSize);
// data.
let strLen = this.readInt32();
@ -195,14 +195,14 @@ add_test(function test_update_email() {
email = iccHelper.read8BitUnpackedToString(recordSize);
} else {
email = iccHelper.read8BitUnpackedToString(recordSize - 2);
do_check_eq(pduHelper.readHexOctet(), pbr.adn.sfi);
do_check_eq(pduHelper.readHexOctet(), expectedAdnRecordId);
equal(pduHelper.readHexOctet(), pbr.adn.sfi);
equal(pduHelper.readHexOctet(), expectedAdnRecordId);
}
this.readStringDelimiter(strLen);
do_check_eq(email, expectedEmail);
equal(email, expectedEmail);
// pin2.
do_check_eq(this.readString(), null);
equal(this.readString(), null);
if (!ril.v5Legacy) {
// AID. Ignore because it's from modem.
@ -262,12 +262,12 @@ add_test(function test_read_anr() {
// fileId and recordNumber are dummy arguments.
record.readANR(fileId, fileType, recordNumber, function(anr) {
do_check_eq(anr, expectedResult);
equal(anr, expectedResult);
});
};
doTestReadAnr(ICC_USIM_TYPE1_TAG, "0123456");
do_check_eq(record._anrRecordSize, recordSize);
equal(record._anrRecordSize, recordSize);
run_next_test();
});
@ -308,47 +308,47 @@ add_test(function test_update_anr() {
count++;
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SIM_IO);
equal(this.readInt32(), REQUEST_SIM_IO);
// Token : we don't care
this.readInt32();
// command.
do_check_eq(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
equal(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
// fileId.
do_check_eq(this.readInt32(), fileId);
equal(this.readInt32(), fileId);
// pathId.
do_check_eq(this.readString(),
equal(this.readString(),
EF_PATH_MF_SIM + EF_PATH_DF_TELECOM + EF_PATH_DF_PHONEBOOK);
// p1.
do_check_eq(this.readInt32(), recordNumber);
equal(this.readInt32(), recordNumber);
// p2.
do_check_eq(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
equal(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
// p3.
do_check_eq(this.readInt32(), recordSize);
equal(this.readInt32(), recordSize);
// data.
let strLen = this.readInt32();
// EF_AAS, ignore.
pduHelper.readHexOctet();
do_check_eq(iccHelper.readNumberWithLength(), expectedANR);
equal(iccHelper.readNumberWithLength(), expectedANR);
// EF_CCP, ignore.
pduHelper.readHexOctet();
// EF_EXT1, ignore.
pduHelper.readHexOctet();
if (pbr.anr0.fileType === ICC_USIM_TYPE2_TAG) {
do_check_eq(pduHelper.readHexOctet(), pbr.adn.sfi);
do_check_eq(pduHelper.readHexOctet(), expectedAdnRecordId);
equal(pduHelper.readHexOctet(), pbr.adn.sfi);
equal(pduHelper.readHexOctet(), expectedAdnRecordId);
}
this.readStringDelimiter(strLen);
// pin2.
do_check_eq(this.readString(), null);
equal(this.readString(), null);
if (!ril.v5Legacy) {
// AID. Ignore because it's from modem.
@ -406,14 +406,14 @@ add_test(function test_read_iap() {
let successCb = function successCb(iap) {
for (let i = 0; i < iap.length; i++) {
do_check_eq(expectedIAP[i], iap[i]);
equal(expectedIAP[i], iap[i]);
}
run_next_test();
}.bind(this);
let errorCb = function errorCb(errorMsg) {
do_print(errorMsg);
do_check_true(false);
ok(false);
run_next_test();
}.bind(this);
@ -453,39 +453,39 @@ add_test(function test_update_iap() {
function do_test(expectedIAP) {
buf.sendParcel = function() {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SIM_IO);
equal(this.readInt32(), REQUEST_SIM_IO);
// Token : we don't care
this.readInt32();
// command.
do_check_eq(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
equal(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
// fileId.
do_check_eq(this.readInt32(), fileId);
equal(this.readInt32(), fileId);
// pathId.
do_check_eq(this.readString(),
equal(this.readString(),
EF_PATH_MF_SIM + EF_PATH_DF_TELECOM + EF_PATH_DF_PHONEBOOK);
// p1.
do_check_eq(this.readInt32(), recordNumber);
equal(this.readInt32(), recordNumber);
// p2.
do_check_eq(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
equal(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
// p3.
do_check_eq(this.readInt32(), recordSize);
equal(this.readInt32(), recordSize);
// data.
let strLen = this.readInt32();
for (let i = 0; i < recordSize; i++) {
do_check_eq(expectedIAP[i], pduHelper.readHexOctet());
equal(expectedIAP[i], pduHelper.readHexOctet());
}
this.readStringDelimiter(strLen);
// pin2.
do_check_eq(this.readString(), null);
equal(this.readString(), null);
if (!ril.v5Legacy) {
// AID. Ignore because it's from modem.
@ -528,39 +528,39 @@ add_test(function test_update_adn_like() {
buf.sendParcel = function() {
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SIM_IO);
equal(this.readInt32(), REQUEST_SIM_IO);
// Token : we don't care
this.readInt32();
// command.
do_check_eq(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
equal(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
// fileId.
do_check_eq(this.readInt32(), fileId);
equal(this.readInt32(), fileId);
// pathId.
do_check_eq(this.readString(), EF_PATH_MF_SIM + EF_PATH_DF_TELECOM);
equal(this.readString(), EF_PATH_MF_SIM + EF_PATH_DF_TELECOM);
// p1.
do_check_eq(this.readInt32(), 1);
equal(this.readInt32(), 1);
// p2.
do_check_eq(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
equal(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
// p3.
do_check_eq(this.readInt32(), 0x20);
equal(this.readInt32(), 0x20);
// data.
let contact = pdu.readAlphaIdDiallingNumber(0x20);
do_check_eq(contact.alphaId, "test");
do_check_eq(contact.number, "123456");
equal(contact.alphaId, "test");
equal(contact.number, "123456");
// pin2.
if (fileId == ICC_EF_ADN) {
do_check_eq(this.readString(), null);
equal(this.readString(), null);
} else {
do_check_eq(this.readString(), "1111");
equal(this.readString(), "1111");
}
if (!ril.v5Legacy) {
@ -631,12 +631,12 @@ add_test(function test_find_free_record_id() {
recordHelper.findFreeRecordId(
fileId,
function(recordId) {
do_check_eq(recordId, 2);
equal(recordId, 2);
run_next_test();
}.bind(this),
function(errorMsg) {
do_print(errorMsg);
do_check_true(false);
ok(false);
run_next_test();
}.bind(this));
});
@ -663,15 +663,15 @@ add_test(function test_fetch_icc_recodes() {
RIL.appType = CARD_APPTYPE_SIM;
iccRecord.fetchICCRecords();
do_check_eq(fetchTag, 0x01);
equal(fetchTag, 0x01);
RIL.appType = CARD_APPTYPE_RUIM;
iccRecord.fetchICCRecords();
do_check_eq(fetchTag, 0x02);
equal(fetchTag, 0x02);
RIL.appType = CARD_APPTYPE_USIM;
iccRecord.fetchICCRecords();
do_check_eq(fetchTag, 0x01);
equal(fetchTag, 0x01);
run_next_test();
});
@ -711,7 +711,7 @@ add_test(function test_handling_iccid() {
record.readICCID();
do_check_eq(ril.iccInfo.iccid, expectedICCID);
equal(ril.iccInfo.iccid, expectedICCID);
}
// Invalid value 0xE at high nibbile + low nibbile contains 0xF.

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

@ -19,9 +19,9 @@ add_test(function test_is_icc_service_available() {
function test_table(sst, geckoService, simEnabled, usimEnabled) {
RIL.iccInfoPrivate.sst = sst;
RIL.appType = CARD_APPTYPE_SIM;
do_check_eq(ICCUtilsHelper.isICCServiceAvailable(geckoService), simEnabled);
equal(ICCUtilsHelper.isICCServiceAvailable(geckoService), simEnabled);
RIL.appType = CARD_APPTYPE_USIM;
do_check_eq(ICCUtilsHelper.isICCServiceAvailable(geckoService), usimEnabled);
equal(ICCUtilsHelper.isICCServiceAvailable(geckoService), usimEnabled);
}
test_table([0x08], "ADN", true, false);
@ -41,9 +41,9 @@ add_test(function test_is_gsm_8bit_alphabet() {
const langTable = PDU_NL_LOCKING_SHIFT_TABLES[PDU_NL_IDENTIFIER_DEFAULT];
const langShiftTable = PDU_NL_SINGLE_SHIFT_TABLES[PDU_NL_IDENTIFIER_DEFAULT];
do_check_eq(ICCUtilsHelper.isGsm8BitAlphabet(langTable), true);
do_check_eq(ICCUtilsHelper.isGsm8BitAlphabet(langShiftTable), true);
do_check_eq(ICCUtilsHelper.isGsm8BitAlphabet("\uaaaa"), false);
equal(ICCUtilsHelper.isGsm8BitAlphabet(langTable), true);
equal(ICCUtilsHelper.isGsm8BitAlphabet(langShiftTable), true);
equal(ICCUtilsHelper.isGsm8BitAlphabet("\uaaaa"), false);
run_next_test();
});
@ -93,14 +93,14 @@ add_test(function test_parse_pbr_tlvs() {
];
let pbr = context.ICCUtilsHelper.parsePbrTlvs(pbrTlvs);
do_check_eq(pbr.adn.fileId, 0x4F3a);
do_check_eq(pbr.iap.fileId, 0x4F25);
do_check_eq(pbr.pbc.fileId, 0x4F09);
do_check_eq(pbr.email.fileId, 0x4F50);
do_check_eq(pbr.anr0.fileId, 0x4f11);
do_check_eq(pbr.anr1.fileId, 0x4f12);
do_check_eq(pbr.ccp1.fileId, 0x4F3D);
do_check_eq(pbr.ext1.fileId, 0x4F4A);
equal(pbr.adn.fileId, 0x4F3a);
equal(pbr.iap.fileId, 0x4F25);
equal(pbr.pbc.fileId, 0x4F09);
equal(pbr.email.fileId, 0x4F50);
equal(pbr.anr0.fileId, 0x4f11);
equal(pbr.anr1.fileId, 0x4f12);
equal(pbr.ccp1.fileId, 0x4F3D);
equal(pbr.ext1.fileId, 0x4F4A);
run_next_test();
});
@ -117,12 +117,12 @@ add_test(function test_mcc_mnc_parsing() {
let result = helper.parseMccMncFromImsi(imsi, mncLength);
if (!imsi) {
do_check_eq(result, null);
equal(result, null);
return;
}
do_check_eq(result.mcc, expectedMcc);
do_check_eq(result.mnc, expectedMnc);
equal(result.mcc, expectedMcc);
equal(result.mnc, expectedMnc);
}
// Test the imsi is null.
@ -153,10 +153,10 @@ add_test(function test_get_network_name_from_icc() {
operatorData.lac);
if (expectedResult == null) {
do_check_eq(result, expectedResult);
equal(result, expectedResult);
} else {
do_check_eq(result.fullName, expectedResult.longName);
do_check_eq(result.shortName, expectedResult.shortName);
equal(result.fullName, expectedResult.longName);
equal(result.shortName, expectedResult.shortName);
}
}
@ -311,7 +311,7 @@ add_test(function test_is_cphs_service_available() {
RIL.iccInfoPrivate.cphsSt.set(cphsSt);
for (let service in GECKO_ICC_SERVICES.cphs) {
do_check_eq(ICCUtilsHelper.isCphsServiceAvailable(service),
equal(ICCUtilsHelper.isCphsServiceAvailable(service),
geckoService == service);
}
}

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

@ -364,17 +364,17 @@ add_test(function test_load_icon_basic() {
let onsuccess = function(icons) {
// Query one record at a time.
do_check_eq(icons.length, 1);
do_check_eq(icons[0].length, expected.length);
equal(icons.length, 1);
equal(icons[0].length, expected.length);
for (let i = 0; i < icons[0].length; i++) {
// Read the i_th image of the record.
let icon = icons[0][i];
let exp = expected[i];
do_check_eq(icon.width, exp.width);
do_check_eq(icon.height, exp.height);
do_check_eq(icon.pixels.length, exp.pixels.length);
equal(icon.width, exp.width);
equal(icon.height, exp.height);
equal(icon.pixels.length, exp.pixels.length);
for (let j = 0; j < icon.pixels.length; j++) {
do_check_eq(icon.pixels[j], exp.pixels[j]);
equal(icon.pixels[j], exp.pixels[j]);
}
}
};
@ -746,17 +746,17 @@ add_test(function test_load_icons() {
};
let onsuccess = function(icons) {
do_check_eq(icons.length, test_data.expected.length);
equal(icons.length, test_data.expected.length);
for (let i = 0; i < icons.length; i++) {
for (let j = 0; j < icons[i].length; j++) {
// Read the j_th image from the i_th record.
let icon = icons[i][j];
let expected = test_data.expected[i][j];
do_check_eq(icon.width, expected.width);
do_check_eq(icon.height, expected.height);
do_check_eq(icon.pixels.length, expected.pixels.length);
equal(icon.width, expected.width);
equal(icon.height, expected.height);
equal(icon.pixels.length, expected.pixels.length);
for (let k = 0; k < icon.pixels.length; k++) {
do_check_eq(icon.pixels[k], expected.pixels[k]);
equal(icon.pixels[k], expected.pixels[k]);
}
}
}

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

@ -46,8 +46,8 @@ add_test(function test_reading_ad_and_parsing_mcc_mnc() {
record.readAD();
do_check_eq(ril.iccInfo.mcc, expectedMcc);
do_check_eq(ril.iccInfo.mnc, expectedMnc);
equal(ril.iccInfo.mcc, expectedMcc);
equal(ril.iccInfo.mnc, expectedMnc);
}
do_test(undefined, "466923202422409", "466", "92" );
@ -140,7 +140,7 @@ add_test(function test_reading_optional_efs() {
if (testEf.length !== 0) {
do_print("Un-handled EF: " + JSON.stringify(testEf));
do_check_true(false);
ok(false);
}
};
@ -196,7 +196,7 @@ add_test(function test_fetch_sim_records() {
for (let i = 0; i < expectCalled.length; i++ ) {
if (ifCalled[i] != expectCalled[i]) {
do_print(expectCalled[i] + " is not called.");
do_check_true(false);
ok(false);
}
}
}
@ -263,9 +263,9 @@ add_test(function test_read_mwis() {
buildMwisData(isActive, msgCount);
recordHelper.readMWIS();
do_check_eq("iccmwis", postedMessage.rilMessageType);
do_check_eq(isActive, postedMessage.mwi.active);
do_check_eq((isActive) ? msgCount : 0, postedMessage.mwi.msgCount);
equal("iccmwis", postedMessage.rilMessageType);
equal(isActive, postedMessage.mwi.active);
equal((isActive) ? msgCount : 0, postedMessage.mwi.msgCount);
}
do_test(true, GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN);
@ -319,41 +319,41 @@ add_test(function test_update_mwis() {
isUpdated = true;
// Request Type.
do_check_eq(this.readInt32(), REQUEST_SIM_IO);
equal(this.readInt32(), REQUEST_SIM_IO);
// Token : we don't care
this.readInt32();
// command.
do_check_eq(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
equal(this.readInt32(), ICC_COMMAND_UPDATE_RECORD);
// fileId.
do_check_eq(this.readInt32(), ICC_EF_MWIS);
equal(this.readInt32(), ICC_EF_MWIS);
// pathId.
do_check_eq(this.readString(),
equal(this.readString(),
EF_PATH_MF_SIM + ((ril.appType === CARD_APPTYPE_USIM) ? EF_PATH_ADF_USIM : EF_PATH_DF_GSM));
// p1.
do_check_eq(this.readInt32(), recordNum);
equal(this.readInt32(), recordNum);
// p2.
do_check_eq(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
equal(this.readInt32(), READ_RECORD_ABSOLUTE_MODE);
// p3.
do_check_eq(this.readInt32(), recordSize);
equal(this.readInt32(), recordSize);
// data.
let strLen = this.readInt32();
do_check_eq(recordSize * 2, strLen);
equal(recordSize * 2, strLen);
let expectedMwis = buildMwisData();
for (let i = 0; i < recordSize; i++) {
do_check_eq(expectedMwis[i], pduHelper.readHexOctet());
equal(expectedMwis[i], pduHelper.readHexOctet());
}
this.readStringDelimiter(strLen);
// pin2.
do_check_eq(this.readString(), null);
equal(this.readString(), null);
if (!ril.v5Legacy) {
// AID. Ignore because it's from modem.
@ -361,12 +361,12 @@ add_test(function test_update_mwis() {
}
};
do_check_false(isUpdated);
ok(!isUpdated);
recordHelper.updateMWIS({ active: isActive,
msgCount: count });
do_check_true((ril.iccInfoPrivate.mwis) ? isUpdated : !isUpdated);
ok((ril.iccInfoPrivate.mwis) ? isUpdated : !isUpdated);
}
do_test(true, GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN);
@ -485,10 +485,10 @@ add_test(function test_read_new_sms_on_sim() {
let postedMessage = workerHelper.postedMessage;
do_check_eq("sms-received", postedMessage.rilMessageType);
do_check_eq("+0123456789", postedMessage.SMSC);
do_check_eq("+9876543210", postedMessage.sender);
do_check_eq("How are you?", postedMessage.body);
equal("sms-received", postedMessage.rilMessageType);
equal("+0123456789", postedMessage.SMSC);
equal("+9876543210", postedMessage.sender);
equal("How are you?", postedMessage.body);
}
do_test();
@ -534,8 +534,8 @@ add_test(function test_update_display_condition() {
record.readSPDI();
do_check_eq(ril.iccInfo.isDisplayNetworkNameRequired, true);
do_check_eq(ril.iccInfo.isDisplaySpnRequired, false);
equal(ril.iccInfo.isDisplayNetworkNameRequired, true);
equal(ril.iccInfo.isDisplaySpnRequired, false);
}
function do_test_spn(displayCondition,
@ -566,8 +566,8 @@ add_test(function test_update_display_condition() {
record.readSPN();
do_check_eq(ril.iccInfo.isDisplayNetworkNameRequired, expectedPlmnNameDisplay);
do_check_eq(ril.iccInfo.isDisplaySpnRequired, expectedSpnDisplay);
equal(ril.iccInfo.isDisplayNetworkNameRequired, expectedPlmnNameDisplay);
equal(ril.iccInfo.isDisplaySpnRequired, expectedSpnDisplay);
}
// Create empty operator object.
@ -758,17 +758,17 @@ add_test(function test_reading_img_basic() {
};
let onsuccess = function(icons) {
do_check_eq(icons.length, expected.length);
equal(icons.length, expected.length);
for (let i = 0; i < icons.length; i++) {
let icon = icons[i];
let exp = expected[i];
do_check_eq(icon.width, exp.width);
do_check_eq(icon.height, exp.height);
do_check_eq(icon.codingScheme, exp.codingScheme);
equal(icon.width, exp.width);
equal(icon.height, exp.height);
equal(icon.codingScheme, exp.codingScheme);
do_check_eq(icon.body.length, exp.body.length);
equal(icon.body.length, exp.body.length);
for (let j = 0; j < icon.body.length; j++) {
do_check_eq(icon.body[j], exp.body[j]);
equal(icon.body[j], exp.body[j]);
}
}
};
@ -839,12 +839,12 @@ add_test(function test_reading_img_length_error() {
let onsuccess = function() {
do_print("onsuccess shouldn't be called.");
do_check_true(false);
ok(false);
};
let onerror = function() {
do_print("onerror called as expected.");
do_check_true(true);
ok(true);
};
record.readIMG(0, onsuccess, onerror);
@ -908,12 +908,12 @@ add_test(function test_reading_img_invalid_fileId() {
let onsuccess = function() {
do_print("onsuccess shouldn't be called.");
do_check_true(false);
ok(false);
};
let onerror = function() {
do_print("onerror called as expected.");
do_check_true(true);
ok(true);
};
record.readIMG(0, onsuccess, onerror);
@ -957,12 +957,12 @@ add_test(function test_reading_img_wrong_record_length() {
let onsuccess = function() {
do_print("onsuccess shouldn't be called.");
do_check_true(false);
ok(false);
};
let onerror = function() {
do_print("onerror called as expected.");
do_check_true(true);
ok(true);
};
record.readIMG(0, onsuccess, onerror);
@ -1109,22 +1109,22 @@ add_test(function test_reading_img_color() {
};
let onsuccess = function(icons) {
do_check_eq(icons.length, expected.length);
equal(icons.length, expected.length);
for (let i = 0; i < icons.length; i++) {
let icon = icons[i];
let exp = expected[i];
do_check_eq(icon.width, exp.width);
do_check_eq(icon.height, exp.height);
do_check_eq(icon.codingScheme, exp.codingScheme);
equal(icon.width, exp.width);
equal(icon.height, exp.height);
equal(icon.codingScheme, exp.codingScheme);
do_check_eq(icon.body.length, exp.body.length);
equal(icon.body.length, exp.body.length);
for (let j = 0; j < icon.body.length; j++) {
do_check_eq(icon.body[j], exp.body[j]);
equal(icon.body[j], exp.body[j]);
}
do_check_eq(icon.clut.length, exp.clut.length);
equal(icon.clut.length, exp.clut.length);
for (let j = 0; j < icon.clut.length; j++) {
do_check_eq(icon.clut[j], exp.clut[j]);
equal(icon.clut[j], exp.clut[j]);
}
}
};
@ -1274,22 +1274,22 @@ add_test(function test_reading_img_color() {
};
let onsuccess = function(icons) {
do_check_eq(icons.length, expected.length);
equal(icons.length, expected.length);
for (let i = 0; i < icons.length; i++) {
let icon = icons[i];
let exp = expected[i];
do_check_eq(icon.width, exp.width);
do_check_eq(icon.height, exp.height);
do_check_eq(icon.codingScheme, exp.codingScheme);
equal(icon.width, exp.width);
equal(icon.height, exp.height);
equal(icon.codingScheme, exp.codingScheme);
do_check_eq(icon.body.length, exp.body.length);
equal(icon.body.length, exp.body.length);
for (let j = 0; j < icon.body.length; j++) {
do_check_eq(icon.body[j], exp.body[j]);
equal(icon.body[j], exp.body[j]);
}
do_check_eq(icon.clut.length, exp.clut.length);
equal(icon.clut.length, exp.clut.length);
for (let j = 0; j < icon.clut.length; j++) {
do_check_eq(icon.clut[j], exp.clut[j]);
equal(icon.clut[j], exp.clut[j]);
}
}
};
@ -1346,15 +1346,15 @@ add_test(function test_read_cphs_info() {
recordHelper.readCphsInfo(() => { onsuccess = true; },
() => { onerror = true; });
do_check_true((cphsSt) ? onsuccess : onerror);
do_check_false((cphsSt) ? onerror : onsuccess);
ok((cphsSt) ? onsuccess : onerror);
ok(!((cphsSt) ? onerror : onsuccess));
if (cphsSt) {
do_check_eq(RIL.iccInfoPrivate.cphsSt.length, cphsSt.length);
equal(RIL.iccInfoPrivate.cphsSt.length, cphsSt.length);
for (let i = 0; i < cphsSt.length; i++) {
do_check_eq(RIL.iccInfoPrivate.cphsSt[i], cphsSt[i]);
equal(RIL.iccInfoPrivate.cphsSt[i], cphsSt[i]);
}
} else {
do_check_eq(RIL.iccInfoPrivate.cphsSt, cphsSt);
equal(RIL.iccInfoPrivate.cphsSt, cphsSt);
}
}
@ -1439,9 +1439,9 @@ add_test(function test_read_voicemail_number() {
delete RIL.iccInfoPrivate.mbdn;
recordHelper[funcName]();
do_check_eq("iccmbdn", postedMessage.rilMessageType);
do_check_eq("Voicemail", postedMessage.alphaId);
do_check_eq("111", postedMessage.number);
equal("iccmbdn", postedMessage.rilMessageType);
equal("Voicemail", postedMessage.alphaId);
equal("111", postedMessage.number);
}
do_test("readMBDN");
@ -1498,8 +1498,8 @@ add_test(function test_read_mbdn_recovered_from_cphs_mbn() {
recordHelper.readMBDN();
do_check_eq(RIL.iccInfoPrivate.mbdn, undefined);
do_check_true(isRecovered);
equal(RIL.iccInfoPrivate.mbdn, undefined);
ok(isRecovered);
run_next_test();
});
@ -1554,7 +1554,7 @@ add_test(function test_pnn_with_different_coding_scheme() {
record.readPNN();
do_check_eq(ril.iccInfoPrivate.PNN[0].fullName, expectedResult);
equal(ril.iccInfoPrivate.PNN[0].fullName, expectedResult);
// Reset PNN info for next test
ril.iccInfoPrivate.PNN = null;
}
@ -1630,15 +1630,15 @@ add_test(function test_pnn_with_different_content() {
record.readPNN();
do_check_eq(test_data.length, ril.iccInfoPrivate.PNN.length);
equal(test_data.length, ril.iccInfoPrivate.PNN.length);
for (let i = 0; i < test_data.length; i++) {
if (test_data[i].expectedResult) {
do_check_eq(test_data[i].expectedResult.fullName,
equal(test_data[i].expectedResult.fullName,
ril.iccInfoPrivate.PNN[i].fullName);
do_check_eq(test_data[i].expectedResult.shortName,
equal(test_data[i].expectedResult.shortName,
ril.iccInfoPrivate.PNN[i].shortName);
} else {
do_check_eq(test_data[i].expectedResult, ril.iccInfoPrivate.PNN[i]);
equal(test_data[i].expectedResult, ril.iccInfoPrivate.PNN[i]);
}
}
}

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

@ -32,8 +32,8 @@ function testSendMMI(mmi, error) {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.rilMessageType, "sendMMI");
do_check_eq(postedMessage.errorMsg, error);
equal(postedMessage.rilMessageType, "sendMMI");
equal(postedMessage.errorMsg, error);
}
/**
@ -65,10 +65,10 @@ add_test(function test_sendMMI_short_code() {
context.RIL.sendMMI({mmi: {fullMMI: "**"}});
let postedMessage = workerhelper.postedMessage;
do_check_eq(ussdOptions.ussd, "**");
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
do_check_true(context.RIL._ussdSession);
equal(ussdOptions.ussd, "**");
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
ok(context.RIL._ussdSession);
run_next_test();
});
@ -90,8 +90,8 @@ add_test(function test_sendMMI_change_PIN() {
let postedMessage = workerhelper.postedMessage;
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -141,8 +141,8 @@ add_test(function test_sendMMI_change_PIN2() {
let postedMessage = workerhelper.postedMessage;
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -192,8 +192,8 @@ add_test(function test_sendMMI_unblock_PIN() {
let postedMessage = workerhelper.postedMessage;
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -243,8 +243,8 @@ add_test(function test_sendMMI_unblock_PIN2() {
let postedMessage = workerhelper.postedMessage;
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -294,9 +294,9 @@ add_test(function test_sendMMI_get_IMEI() {
let postedMessage = workerhelper.postedMessage;
do_check_neq(mmiOptions.mmi, null);
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
notEqual(mmiOptions.mmi, null);
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
run_next_test();
});
@ -318,9 +318,9 @@ add_test(function test_sendMMI_get_IMEI_error() {
let postedMessage = workerhelper.postedMessage;
do_check_neq(mmiOptions.mmi, null);
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_RADIO_NOT_AVAILABLE);
do_check_false(postedMessage.success);
notEqual(mmiOptions.mmi, null);
equal (postedMessage.errorMsg, GECKO_ERROR_RADIO_NOT_AVAILABLE);
ok(!postedMessage.success);
run_next_test();
});
@ -347,11 +347,11 @@ add_test(function test_sendMMI_call_barring_BAIC_interrogation_voice() {
let postedMessage = workerhelper.postedMessage;
do_check_true(postedMessage.success);
do_check_true(postedMessage.enabled);
do_check_eq(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED_FOR);
do_check_true(Array.isArray(postedMessage.additionalInformation));
do_check_eq(postedMessage.additionalInformation[0], "serviceClassVoice");
ok(postedMessage.success);
ok(postedMessage.enabled);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED_FOR);
ok(Array.isArray(postedMessage.additionalInformation));
equal(postedMessage.additionalInformation[0], "serviceClassVoice");
run_next_test();
});
@ -377,9 +377,9 @@ add_test(function test_sendMMI_call_barring_BAIC_activation() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(mmiOptions.procedure, MMI_PROCEDURE_ACTIVATION);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED);
equal(mmiOptions.procedure, MMI_PROCEDURE_ACTIVATION);
ok(postedMessage.success);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED);
run_next_test();
});
@ -405,9 +405,9 @@ add_test(function test_sendMMI_call_barring_BAIC_deactivation() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(mmiOptions.procedure, MMI_PROCEDURE_DEACTIVATION);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.statusMessage, MMI_SM_KS_SERVICE_DISABLED);
equal(mmiOptions.procedure, MMI_PROCEDURE_DEACTIVATION);
ok(postedMessage.success);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_DISABLED);
run_next_test();
});
@ -436,10 +436,10 @@ add_test(function test_sendMMI_USSD() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(ussdOptions.ussd, "**123#");
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
do_check_true(context.RIL._ussdSession);
equal(ussdOptions.ussd, "**123#");
equal (postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
ok(context.RIL._ussdSession);
run_next_test();
});
@ -462,10 +462,10 @@ add_test(function test_sendMMI_USSD_error() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(ussdOptions.ussd, "**123#");
do_check_eq (postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
do_check_false(postedMessage.success);
do_check_false(context.RIL._ussdSession);
equal(ussdOptions.ussd, "**123#");
equal (postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
ok(!context.RIL._ussdSession);
run_next_test();
});
@ -486,8 +486,8 @@ function setCallWaitingSuccess(mmi) {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
equal(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
}
add_test(function test_sendMMI_call_waiting_activation() {
@ -539,9 +539,9 @@ add_test(function test_sendMMI_call_waiting_interrogation() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
do_check_true(postedMessage.success);
do_check_eq(postedMessage.length, 2);
do_check_true(postedMessage.enabled);
equal(postedMessage.errorMsg, GECKO_ERROR_SUCCESS);
ok(postedMessage.success);
equal(postedMessage.length, 2);
ok(postedMessage.enabled);
run_next_test();
});

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

@ -37,8 +37,8 @@ function setCallForwardSuccess(procedure, serviceCode, sia, sib, sic) {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
}
add_test(function test_sendMMI_call_forwarding_activation() {
@ -85,13 +85,13 @@ add_test(function test_sendMMI_call_forwarding_interrogation() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.success);
do_check_true(Array.isArray(postedMessage.rules));
do_check_eq(postedMessage.rules.length, 1);
do_check_true(postedMessage.rules[0].active);
do_check_eq(postedMessage.rules[0].reason, CALL_FORWARD_REASON_UNCONDITIONAL);
do_check_eq(postedMessage.rules[0].number, "+34666222333");
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
ok(Array.isArray(postedMessage.rules));
equal(postedMessage.rules.length, 1);
ok(postedMessage.rules[0].active);
equal(postedMessage.rules[0].reason, CALL_FORWARD_REASON_UNCONDITIONAL);
equal(postedMessage.rules[0].number, "+34666222333");
run_next_test();
});
@ -115,8 +115,8 @@ add_test(function test_sendMMI_call_forwarding_interrogation_no_rules() {
let postedMessage = workerhelper.postedMessage;
do_check_eq(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
do_check_false(postedMessage.success);
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
run_next_test();
});

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

@ -18,7 +18,7 @@ add_test(function test_is_ruim_service_available() {
function test_table(cst, geckoService, enabled) {
context.RIL.iccInfoPrivate.cst = cst;
do_check_eq(context.ICCUtilsHelper.isICCServiceAvailable(geckoService),
equal(context.ICCUtilsHelper.isICCServiceAvailable(geckoService),
enabled);
}
@ -40,7 +40,7 @@ add_test(function test_ruim_file_path_id() {
let ICCFileHelper = context.ICCFileHelper;
RIL.appType = CARD_APPTYPE_RUIM;
do_check_eq(ICCFileHelper.getEFPath(ICC_EF_CSIM_CST),
equal(ICCFileHelper.getEFPath(ICC_EF_CSIM_CST),
EF_PATH_MF_SIM + EF_PATH_DF_CDMA);
run_next_test();
@ -76,7 +76,7 @@ add_test(function test_fetch_ruim_recodes() {
for (let i = 0; i < expectCalled.length; i++ ) {
if (ifCalled[i] != expectCalled[i]) {
do_print(expectCalled[i] + " is not called.");
do_check_true(false);
ok(false);
}
}
}
@ -98,7 +98,7 @@ add_test(function test_decode_imsi_value() {
function testDecodeImsiValue(encoded, length, expect) {
let decoded = context.RuimRecordHelper.decodeIMSIValue(encoded, length);
do_check_eq(expect, decoded);
equal(expect, decoded);
}
testDecodeImsiValue( 99, 2, "00");
@ -150,7 +150,7 @@ add_test(function test_get_imsi_m() {
context.RuimRecordHelper.getIMSI_M();
let imsi = context.RIL.iccInfoPrivate.imsi;
do_check_eq(expectedImsi, imsi)
equal(expectedImsi, imsi)
}
let imsi_1 = "466050081062861";
@ -198,11 +198,11 @@ add_test(function test_read_cdmahome() {
context.RuimRecordHelper.readCDMAHome();
let cdmaHome = context.RIL.cdmaHome;
for (let i = 0; i < expectedSystemIds.length; i++) {
do_check_eq(cdmaHome.systemId[i], expectedSystemIds[i]);
do_check_eq(cdmaHome.networkId[i], expectedNetworkIds[i]);
equal(cdmaHome.systemId[i], expectedSystemIds[i]);
equal(cdmaHome.networkId[i], expectedNetworkIds[i]);
}
do_check_eq(cdmaHome.systemId.length, expectedSystemIds.length);
do_check_eq(cdmaHome.networkId.length, expectedNetworkIds.length);
equal(cdmaHome.systemId.length, expectedSystemIds.length);
equal(cdmaHome.networkId.length, expectedNetworkIds.length);
}
testCdmaHome([13505], [65535]);
@ -239,8 +239,8 @@ add_test(function test_read_cdmaspn() {
};
context.RuimRecordHelper.readSPN();
do_check_eq(context.RIL.iccInfo.spn, expectedSpn);
do_check_eq(context.RIL.iccInfoPrivate.spnDisplayCondition,
equal(context.RIL.iccInfo.spn, expectedSpn);
equal(context.RIL.iccInfoPrivate.spnDisplayCondition,
expectedDisplayCondition);
}
@ -287,9 +287,9 @@ add_test(function test_cdma_spn_display_condition() {
RIL._isCdma = true;
// Test updateDisplayCondition runs before any of SIM file is ready.
do_check_eq(ICCUtilsHelper.updateDisplayCondition(), true);
do_check_eq(RIL.iccInfo.isDisplayNetworkNameRequired, true);
do_check_eq(RIL.iccInfo.isDisplaySpnRequired, false);
equal(ICCUtilsHelper.updateDisplayCondition(), true);
equal(RIL.iccInfo.isDisplayNetworkNameRequired, true);
equal(RIL.iccInfo.isDisplaySpnRequired, false);
// Test with value.
function testDisplayCondition(ruimDisplayCondition,
@ -307,9 +307,9 @@ add_test(function test_cdma_spn_display_condition() {
cdmaNetworkId: currentNetworkId
};
do_check_eq(ICCUtilsHelper.updateDisplayCondition(), expectUpdateDisplayCondition);
do_check_eq(RIL.iccInfo.isDisplayNetworkNameRequired, false);
do_check_eq(RIL.iccInfo.isDisplaySpnRequired, expectIsDisplaySPNRequired);
equal(ICCUtilsHelper.updateDisplayCondition(), expectUpdateDisplayCondition);
equal(RIL.iccInfo.isDisplayNetworkNameRequired, false);
equal(RIL.iccInfo.isDisplaySpnRequired, expectIsDisplaySPNRequired);
};
// SPN is not required when ruimDisplayCondition is false.

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

@ -142,7 +142,7 @@ function add_test_receiving_sms(expected, pdu) {
},
postMessage: function(message) {
do_print("fullBody: " + message.fullBody);
do_check_eq(expected, message.fullBody)
equal(expected, message.fullBody)
}
});
@ -247,7 +247,7 @@ add_test(function test_sendSMS_UCS2_without_langIndex_langShiftIndex_defined() {
//
// If we have additional 6(type, len, langIndex, type len, langShiftIndex)
// octets here, then bug 809553 is not fixed.
do_check_eq(this.outgoingIndex, 57);
equal(this.outgoingIndex, 57);
run_next_test();
};

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

@ -213,20 +213,20 @@ add_test(function test_processCdmaSmsStatusReport() {
let postedMessage = workerHelper.postedMessage;
// Check if pending token is removed.
do_check_true((errorClass === 2) ? !!sentSmsMap[msgId] : !sentSmsMap[msgId]);
ok((errorClass === 2) ? !!sentSmsMap[msgId] : !sentSmsMap[msgId]);
// Check the response message accordingly.
if (errorClass === -1) {
// Check if the report is treated as normal incoming SMS
do_check_eq("sms-received", postedMessage.rilMessageType);
equal("sms-received", postedMessage.rilMessageType);
} else if (errorClass === 2) {
// Do nothing.
} else {
// Check Delivery Status
if (errorClass === 0) {
do_check_eq(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_SUCCESS);
equal(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_SUCCESS);
} else {
do_check_eq(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_ERROR);
equal(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_ERROR);
}
}
}
@ -283,12 +283,12 @@ add_test(function test_processCdmaSmsWapPush() {
do_print("fullDataHexString: " + fullDataHexString);
do_check_eq("sms-received", postedMessage.rilMessageType);
do_check_eq(PDU_CDMA_MSG_TELESERIVCIE_ID_WAP, postedMessage.teleservice);
do_check_eq(orig_address, postedMessage.sender);
do_check_eq(0x23F0, postedMessage.header.originatorPort);
do_check_eq(0x0B84, postedMessage.header.destinationPort);
do_check_eq(fullDataHexString, bytesToHexString(postedMessage.data));
equal("sms-received", postedMessage.rilMessageType);
equal(PDU_CDMA_MSG_TELESERIVCIE_ID_WAP, postedMessage.teleservice);
equal(orig_address, postedMessage.sender);
equal(0x23F0, postedMessage.header.originatorPort);
equal(0x0B84, postedMessage.header.destinationPort);
equal(fullDataHexString, bytesToHexString(postedMessage.data));
}
// Verify Single WAP PDU

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

@ -29,10 +29,10 @@ add_test(function test_CdmaPDUHelper_encodeUserDataReplyOption() {
let expectedDataBuffer = [PDU_CDMA_MSG_USERDATA_REPLY_OPTION, 0x01, 0x40];
do_check_eq(testDataBuffer.length, expectedDataBuffer.length);
equal(testDataBuffer.length, expectedDataBuffer.length);
for (let i = 0; i < expectedDataBuffer.length; i++) {
do_check_eq(testDataBuffer[i], expectedDataBuffer[i]);
equal(testDataBuffer[i], expectedDataBuffer[i]);
}
run_next_test();
@ -58,8 +58,8 @@ add_test(function test_CdmaPDUHelper_decodeUserDataMsgStatus() {
context.BitBufferHelper.startRead(testDataBuffer);
let result = helper.decodeUserDataMsgStatus();
do_check_eq(result.errorClass, octet >>> 6);
do_check_eq(result.msgStatus, octet & 0x3F);
equal(result.errorClass, octet >>> 6);
equal(result.msgStatus, octet & 0x3F);
}
// 00|000000: no error|Message accepted
@ -93,7 +93,7 @@ add_test(function test_CdmaPDUHelper_decodeCdmaPDUMsg_Shift_jis() {
function test_decodePDUMsg(testDataBuffer, expected, encoding, msgType, msgBodySize) {
context.BitBufferHelper.startRead(testDataBuffer);
let result = helper.decodeCdmaPDUMsg(encoding, msgType, msgBodySize);
do_check_eq(result, expected);
equal(result, expected);
}
// Shift-JIS has 1 byte and 2 byte code for one character and has some types of characters:

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

@ -30,14 +30,14 @@ add_test(function test_GsmPDUHelper_readDataCodingScheme() {
let msg = {};
helper.readDataCodingScheme(msg);
do_check_eq(msg.dcs, dcs);
do_check_eq(msg.encoding, encoding);
do_check_eq(msg.messageClass, messageClass);
do_check_eq(msg.mwi == null, mwi == null);
equal(msg.dcs, dcs);
equal(msg.encoding, encoding);
equal(msg.messageClass, messageClass);
equal(msg.mwi == null, mwi == null);
if (mwi != null) {
do_check_eq(msg.mwi.active, mwi.active);
do_check_eq(msg.mwi.discard, mwi.discard);
do_check_eq(msg.mwi.msgCount, mwi.msgCount);
equal(msg.mwi.active, mwi.active);
equal(msg.mwi.discard, mwi.discard);
equal(msg.mwi.msgCount, mwi.msgCount);
}
}
@ -179,7 +179,7 @@ add_test(function test_GsmPDUHelper_writeStringAsSeptets() {
helper.resetOctetWritten();
helper.writeStringAsSeptets(str, paddingBits, PDU_NL_IDENTIFIER_DEFAULT,
PDU_NL_IDENTIFIER_DEFAULT);
do_check_eq(Math.ceil(((len * 7) + paddingBits) / 8),
equal(Math.ceil(((len * 7) + paddingBits) / 8),
helper.octetsWritten);
}
}
@ -217,7 +217,7 @@ add_test(function test_GsmPDUHelper_readAddress() {
}
let length = helper.readHexOctet();
let parsedAddr = helper.readAddress(length);
do_check_eq(parsedAddr, addrString);
equal(parsedAddr, addrString);
}
// For AlphaNumeric

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

@ -24,13 +24,13 @@ add_test(function test_nl_locking_shift_tables_validity() {
let table = PDU_NL_LOCKING_SHIFT_TABLES[lst];
// Make sure table length is 128, or it will break table lookup algorithm.
do_check_eq(table.length, 128);
equal(table.length, 128);
// Make sure special values are preserved.
do_check_eq(table[PDU_NL_EXTENDED_ESCAPE], ESCAPE);
do_check_eq(table[PDU_NL_LINE_FEED], LF);
do_check_eq(table[PDU_NL_CARRIAGE_RETURN], CR);
do_check_eq(table[PDU_NL_SPACE], SP);
equal(table[PDU_NL_EXTENDED_ESCAPE], ESCAPE);
equal(table[PDU_NL_LINE_FEED], LF);
equal(table[PDU_NL_CARRIAGE_RETURN], CR);
equal(table[PDU_NL_SPACE], SP);
}
run_next_test();
@ -43,12 +43,12 @@ add_test(function test_nl_single_shift_tables_validity() {
let table = PDU_NL_SINGLE_SHIFT_TABLES[sst];
// Make sure table length is 128, or it will break table lookup algorithm.
do_check_eq(table.length, 128);
equal(table.length, 128);
// Make sure special values are preserved.
do_check_eq(table[PDU_NL_EXTENDED_ESCAPE], ESCAPE);
do_check_eq(table[PDU_NL_PAGE_BREAK], FF);
do_check_eq(table[PDU_NL_RESERVED_CONTROL], RESCTL);
equal(table[PDU_NL_EXTENDED_ESCAPE], ESCAPE);
equal(table[PDU_NL_PAGE_BREAK], FF);
equal(table[PDU_NL_RESERVED_CONTROL], RESCTL);
}
run_next_test();
@ -64,12 +64,12 @@ add_test(function test_gsm_sms_strict_7bit_charmap_validity() {
+ to.charCodeAt(0).toString(16) + "\"");
// Make sure "from" is not in default table
do_check_eq(defaultTable.indexOf(from), -1);
do_check_eq(defaultShiftTable.indexOf(from), -1);
equal(defaultTable.indexOf(from), -1);
equal(defaultShiftTable.indexOf(from), -1);
// Make sure "to" is in default table
if ((defaultTable.indexOf(to) < 0)
&& (defaultShiftTable.indexOf(to) < 0)) {
do_check_eq(false, true);
equal(false, true);
}
}

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

@ -42,7 +42,7 @@ add_test(function test_SmsSegmentHelper__countGsm7BitSeptets() {
};
function do_check_calc(str, expectedCalcLen, lst, sst, strict7BitEncoding, strToWrite) {
do_check_eq(expectedCalcLen,
equal(expectedCalcLen,
gSmsSegmentHelper
.countGsm7BitSeptets(str,
PDU_NL_LOCKING_SHIFT_TABLES[lst],
@ -52,7 +52,7 @@ add_test(function test_SmsSegmentHelper__countGsm7BitSeptets() {
helper.resetOctetWritten();
strToWrite = strToWrite || str;
helper.writeStringAsSeptets(strToWrite, 0, lst, sst);
do_check_eq(Math.ceil(expectedCalcLen * 7 / 8), helper.octetsWritten);
equal(Math.ceil(expectedCalcLen * 7 / 8), helper.octetsWritten);
}
// Test calculation encoded message length using both locking/single shift tables.

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

@ -67,9 +67,9 @@ add_test(function test_notification() {
context.RIL._processSuppSvcNotification(notificationInfo);
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.rilMessageType, 'suppSvcNotification');
do_check_eq(postedMessage.notification, resultNotification);
do_check_eq(postedMessage.callIndex, resultCallIndex);
equal(postedMessage.rilMessageType, 'suppSvcNotification');
equal(postedMessage.notification, resultNotification);
equal(postedMessage.callIndex, resultCallIndex);
// Clear all existed calls.
context.RIL._processCalls({});

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

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

@ -24,7 +24,7 @@ add_test(function test_setVoicePrivacyMode_success() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -46,7 +46,7 @@ add_test(function test_setVoicePrivacyMode_generic_failure() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, "GenericFailure");
equal(postedMessage.errorMsg, "GenericFailure");
run_next_test();
});
@ -70,8 +70,8 @@ add_test(function test_queryVoicePrivacyMode_success_enabled_true() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_true(postedMessage.enabled);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.enabled);
run_next_test();
});
@ -94,7 +94,7 @@ add_test(function test_queryVoicePrivacyMode_success_enabled_false() {
let postedMessage = workerHelper.postedMessage;
do_check_eq(postedMessage.errorMsg, undefined);
do_check_false(postedMessage.enabled);
equal(postedMessage.errorMsg, undefined);
ok(!postedMessage.enabled);
run_next_test();
});

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

@ -4,33 +4,28 @@ MAINTAINER Dustin J. Mitchell <dustin@mozilla.com>
ENV PYTHONPATH /tools/tools/lib/python:$PYTHONPATH
ENV TOOLTOOL_CACHE /home/worker/tools/tooltool-cache
ADD https://raw.githubusercontent.com/taskcluster/buildbot-step/58a16f7370a8b4de7a4458436a4a5fad9905f5d9/buildbot_step.js /home/worker/bin/buildbot_step
# Add utilities and configuration
RUN mkdir -p /home/worker/bin /home/worker/tools
# Add bin tools last as they are most likely to change
RUN chown -R worker:worker /home/worker/* /home/worker/.*
# Install android repo tool
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /home/worker/bin/repo
RUN chmod a+x /home/worker/bin/repo
# Instal build tools
RUN hg clone http://hg.mozilla.org/build/tools/ /tools/tools && \
cd /tools/tools && \
python setup.py install
# Initialize git (makes repo happy)
RUN git config --global user.email "docker@docker.com" && \
git config --global user.name "docker"
RUN git config --global user.email "mozilla@example.com" && \
git config --global user.name "mozilla"
# VCS Tools
RUN npm install -g taskcluster-vcs@2.2.0
# Add bin tools last as they are most likely to change
COPY bin /home/worker/bin
RUN npm install -g taskcluster-vcs@2.3.0
# TODO enable worker
# TODO volume mount permissions will be an issue
# USER worker
# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]
COPY bin /home/worker/bin
RUN chmod a+x /home/worker/bin/*

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

@ -1 +1 @@
0.3.2
0.5.0

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

@ -0,0 +1,7 @@
GECKO_BASE_REPOSITORY=https://github.com/mozilla/gecko-dev
GECKO_HEAD_REPOSITORY=https://github.com/mozilla/gecko-dev
GECKO_HEAD_REF=master
GECKO_HEAD_REV=master
MOZHARNESS_REPOSITORY=http://hg.mozilla.org/build/mozharness
MOZHARNESS_REV=tip
MOZCONFIG=b2g/config/mozconfigs/linux64_gecko/nightly

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

@ -1,52 +0,0 @@
#!/bin/bash -live
################################### build.sh ###################################
. build-setup.sh
### Check that require variables are defined
test $MOZCONFIG
# Ensure gecko is at the correct revision
pull-gecko.sh $gecko_dir
### Install package dependencies
install-packages.sh $gecko_dir
### Clone gaia
pull-gaia.sh $gecko_dir $gaia_dir
cd $gecko_dir
# Nightly mozconfig expects gaia repo be inside mozilla-central tree
if [ ! -d "gaia" ]; then
ln -s $gaia_dir gaia
fi
export MOZ_OBJDIR=$(get-objdir.py $gecko_dir)
./mach build;
### Make package
cd $MOZ_OBJDIR
make package package-tests;
### Extract artifacts
# Navigate to dist/ folder
cd $MOZ_OBJDIR/dist
ls -lah $MOZ_OBJDIR/dist/
# Target names are cached so make sure we discard them first if found.
rm -f target.linux-x86_64.tar.bz2 target.linux-x86_64.json target.tests.zip
# Artifacts folder is outside of the cache.
mkdir -p /home/worker/artifacts/
# Discard version numbers from packaged files, they just make it hard to write
# the right filename in the task payload where artifacts are declared
mv *.linux-x86_64.tar.bz2 /home/worker/artifacts/target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json /home/worker/artifacts/target.linux-x86_64.json
mv *.tests.zip /home/worker/artifacts/target.tests.zip
################################### build.sh ###################################

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

@ -1,20 +0,0 @@
#!/bin/bash -vex
gecko_dir=/home/worker/gecko/source
gaia_dir=/home/worker/gaia/source
create_parent_dir() {
parent_dir=$(dirname $1)
if [ ! -d "$parent_dir" ]; then
mkdir -p "$parent_dir"
fi
}
# Ensure we always have the parent directory for gecko
create_parent_dir $gecko_dir
# Create .mozbuild so mach doesn't complain about this
mkdir -p /home/worker/.mozbuild/
# Create object-folder exists
mkdir -p /home/worker/object-folder/

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

@ -1,35 +0,0 @@
#!/bin/bash -live
################################### build.sh ###################################
build-setup.sh
### Check that we are running as worker
test `whoami` == 'worker';
### Check that require variables are defined
test $REPOSITORY # Should be an hg repository url to pull from
test $REVISION # Should be an hg revision to pull down
test $MOZCONFIG # Should be a mozconfig file from mozconfig/ folder
### Pull, Update and Build
cd /home/worker/mozilla-central;
hg pull -r $REVISION $REPOSITORY;
hg update $REVISION;
./mach build;
### Make package
cd /home/worker/object-folder;
make package package-tests;
### Extract artifacts
# Navigate to dist/ folder
cd /home/worker/object-folder/dist;
# Discard version numbers from packaged files, they just make it hard to write
# the right filename in the task payload where artifacts are declared
mv *.linux-x86_64.tar.bz2 target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json target.linux-x86_64.json
mv *.tests.zip target.tests.zip
################################### build.sh ###################################

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

@ -0,0 +1,16 @@
#! /bin/bash -ex
# Ensure we have at least enough to check gecko out...
test $GECKO_BASE_REPOSITORY
# Workspace to checkout gecko into...
WORKSPACE=$1
mkdir -p $WORKSPACE
# Note that tc-vcs requires only the first two arguments so others are optional.
# This is intended to make it easier to clone local directories.
buildbot_step "Clone gecko" tc-vcs checkout $WORKSPACE/gecko \
$GECKO_BASE_REPOSITORY \
$GECKO_HEAD_REPOSITORY \
$GECKO_HEAD_REV \
$GECKO_HEAD_REF

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

@ -1,17 +0,0 @@
#! /bin/bash -ex
DEST=/home/worker/source/gecko
test $GECKO_BASE_REPOSITORY # e.g. https://hg.mozilla.org/mozilla-central
test $GECKO_HEAD_REPOSITORY # e.g. https://hg.mozilla.org/try
test $GECKO_HEAD_REF # <cset>
test $GECKO_HEAD_REV # <cset>
tc-vcs checkout $DEST \
$GECKO_BASE_REPOSITORY \
$GECKO_HEAD_REPOSITORY \
$GECKO_HEAD_REV \
$GECKO_HEAD_REF
echo "At revision: $(tc-vcs revision $DEST)"
cd $DEST

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

@ -1,14 +0,0 @@
#! /bin/bash -e
target=$1
test $GECKO_BASE_REPOSITORY # base repository
test $GECKO_HEAD_REPOSITORY # repository to pull from
test $GECKO_HEAD_REF # reference if needed (usually same as rev)
test $GECKO_HEAD_REV # revision to checkout after pull
tc-vcs checkout $target \
$GECKO_BASE_REPOSITORY \
$GECKO_HEAD_REPOSITORY \
$GECKO_HEAD_REV \
$GECKO_HEAD_REF \

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

@ -0,0 +1,7 @@
GECKO_BASE_REPOSITORY=https://github.com/mozilla/gecko-dev
GECKO_HEAD_REPOSITORY=https://github.com/mozilla/gecko-dev
GECKO_HEAD_REF=master
GECKO_HEAD_REV=master
MOZHARNESS_REPOSITORY=http://hg.mozilla.org/build/mozharness
MOZHARNESS_REV=tip
MOZCONFIG=b2g/dev/config/mozconfigs/linux64/mulet

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

@ -0,0 +1,6 @@
MOZHARNESS_REPOSITORY=http://hg.mozilla.org/build/mozharness
MOZHARNESS_REV=tip
GAIA_REV=tip
GAIA_REF=tip
GAIA_BASE_REPOSITORY=https://hg.mozilla.org/integration/gaia-central
GAIA_HEAD_REPOSITORY=https://hg.mozilla.org/integration/gaia-central

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

@ -1,5 +1,16 @@
# Taskcluster + Gecko Integration
## Directory structure:
- tasks/ : All task definitions
- tests/ : Tests for the mach target internals related to task graph
generation
- scripts : Various scripts used by taskcluster docker images and
utilities these exist in tree primarily to avoid rebuilding
docker images.
## Task conventions
In order to properly enable task reuse there are a small number of

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

@ -0,0 +1,43 @@
#!/bin/bash -ex
################################### build.sh ###################################
# Ensure all the scripts in this dir are on the path....
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PATH=$DIRNAME:$PATH
. desktop-setup.sh
### Clone gaia
pull-gaia.sh $GECKO_DIR $GAIA_DIR
# Ensure symlink has been created to gaia...
rm -f $GECKO_DIR/gaia
ln -s $GAIA_DIR $GECKO_DIR/gaia
cd $GECKO_DIR
./mach build;
### Make package
cd $MOZ_OBJDIR
make package package-tests;
### Extract artifacts
# Navigate to dist/ folder
cd $MOZ_OBJDIR/dist
ls -lah $MOZ_OBJDIR/dist/
# Target names are cached so make sure we discard them first if found.
rm -f target.linux-x86_64.tar.bz2 target.linux-x86_64.json target.tests.zip
# Artifacts folder is outside of the cache.
mkdir -p $HOME/artifacts/
# Discard version numbers from packaged files, they just make it hard to write
# the right filename in the task payload where artifacts are declared
mv *.linux-x86_64.tar.bz2 $HOME/artifacts/target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json $HOME/artifacts/target.linux-x86_64.json
mv *.tests.zip $HOME/artifacts/target.tests.zip
ccache -s
################################### build.sh ###################################

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

@ -1,6 +1,13 @@
#! /bin/bash -vex
# Ensure all the scripts in this dir are on the path....
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PATH=$DIRNAME:$PATH
WORKSPACE=$1
### Check that require variables are defined
test -d $WORKSPACE
test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
test $GECKO_HEAD_REV # Should be an hg revision to pull down
@ -8,6 +15,8 @@ test $MOZHARNESS_REPOSITORY # mozharness repository
test $MOZHARNESS_REV # mozharness revision
test $TARGET
. setup-ccache.sh
# First check if the mozharness directory is available. This is intended to be
# used locally in development to test mozharness changes:
#
@ -17,18 +26,13 @@ if [ ! -d mozharness ]; then
tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV
fi
OBJDIR="$HOME/object-folder"
if [ ! -d $OBJDIR ]; then
mkdir -p $OBJDIR
fi
# Figure out where the remote manifest is so we can use caches for it.
MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)
tc-vcs repo-checkout $OBJDIR/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
# Ensure we update gecko prior to invoking mozharness so commits match up
# initially between manifest and gecko tree...
pull-gecko.sh $OBJDIR/B2G/gecko
tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
# Ensure symlink has been created to gecko...
rm -f $WORKSPACE/B2G/gecko
ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
debug_flag=""
if [ 0$B2G_DEBUG -ne 0 ]; then
@ -39,7 +43,7 @@ fi
--config b2g/taskcluster-emulator.py \
"$debug_flag" \
--disable-mock \
--work-dir=$OBJDIR/B2G \
--work-dir=$WORKSPACE/B2G \
--log-level=debug \
--target=$TARGET \
--b2g-config-dir=$TARGET \
@ -48,10 +52,15 @@ fi
--repo=$GECKO_HEAD_REPOSITORY
# Move files into artifact locations!
mkdir -p artifacts
mkdir -p $HOME/artifacts
mv $OBJDIR/B2G/sources.xml artifacts/sources.xml
mv $OBJDIR/B2G/out/target/product/generic/tests/gaia-tests.zip artifacts/gaia-tests.zip
mv $OBJDIR/B2G/out/target/product/generic/tests/b2g-*.zip artifacts/b2g-tests.zip
mv $OBJDIR/B2G/out/emulator.tar.gz artifacts/emulator.tar.gz
mv $OBJDIR/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip artifacts/b2g-crashreporter-symbols.zip
ls -lah $WORKSPACE/B2G/out
ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
mv $WORKSPACE/B2G/out/target/product/generic/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
mv $WORKSPACE/B2G/out/target/product/generic/tests/b2g-*.zip $HOME/artifacts/b2g-tests.zip
mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
ccache -s

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

@ -1,21 +1,13 @@
#!/bin/bash -live
#!/bin/bash -ex
################################### build-mulet-linux.sh ###################################
# Ensure all the scripts in this dir are on the path....
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PATH=$DIRNAME:$PATH
. build-setup.sh
. desktop-setup.sh
### Check that require variables are defined
test $MOZCONFIG
# Ensure gecko is at the correct revision
pull-gecko.sh $gecko_dir
### Install package dependencies
install-packages.sh $gecko_dir
export MOZ_OBJDIR=$(get-objdir.py $gecko_dir)
cd $gecko_dir
cd $GECKO_DIR
./mach build;
### Make package
@ -28,18 +20,19 @@ cd $MOZ_OBJDIR/dist;
ls -lah $MOZ_OBJDIR/dist/
# Target names are cached so make sure we discard them first if found.
rm -f target.linux-x86_64.tar.bz2 target.linux-x86_64.json target.tests.zip
# Artifacts folder is outside of the cache.
mkdir -p /home/worker/artifacts/
mkdir -p $HOME/artifacts/
# Discard version numbers from packaged files, they just make it hard to write
# the right filename in the task payload where artifacts are declared
mv *.linux-x86_64.tar.bz2 /home/worker/artifacts/target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json /home/worker/artifacts/target.linux-x86_64.json
mv *.tests.zip /home/worker/artifacts/target.tests.zip
mv jsshell-linux-x86_64.zip /home/worker/artifacts/jsshell-linux-x86_64.zip
mv *.linux-x86_64.tar.bz2 $HOME/artifacts/target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json $HOME/artifacts/target.linux-x86_64.json
mv *.tests.zip $HOME/artifacts/target.tests.zip
mv jsshell-linux-x86_64.zip $HOME/artifacts/jsshell-linux-x86_64.zip
ccache -s
################################### build.sh ###################################

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

@ -0,0 +1,24 @@
#!/bin/bash -ex
test $MOZCONFIG # mozconfig is required...
test -d $1 # workspace must exist at this point...
WORKSPACE=$( cd "$1" && pwd )
. setup-ccache.sh
# Gecko source:
export GECKO_DIR=$WORKSPACE/gecko
# Gaia source:
export GAIA_DIR=$WORKSPACE/gaia
# Mozbuild config:
export MOZBUILD_STATE_PATH=$WORKSPACE/mozbuild/
# Create .mozbuild so mach doesn't complain about this
mkdir -p $MOZBUILD_STATE_PATH
### Install package dependencies
install-packages.sh $GECKO_DIR
# Ensure object-folder exists
export MOZ_OBJDIR=$(get-objdir.py $GECKO_DIR $WORKSPACE/object-folder/)
mkdir -p $MOZ_OBJDIR

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

@ -7,8 +7,6 @@ import json
import subprocess
from StringIO import StringIO
DEFAULT_OBJDIR = "/home/worker/object-folder"
gecko_dir = sys.argv[1]
os.chdir(gecko_dir)
@ -17,6 +15,6 @@ environment = json.load(StringIO(result))
topobjdir = environment["mozconfig"]["topobjdir"]
if topobjdir is None:
topobjdir = DEFAULT_OBJDIR
topobjdir = sys.argv[2]
print(topobjdir)

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

@ -0,0 +1,9 @@
#! /bin/bash -ex
test -d $1 # workspace must exist at this point...
WORKSPACE=$( cd "$1" && pwd )
export CCACHE_DIR=$WORKSPACE/ccache
ccache -M 12G
ccache -s

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

@ -0,0 +1,9 @@
#! /bin/bash -ex
# This script copies the contents of the "scripts" folder into a docker
# container using tar/untar the container id must be passed.
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
docker exec $1 mkdir -p $2
cd $DIRNAME
tar -cv * | docker exec -i $1 tar -x -C $2

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

@ -167,9 +167,14 @@ def parse_commit(message, jobs):
# shlex used to ensure we split correctly when giving values to argparse.
parts = shlex.split(message)
try_idx = None
for idx, part in enumerate(parts):
if part == TRY_DELIMITER:
try_idx = idx
break
if parts[0] != TRY_DELIMITER:
raise InvalidCommitException('Invalid commit format must start with' +
if try_idx is None:
raise InvalidCommitException('Invalid commit format contain ' +
TRY_DELIMITER)
# Argument parser based on try flag flags
@ -177,7 +182,7 @@ def parse_commit(message, jobs):
parser.add_argument('-b', dest='build_types')
parser.add_argument('-p', nargs='?', dest='platforms', const='all', default='all')
parser.add_argument('-u', nargs='?', dest='tests', const='all', default='all')
args, unknown = parser.parse_known_args(parts[1:])
args, unknown = parser.parse_known_args(parts[try_idx:])
# Then builds...
if args.build_types is None:

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

@ -6,22 +6,19 @@ task:
description: B2G Desktop {{build_type}}
workerType: b2gbuild-desktop
scopes:
- 'docker-worker:cache:sources-gecko'
- 'docker-worker:cache:sources-gaia'
payload:
cache:
sources-gaia: '/home/worker/gaia'
sources-gecko: '/home/worker/gecko'
env:
MOZCONFIG: 'b2g/config/mozconfigs/linux64_gecko/nightly'
MOZTT_GIT_URL: '{{moztt_git_url}}'
MOZTT_REVISION: '{{moztt_revision}}'
command:
- bin/build-b2g-desktop.sh
- /bin/bash
- -c
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/builder &&
buildbot_step 'Build' ./build-b2g-desktop.sh $HOME/workspace
extra:
treeherder:

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

@ -5,11 +5,7 @@ $inherits:
task:
scopes:
- 'docker-worker:cache:build-b2g-desktop-objects-debug'
payload:
cache:
build-b2g-desktop-objects-debug: '/home/worker/object-folder'
- 'docker-worker:cache:workspace-b2g-desktop-objects-debug'
extra:
treeherder:
@ -17,5 +13,7 @@ task:
debug: true
payload:
cache:
workspace-b2g-desktop-objects-debug: '/home/worker/workspace'
env:
MOZCONFIG: 'b2g/config/mozconfigs/linux64_gecko/debug'

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

@ -5,12 +5,11 @@ $inherits:
task:
scopes:
- 'docker-worker:cache:build-b2g-desktop-objects-opt'
- 'docker-worker:cache:workspace-b2g-desktop-objects-opt'
payload:
cache:
build-b2g-desktop-objects-opt: '/home/worker/object-folder'
workspace-b2g-desktop-objects-opt: '/home/worker/workspace'
payload:
env:
MOZCONFIG: 'b2g/config/mozconfigs/linux64_gecko/nightly'

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

@ -14,7 +14,12 @@ task:
maxRunTime: 14400
command:
- build-emulator.sh
- /bin/bash
- -c
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/builder &&
buildbot_step 'Build' ./build-emulator.sh $HOME/workspace
extra:
# Rather then enforcing particular conventions we require that all build

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-ics-debug
scopes:
- 'docker-worker:cache:build-emulator-ics-debug'
- 'docker-worker:cache:workspace-emulator-ics-debug'
metadata:
name: '[TC] B2G Emulator ICS Debug'
extra:
@ -16,7 +16,7 @@ task:
payload:
cache:
build-emulator-ics-debug: /home/worker/object-folder
workspace-emulator-ics-debug: /home/worker/workspace
env:
TARGET: 'emulator'
B2G_DEBUG: 1

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-ics
scopes:
- 'docker-worker:cache:build-emulator-ics-opt'
- 'docker-worker:cache:workspace-emulator-ics-opt'
metadata:
name: '[TC] B2G Emulator ICS Opt'
@ -14,7 +14,7 @@ task:
payload:
cache:
build-emulator-ics-opt: /home/worker/object-folder/
workspace-emulator-ics-opt: /home/worker/workspace
env:
TARGET: 'emulator'

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-jb-debug
scopes:
- 'docker-worker:cache:build-emulator-jb-debug'
- 'docker-worker:cache:workspace-emulator-jb-debug'
metadata:
name: '[TC] B2G Emulator JB Debug'
@ -16,7 +16,7 @@ task:
payload:
cache:
build-emulator-jb-debug: /home/worker/object-folder
workspace-emulator-jb-debug: /home/worker/workspace
env:
TARGET: 'emulator-jb'
B2G_DEBUG: 1

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-jb
scopes:
- 'docker-worker:cache:build-emulator-jb-opt'
- 'docker-worker:cache:workspace-emulator-jb-opt'
metadata:
name: '[TC] B2G JB Emulator Opt'
@ -14,6 +14,6 @@ task:
payload:
cache:
build-emulator-jb-opt: /home/worker/object-folder
workspace-emulator-jb-opt: /home/worker/workspace
env:
TARGET: 'emulator-jb'

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-kk-debug
scopes:
- 'docker-worker:cache:build-emulator-kk-debug'
- 'docker-worker:cache:workspace-emulator-kk-debug'
metadata:
name: '[TC] B2G Emulator KK Debug'
@ -16,7 +16,7 @@ task:
payload:
cache:
build-emulator-jb-debug: /home/worker/object-folder
workspace-emulator-kk-debug: /home/worker/workspace
env:
TARGET: 'emulator-kk'
B2G_DEBUG: 1

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

@ -3,7 +3,7 @@ $inherits:
task:
workerType: emulator-kk
scopes:
- 'docker-worker:cache:build-emulator-kk-opt'
- 'docker-worker:cache:workspace-emulator-kk-opt'
metadata:
name: '[TC] B2G KK Emulator Opt'
@ -14,7 +14,7 @@ task:
payload:
cache:
build-emulator-kk-opt: /home/worker/object-folder
workspace-emulator-kk-opt: /home/worker/workspace
env:
TARGET: 'emulator-kk'

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

@ -13,6 +13,7 @@ task:
maxRunTime: 14400
command:
- with_workspace
- build-phone.sh
extra:

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

@ -7,14 +7,12 @@ task:
workerType: b2gbuild-desktop
scopes:
- 'docker-worker:cache:sources-gecko'
- 'docker-worker:cache:build-mulet-linux-objects'
- 'docker-worker:cache:build-mulet-linux-workspace'
- 'docker-worker:cache:tooltool-cache'
payload:
cache:
sources-gecko: '/home/worker/gecko'
build-mulet-linux-objects: '/home/worker/object-folder'
build-mulet-linux-workspace: '/home/worker/workspace'
tooltool-cache: '/home/worker/tools/tooltool-cache'
env:
@ -23,7 +21,12 @@ task:
maxRunTime: 3600
command:
- bin/build-mulet-linux.sh
- /bin/bash
- -c
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/builder &&
buildbot_step 'Build' ./build-mulet-linux.sh $HOME/workspace
extra:
treeherder:

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

@ -52,11 +52,12 @@ tasks:
# The taskcluster-vcs tooling stores the large clone caches in this
# directory and will reuse them for new requests this saves about 20s~ and
# is the most generic cache possible.
tc-vcs-public-sources: '/home/worker/.tc-vcs/'
tc-vcs-public-sources: /home/worker/.tc-vcs/
gecko-decision: /home/worker/workspace
# Note: This task is built server side without the context or tooling that
# exist in tree so we must hard code the version
image: 'quay.io/mozilla/decision:0.0.3'
image: 'quay.io/mozilla/builder:0.5.0'
# Virtually no network or other potentially risky operations happen as part
# of the task timeout aside from the initial clone. We intentionally have
@ -68,7 +69,8 @@ tasks:
- /bin/bash
- -cx
- >
source $(which entrypoint) &&
checkout-gecko workspace &&
cd workspace/gecko &&
./mach taskcluster-graph
--project='{{project}}'
--message='{{comment}}'

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

@ -80,6 +80,44 @@ class TestCommitParser(unittest.TestCase):
result = parse_commit(commit, jobs)
self.assertEqual(expected, result)
def test_try_flag_in_middle_of_commit(self):
'''
The try command prefix may appear anywhere this test ensures that it
works in some common cases.
'''
commit = 'Bug XXX - I like cheese try: -b o -p all -u none wootbar'
jobs = {
'flags': {
'builds': ['linux', 'linux64'],
'tests': ['web-platform-tests'],
},
'builds': {
'linux': {
'types': {
'opt': {
'task': 'task/linux',
},
'debug': {
'task': 'task/linux-debug'
}
}
},
},
'tests': {}
}
expected = [
{
'task': 'task/linux',
'dependents': [],
'additional-parameters': {}
}
]
result = parse_commit(commit, jobs)
self.assertEqual(expected, result)
def test_commit_all_builds_no_tests(self):
'''
This test covers the case of all builds but no tests passed -u none