Bug 943234 - Part 2: update test cases. r=vicamo
author"allstars.chh" <allstars.chh@gmail.com>
Thu, 28 Nov 2013 17:01:44 +0800
changeset 172744 e607d1aa8a2a4bd8cbbabc248740a26b5900da8f
parent 172743 3212475bd9086e49cf4f6fda47b872016348afcd
child 172745 aa11917697b989fe0dc6de2bed4b87edee3d93a8
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs943234
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 943234 - Part 2: update test cases. r=vicamo From fb153186a90d3045d71176e025201ce4a14c2c9b Mon Sep 17 00:00:00 2001 --- dom/icc/tests/marionette/test_icc_contact.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
dom/icc/tests/marionette/test_icc_contact.js
--- a/dom/icc/tests/marionette/test_icc_contact.js
+++ b/dom/icc/tests/marionette/test_icc_contact.js
@@ -1,36 +1,38 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 MARIONETTE_HEAD_JS = "icc_header.js";
 
+const EMULATOR_ICCID = "89014103211118510720";
+
 function testReadContacts(type) {
   let request = icc.readContacts(type);
   request.onsuccess = function onsuccess() {
     let contacts = request.result;
 
     is(Array.isArray(contacts), true);
 
     is(contacts[0].name[0], "Mozilla");
     is(contacts[0].tel[0].value, "15555218201");
-    is(contacts[0].id, "890141032111185107201");
+    is(contacts[0].id, EMULATOR_ICCID + "1");
 
     is(contacts[1].name[0], "Saßê黃");
     is(contacts[1].tel[0].value, "15555218202");
-    is(contacts[1].id, "890141032111185107202");
+    is(contacts[1].id, EMULATOR_ICCID + "2");
 
     is(contacts[2].name[0], "Fire 火");
     is(contacts[2].tel[0].value, "15555218203");
-    is(contacts[2].id, "890141032111185107203");
+    is(contacts[2].id, EMULATOR_ICCID + "3");
 
     is(contacts[3].name[0], "Huang 黃");
     is(contacts[3].tel[0].value, "15555218204");
-    is(contacts[3].id, "890141032111185107204");
+    is(contacts[3].id, EMULATOR_ICCID + "4");
 
     taskHelper.runNext();
   };
 
   request.onerror = function onerror() {
     ok(false, "Cannot get " + type + " contacts");
     taskHelper.runNext();
   };
@@ -41,16 +43,21 @@ function testAddContact(type, pin2) {
     name: ["add"],
     tel: [{value: "0912345678"}],
     email:[]
   });
 
   let updateRequest = icc.updateContact(type, contact, pin2);
 
   updateRequest.onsuccess = function onsuccess() {
+    let updatedContact = updateRequest.result;
+    ok(updatedContact, "updateContact should have retuend a mozContact.");
+    ok(updatedContact.id.startsWith(EMULATOR_ICCID),
+       "The returned mozContact has wrong id.");
+
     // Get ICC contact for checking new contact
 
     let getRequest = icc.readContacts(type);
 
     getRequest.onsuccess = function onsuccess() {
       let contacts = getRequest.result;
 
       // There are 4 SIM contacts which are harded in emulator