Bug 909669 - Part 2: Change error code to InvalidParameter (ril, test). r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Wed, 04 Sep 2013 08:30:44 -0400
changeset 158444 c8c55f0fbd7411b250a6aba052a6e9571667ef66
parent 158443 3cb18fbc1eff5248c0399858e0b0b55faa5f120c
child 158445 13ae92616a188e6a26201b75b1adccde6077981f
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs909669
milestone26.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 909669 - Part 2: Change error code to InvalidParameter (ril, test). r=hsinyi
dom/network/tests/marionette/test_call_barring_set_error.js
dom/system/gonk/RILContentHelper.js
--- a/dom/network/tests/marionette/test_call_barring_set_error.js
+++ b/dom/network/tests/marionette/test_call_barring_set_error.js
@@ -48,17 +48,17 @@ function buildOption(program, enabled, p
 function testSetCallBarringOptionError(option) {
   let request = connection.setCallBarringOption(option);
   request.onsuccess = function() {
     ok(false,
        'should not fire onsuccess for invaild call barring option: '
        + JSON.stringify(option));
   };
   request.onerror = function(event) {
-    is(event.target.error.name, 'InvalidCallBarringOption', JSON.stringify(option));
+    is(event.target.error.name, 'InvalidParameter', JSON.stringify(option));
     nextTest();
   };
 }
 
 function nextTest() {
   if (caseId >= options.length) {
     cleanUp();
   } else {
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -638,17 +638,18 @@ RILContentHelper.prototype = {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!mode) {
-      this.dispatchFireRequestError(requestId, "InvalidParameter");
+      this.dispatchFireRequestError(requestId,
+                                    RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:SetRoamingPreference", {
       clientId: 0,
       data: {
         requestId: requestId,
         mode: mode
@@ -1001,17 +1002,18 @@ RILContentHelper.prototype = {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!this._isValidCFReason(reason)){
-      this.dispatchFireRequestError(requestId, "Invalid call forwarding reason.");
+      this.dispatchFireRequestError(requestId,
+                                    RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:GetCallForwardingOption", {
       clientId: 0,
       data: {
         requestId: requestId,
         reason: reason
@@ -1027,17 +1029,18 @@ RILContentHelper.prototype = {
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!cfInfo ||
         !this._isValidCFReason(cfInfo.reason) ||
         !this._isValidCFAction(cfInfo.action)){
-      this.dispatchFireRequestError(requestId, "Invalid call forwarding rule definition.");
+      this.dispatchFireRequestError(requestId,
+                                    RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:SetCallForwardingOption", {
       clientId: 0,
       data: {
         requestId: requestId,
         active: cfInfo.active,
@@ -1056,17 +1059,18 @@ RILContentHelper.prototype = {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (DEBUG) debug("getCallBarringOption: " + JSON.stringify(option));
     if (!this._isValidCallBarringOption(option)) {
-      this.dispatchFireRequestError(requestId, "InvalidCallBarringOption");
+      this.dispatchFireRequestError(requestId,
+                                    RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:GetCallBarringOption", {
       clientId: 0,
       data: {
         requestId: requestId,
         program: option.program,
@@ -1082,17 +1086,18 @@ RILContentHelper.prototype = {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option));
     if (!this._isValidCallBarringOption(option, true)) {
-      this.dispatchFireRequestError(requestId, "InvalidCallBarringOption");
+      this.dispatchFireRequestError(requestId,
+                                    RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:SetCallBarringOption", {
       clientId: 0,
       data: {
         requestId: requestId,
         program: option.program,