Bug 791934 - Part 3: xpcshell tests for STK_SET_PROFILE. r=vicamo
authorYoshi Huang <allstars.chh@mozilla.com>
Fri, 09 Nov 2012 11:11:32 -0800
changeset 113473 1319ef8226c0456be0fbc43c1a72353d79f779f6
parent 113472 2811784164b7092d29ebc63fc9c5804df08448d4
child 113474 2c17533a4c275d303bae48f6659623ae4983cf58
push id18167
push useryhuang@mozilla.com
push dateFri, 16 Nov 2012 03:41:17 +0000
treeherdermozilla-inbound@1319ef8226c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs791934
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 791934 - Part 3: xpcshell tests for STK_SET_PROFILE. r=vicamo
dom/system/gonk/tests/test_ril_worker_icc.js
--- a/dom/system/gonk/tests/test_ril_worker_icc.js
+++ b/dom/system/gonk/tests/test_ril_worker_icc.js
@@ -138,16 +138,36 @@ add_test(function test_is_icc_service_av
   test_table([0x08], "ADN", true, false);
   test_table([0x08], "FDN", false, false);
   test_table([0x08], "SDN", false, true);
 
   run_next_test();
 });
 
 /**
+ * Verify RIL.sendStkTerminalProfile
+ */
+add_test(function test_send_stk_terminal_profile() {
+  let worker = newUint8Worker();
+  let ril = worker.RIL;
+  let buf = worker.Buf;
+
+  ril.sendStkTerminalProfile(STK_SUPPORTED_TERMINAL_PROFILE);
+
+  buf.seekIncoming(8);
+  let profile = buf.readString();
+  for (let i = 0; i < STK_SUPPORTED_TERMINAL_PROFILE.length; i++) {
+    do_check_eq(parseInt(profile.substring(2 * i, 2 * i + 2), 16),
+                STK_SUPPORTED_TERMINAL_PROFILE[i]);
+  }
+
+  run_next_test();
+});
+
+/**
  * Verify ComprehensionTlvHelper.writeLocationInfoTlv
  */
 add_test(function test_write_location_info_tlv() {
   let worker = newUint8Worker();
   let pduHelper = worker.GsmPDUHelper;
   let tlvHelper = worker.ComprehensionTlvHelper;
 
   // Test with 2-digit mnc, and gsmCellId obtained from UMTS network.