From 4d62306ff08e53805b9e3134ebf450c747e51955 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Thu, 5 Jun 2014 10:06:28 +0800 Subject: [PATCH] Bug 1020108: use DOMTimestamp in MozCellBroadcastMessage. r=gene --- .../interfaces/nsIDOMMozCellBroadcastMessage.idl | 5 +++-- .../tests/marionette/test_cellbroadcast_etws.js | 2 +- dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js | 2 +- dom/system/gonk/RILContentHelper.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dom/cellbroadcast/interfaces/nsIDOMMozCellBroadcastMessage.idl b/dom/cellbroadcast/interfaces/nsIDOMMozCellBroadcastMessage.idl index 6d1e1d338bb7..cdbf57b0e3d0 100644 --- a/dom/cellbroadcast/interfaces/nsIDOMMozCellBroadcastMessage.idl +++ b/dom/cellbroadcast/interfaces/nsIDOMMozCellBroadcastMessage.idl @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "domstubs.idl" #include "nsISupports.idl" interface nsIDOMMozCellBroadcastEtwsInfo; @@ -10,7 +11,7 @@ interface nsIDOMMozCellBroadcastEtwsInfo; * MozCellBroadcastMessage encapsulates Cell Broadcast short message service * (CBS) messages. */ -[scriptable, uuid(6abe65de-6729-41f7-906a-3f3a2dbe30ae)] +[scriptable, uuid(701e74a9-5fc4-4e2d-a324-9b7693395159)] interface nsIDOMMozCellBroadcastMessage : nsISupports { /** @@ -53,7 +54,7 @@ interface nsIDOMMozCellBroadcastMessage : nsISupports /** * System time stamp at receival. */ - readonly attribute jsval timestamp; // jsval is for Date. + readonly attribute DOMTimeStamp timestamp; /** * Additional ETWS-specific info. diff --git a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js index 68921c283ea3..f08daec368c7 100644 --- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js +++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js @@ -196,7 +196,7 @@ function testReceiving_ETWS_Timestamp() { doTestHelper(pdu, testReceiving_ETWS_WarningType, function(message) { // Cell Broadcast messages do not contain a timestamp field (however, ETWS // does). We only check the timestamp doesn't go too far (60 seconds) here. - let msMessage = message.timestamp.getTime(); + let msMessage = message.timestamp; let msNow = Date.now(); ok(Math.abs(msMessage - msNow) < (1000 * 60), "message.timestamp"); }); diff --git a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js index 69e1ee471200..9d9aec2b7c3c 100644 --- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js +++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js @@ -361,7 +361,7 @@ function testReceiving_GSM_Timestamp() { doTestHelper(pdu, testReceiving_GSM_WarningType, function(message) { // Cell Broadcast messages do not contain a timestamp field (however, ETWS // does). We only check the timestamp doesn't go too far (60 seconds) here. - let msMessage = message.timestamp.getTime(); + let msMessage = message.timestamp; let msNow = Date.now(); ok(Math.abs(msMessage - msNow) < (1000 * 60), "message.timestamp"); }); diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index 19ef2cd9b791..4cc9435eec7b 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -312,7 +312,7 @@ function CellBroadcastMessage(pdu) { this.language = pdu.language; this.body = pdu.fullBody; this.messageClass = pdu.messageClass; - this.timestamp = new Date(pdu.timestamp); + this.timestamp = pdu.timestamp; if (pdu.etws != null) { this.etws = new CellBroadcastEtwsInfo(pdu.etws);