Bug 935402 - Part 2: Modify xpcshell test for EF_PBR. r=yoshi
authorGeorgia Wang <gwang@mozilla.com>
Mon, 18 Nov 2013 15:06:58 +0800
changeset 173911 ec7986792a8af4ff90c8db9b0d2cd065e9e695df
parent 173910 89efaaa671a1f36a3f8f5690a5e09e60a2561973
child 173912 8fe38055e41a88cdab12cb90c866299f014e08e5
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoshi
bugs935402
milestone28.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 935402 - Part 2: Modify xpcshell test for EF_PBR. r=yoshi
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
@@ -896,17 +896,17 @@ add_test(function test_load_linear_fixed
  */
 add_test(function test_read_pbr() {
   let worker = newUint8Worker();
   let helper = worker.GsmPDUHelper;
   let record = worker.ICCRecordHelper;
   let buf    = worker.Buf;
   let io     = worker.ICCIOHelper;
 
-  io.loadLinearFixedEF = function fakeLoadLinearFixedEF(options)  {
+  io.loadLinearFixedEF = function fakeLoadLinearFixedEF(options) {
     let pbr_1 = [
       0xa8, 0x05, 0xc0, 0x03, 0x4f, 0x3a, 0x01
     ];
 
     // Write data size
     buf.writeInt32(pbr_1.length * 2);
 
     // Write pbr
@@ -932,26 +932,34 @@ add_test(function test_read_pbr() {
     if (options.callback) {
       options.callback(options);
     }
   };
 
   let successCb = function successCb(pbrs) {
     do_check_eq(pbrs[0].adn.fileId, 0x4f3a);
     do_check_eq(pbrs.length, 1);
-    run_next_test();
   };
 
   let errorCb = function errorCb(errorMsg) {
     do_print("Reading EF_PBR failed, msg = " + errorMsg);
     do_check_true(false);
-    run_next_test();
   };
 
   record.readPBR(successCb, errorCb);
+
+  // Check cache pbrs when 2nd call
+  let ifLoadEF = false;
+  io.loadLinearFixedEF = function fakeLoadLinearFixedEF(options)  {
+    ifLoadEF = true;
+  }
+  record.readPBR(successCb, errorCb);
+  do_check_false(ifLoadEF);
+
+  run_next_test();
 });
 
 /**
  * Verify ICCRecordHelper.readEmail
  */
 add_test(function test_read_email() {
   let worker = newUint8Worker();
   let helper = worker.GsmPDUHelper;