Bug 819862 - Adding SIM path for EF_SPDI and corresponding test. r=vicamo
authorPatrick Wang <kk1fff@patrickz.net>
Mon, 10 Dec 2012 14:46:22 +0800
changeset 116037 d78361a315b31b2251d668448c6797d929a6acf8
parent 116036 d72d915e308b65b4cf4a726d3aee0cc74f651f84
child 116038 7e94ee1930f4032161d1988905b06ba057e1b8f1
push id24034
push useremorley@mozilla.com
push dateFri, 14 Dec 2012 15:28:57 +0000
treeherdermozilla-central@50d8f411d305 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs819862
milestone20.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 819862 - Adding SIM path for EF_SPDI and corresponding test. r=vicamo
dom/system/gonk/ril_worker.js
dom/system/gonk/tests/test_ril_worker_icc.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -3850,16 +3850,17 @@ let RIL = {
           case ICC_EF_FDN:
           case ICC_EF_MSISDN:
             return EF_PATH_MF_SIM + EF_PATH_DF_TELECOM;
 
           case ICC_EF_AD:
           case ICC_EF_MBDN:
           case ICC_EF_PLMNsel:
           case ICC_EF_SPN:
+          case ICC_EF_SPDI:
           case ICC_EF_SST:
           case ICC_EF_CBMI:
           case ICC_EF_CBMIR:
             return EF_PATH_MF_SIM + EF_PATH_DF_GSM;
         }
       case CARD_APPTYPE_USIM:
         switch (fileId) {
           case ICC_EF_AD:
--- a/dom/system/gonk/tests/test_ril_worker_icc.js
+++ b/dom/system/gonk/tests/test_ril_worker_icc.js
@@ -832,8 +832,43 @@ add_test(function test_stk_proactive_com
   ctlvs = berTlv.value;
   tlv = stkHelper.searchForTag(COMPREHENSIONTLV_TAG_COMMAND_DETAILS, ctlvs);
   do_check_eq(tlv.value.commandNumber, 0x01);
   do_check_eq(tlv.value.typeOfCommand, STK_CMD_PROVIDE_LOCAL_INFO);
   do_check_eq(tlv.value.commandQualifier, STK_LOCAL_INFO_DATE_TIME_ZONE);
 
   run_next_test();
 });
+
+add_test(function test_path_id_for_spid_and_spn() {
+  let RIL = newWorker({
+    postRILMessage: function fakePostRILMessage(data) {
+      // Do nothing
+    },
+    postMessage: function fakePostMessage(message) {
+      // Do nothing
+    }
+  }).RIL;
+
+  // Test SIM
+  RIL.iccStatus = {
+    gsmUmtsSubscriptionAppIndex: 0,
+    apps: [
+      {
+        app_type: CARD_APPTYPE_SIM
+      }, {
+        app_type: CARD_APPTYPE_USIM
+      }
+    ]
+  }
+  do_check_eq(RIL._getPathIdForICCRecord(ICC_EF_SPDI),
+              EF_PATH_MF_SIM + EF_PATH_DF_GSM);
+  do_check_eq(RIL._getPathIdForICCRecord(ICC_EF_SPN),
+              EF_PATH_MF_SIM + EF_PATH_DF_GSM);
+
+  // Test USIM
+  RIL.iccStatus.gsmUmtsSubscriptionAppIndex = 1;
+  do_check_eq(RIL._getPathIdForICCRecord(ICC_EF_SPDI),
+              EF_PATH_MF_SIM + EF_PATH_ADF_USIM);
+  do_check_eq(RIL._getPathIdForICCRecord(ICC_EF_SPDI),
+              EF_PATH_MF_SIM + EF_PATH_ADF_USIM);
+  run_next_test();
+});
\ No newline at end of file