Bug 792335 - Part 2: Test cases for writeDiallingNumber. r=vicamo
authorYoshi Huang <allstars.chh@mozilla.com>
Wed, 19 Sep 2012 16:29:03 +0800
changeset 107605 21aafe9919fb75fb6b5d0404e56c7f0700b94b55
parent 107604 b9ffd93748077c128e86574fb15b26a80ad9571d
child 107606 376d08b69d82dc843f6c603f5450471b1d8a6ed5
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersvicamo
bugs792335
milestone18.0a1
Bug 792335 - Part 2: Test cases for writeDiallingNumber. 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
@@ -109,8 +109,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 writeDiallingNumber
+ */
+add_test(function test_write_dialling_number() {
+  let worker = newUint8Worker();
+  let helper = worker.GsmPDUHelper;
+
+  // with +
+  let number = "+123456";
+  let len = 4;
+  helper.writeDiallingNumber(number);
+  do_check_eq(helper.readDiallingNumber(len), number);
+
+  // without +
+  number = "987654";
+  len = 4;
+  helper.writeDiallingNumber(number);
+  do_check_eq(helper.readDiallingNumber(len), number);
+
+  number = "9876543";
+  len = 5;
+  helper.writeDiallingNumber(number);
+  do_check_eq(helper.readDiallingNumber(len), number);
+
+  run_next_test();
+});
+