From 2c29d3aeb86cc64515fecbc5d688c98dae5a6f46 Mon Sep 17 00:00:00 2001
From: Jamin Liu
Date: Tue, 8 Jul 2014 14:57:01 +0800
Subject: [PATCH 01/67] Bug 1006317 - Write a marionette test for BT on/off
based on bluetooth API v2. r=btian
---
dom/bluetooth2/tests/marionette/head.js | 118 +++++++++++++++++-
dom/bluetooth2/tests/marionette/manifest.ini | 1 +
.../test_dom_BluetoothAdapter_enable_API2.js | 76 +++++++++++
3 files changed, 192 insertions(+), 3 deletions(-)
create mode 100644 dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js
diff --git a/dom/bluetooth2/tests/marionette/head.js b/dom/bluetooth2/tests/marionette/head.js
index eeb7071b95c..d73176f53b0 100644
--- a/dom/bluetooth2/tests/marionette/head.js
+++ b/dom/bluetooth2/tests/marionette/head.js
@@ -342,7 +342,7 @@ function setBluetoothEnabled(aEnabled) {
/**
* Wait for one named BluetoothManager event.
*
- * Resolve if that named event occurs. Never reject.
+ * Resolve if that named event occurs. Never reject.
*
* Fulfill params: the DOMEvent passed.
*
@@ -367,7 +367,7 @@ function waitForManagerEvent(aEventName) {
/**
* Wait for one named BluetoothAdapter event.
*
- * Resolve if that named event occurs. Never reject.
+ * Resolve if that named event occurs. Never reject.
*
* Fulfill params: the DOMEvent passed.
*
@@ -391,6 +391,118 @@ function waitForAdapterEvent(aAdapter, aEventName) {
return deferred.promise;
}
+/**
+ * Wait for 'onattributechanged' events for state changes of BluetoothAdapter
+ * with specified order.
+ *
+ * Resolve if those expected events occur in order. Never reject.
+ *
+ * Fulfill params: an array which contains every changed attributes during
+ * the waiting.
+ *
+ * @param aAdapter
+ * The BluetoothAdapter you want to use.
+ * @param aStateChangesInOrder
+ * An array which contains an expected order of BluetoothAdapterState.
+ * Example 1: [enabling, enabled]
+ * Example 2: [disabling, disabled]
+ *
+ * @return A deferred promise.
+ */
+function waitForAdapterStateChanged(aAdapter, aStateChangesInOrder) {
+ let deferred = Promise.defer();
+
+ let stateIndex = 0;
+ let prevStateIndex = 0;
+ let statesArray = [];
+ let changedAttrs = [];
+ aAdapter.onattributechanged = function(aEvent) {
+ for (let i in aEvent.attrs) {
+ changedAttrs.push(aEvent.attrs[i]);
+ switch (aEvent.attrs[i]) {
+ case "state":
+ log(" 'state' changed to " + aAdapter.state);
+
+ // Received state change order may differ from expected one even though
+ // state changes in expected order, because the value of state may change
+ // again before we receive prior 'onattributechanged' event.
+ //
+ // For example, expected state change order [A,B,C] may result in
+ // received ones:
+ // - [A,C,C] if state becomes C before we receive 2nd 'onattributechanged'
+ // - [B,B,C] if state becomes B before we receive 1st 'onattributechanged'
+ // - [C,C,C] if state becomes C before we receive 1st 'onattributechanged'
+ // - [A,B,C] if all 'onattributechanged' are received in perfect timing
+ //
+ // As a result, we ensure only following conditions instead of exactly
+ // matching received and expected state change order.
+ // - Received state change order never reverse expected one. For example,
+ // [B,A,C] should never occur with expected state change order [A,B,C].
+ // - The changed value of state in received state change order never
+ // appears later than that in expected one. For example, [A,A,C] should
+ // never occur with expected state change order [A,B,C].
+ let stateIndex = aStateChangesInOrder.indexOf(aAdapter.state);
+ if (stateIndex >= prevStateIndex && stateIndex + 1 > statesArray.length) {
+ statesArray.push(aAdapter.state);
+ prevStateIndex = stateIndex;
+
+ if (statesArray.length == aStateChangesInOrder.length) {
+ aAdapter.onattributechanged = null;
+ ok(true, "BluetoothAdapter event 'onattributechanged' got.");
+ deferred.resolve(changedAttrs);
+ }
+ } else {
+ ok(false, "The order of 'onattributechanged' events is unexpected.");
+ }
+
+ break;
+ case "name":
+ log(" 'name' changed to " + aAdapter.name);
+ if (aAdapter.state == "enabling") {
+ isnot(aAdapter.name, "", "adapter.name");
+ }
+ else if (aAdapter.state == "disabling") {
+ is(aAdapter.name, "", "adapter.name");
+ }
+ break;
+ case "address":
+ log(" 'address' changed to " + aAdapter.address);
+ if (aAdapter.state == "enabling") {
+ isnot(aAdapter.address, "", "adapter.address");
+ }
+ else if (aAdapter.state == "disabling") {
+ is(aAdapter.address, "", "adapter.address");
+ }
+ break;
+ case "discoverable":
+ log(" 'discoverable' changed to " + aAdapter.discoverable);
+ if (aAdapter.state == "enabling") {
+ is(aAdapter.discoverable, true, "adapter.discoverable");
+ }
+ else if (aAdapter.state == "disabling") {
+ is(aAdapter.discoverable, false, "adapter.discoverable");
+ }
+ break;
+ case "discovering":
+ log(" 'discovering' changed to " + aAdapter.discovering);
+ if (aAdapter.state == "enabling") {
+ is(aAdapter.discovering, true, "adapter.discovering");
+ }
+ else if (aAdapter.state == "disabling") {
+ is(aAdapter.discovering, false, "adapter.discovering");
+ }
+ break;
+ case "unknown":
+ default:
+ ok(false, "Unknown attribute '" + aEvent.attrs[i] + "' changed." );
+ break;
+ }
+ }
+ };
+
+ return deferred.promise;
+}
+
/**
* Flush permission settings and call |finish()|.
*/
@@ -417,7 +529,7 @@ function startBluetoothTestBase(aPermissions, aTestCaseMain) {
}
function startBluetoothTest(aReenable, aTestCaseMain) {
- startBluetoothTestBase(["settings-read", "settings-write"], function() {
+ startBluetoothTestBase([], function() {
let origEnabled, needEnable;
return Promise.resolve()
.then(function() {
diff --git a/dom/bluetooth2/tests/marionette/manifest.ini b/dom/bluetooth2/tests/marionette/manifest.ini
index e469d54782a..d3ed382f7f5 100644
--- a/dom/bluetooth2/tests/marionette/manifest.ini
+++ b/dom/bluetooth2/tests/marionette/manifest.ini
@@ -4,3 +4,4 @@ browser = false
qemu = false
[test_dom_BluetoothManager_API2.js]
+[test_dom_BluetoothAdapter_enable_API2.js]
diff --git a/dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js b/dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js
new file mode 100644
index 00000000000..9594cf1d264
--- /dev/null
+++ b/dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js
@@ -0,0 +1,76 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+///////////////////////////////////////////////////////////////////////////////
+// Test Purpose:
+// To verify that enable/disable process of BluetoothAdapter is correct.
+//
+// Test Procedure:
+// [0] Set Bluetooth permission and enable default adapter.
+// [1] Disable Bluetooth and check the correctness of 'onattributechanged'.
+// [2] Enable Bluetooth and check the correctness of 'onattributechanged'.
+//
+// Test Coverage:
+// - BluetoothAdapter.enable()
+// - BluetoothAdapter.disable()
+// - BluetoothAdapter.onattributechanged()
+// - BluetoothAdapter.address
+// - BluetoothAdapter.state
+//
+///////////////////////////////////////////////////////////////////////////////
+
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = 'head.js';
+
+startBluetoothTest(true, function testCaseMain(aAdapter) {
+ log("Checking adapter attributes ...");
+
+ is(aAdapter.state, "enabled", "adapter.state");
+ isnot(aAdapter.address, "", "adapter.address");
+
+ // Since adapter has just been re-enabled, these properties should be 'false'.
+ is(aAdapter.discovering, false, "adapter.discovering");
+ is(aAdapter.discoverable, false, "adapter.discoverable");
+ // TODO: Check the correctness of name and address if we use emulator.
+ // is(aAdapter.name, EMULATOR_NAME, "adapter.name");
+ // is(aAdapter.address, EMULATOR_ADDRESS, "adapter.address");
+
+ log(" adapter.address: " + aAdapter.address);
+ log(" adapter.name: " + aAdapter.name);
+
+ let originalAddr = aAdapter.address;
+ let originalName = aAdapter.name;
+
+ return Promise.resolve()
+ .then(function() {
+ log("[1] Disable Bluetooth and check the correctness of 'onattributechanged'");
+ let promises = [];
+ promises.push(waitForAdapterStateChanged(aAdapter, ["disabling", "disabled"]));
+ promises.push(aAdapter.disable());
+ return Promise.all(promises);
+ })
+ .then(function(aResults) {
+ isnot(aResults[0].indexOf("address"), -1, "Indicator of 'address' changed event");
+ if (originalName != "") {
+ isnot(aResults[0].indexOf("name"), -1, "Indicator of 'name' changed event");
+ }
+ is(aAdapter.address, "", "adapter.address");
+ is(aAdapter.name, "", "adapter.name");
+ })
+ .then(function() {
+ log("[2] Enable Bluetooth and check the correctness of 'onattributechanged'");
+ let promises = [];
+ promises.push(waitForAdapterStateChanged(aAdapter, ["enabling", "enabled"]));
+ promises.push(aAdapter.enable());
+ return Promise.all(promises);
+ })
+ .then(function(aResults) {
+ isnot(aResults[0].indexOf("address"), -1, "Indicator of 'address' changed event");
+ if (originalName != "") {
+ isnot(aResults[0].indexOf("name"), -1, "Indicator of 'name' changed event");
+ }
+ is(aAdapter.address, originalAddr, "adapter.address");
+ is(aAdapter.name, originalName, "adapter.name");
+ })
+});
From ed8de75606cebf7671875f84b4889837141183a0 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:00:33 -0700
Subject: [PATCH 02/67] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/387dd3872cf8
Author: George
Desc: Merge pull request #21343 from cctuan/1027534
Bug 1027534 - [System][Test] Integration test for inline->window activity call chain
========
https://hg.mozilla.org/integration/gaia-central/rev/bdeb15e02b47
Author: cctuan
Desc: Bug 1027534 - [System][Test] Integration test for inline->window activity call chain
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 8655d50f8d3..a8ad8235cee 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "3e612bc9b3d79a3fa36d2f38af4202abb0ead68f",
+ "revision": "387dd3872cf8c3b09fc4fcb6c732b2830e1dff3c",
"repo_path": "/integration/gaia-central"
}
From 82ee686310bb05fba3c6d8c67108c1a43e0ea7f2 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:06:24 -0700
Subject: [PATCH 03/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 0b16e2da563..0bbcea199e6 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index c2d47a92600..5d446f05e31 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index c89c913fc7d..f2d8d7f7af2 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 0b16e2da563..0bbcea199e6 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index b85ff724df6..b70c216a7a9 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 332a3d657d7..3fc52a7d4fc 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index ecad1f8aeea..6aac03cc43a 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 78f96f25673..c1d181bb5b9 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 384a9ec720e..fd16b5b9164 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 4f7fa4b32e6a1dc39f82c252d7e9ac1a4329c633 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:15:32 -0700
Subject: [PATCH 04/67] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/b181a8d034ea
Author: evanxd
Desc: Merge pull request #21331 from evanxd/bug-967216
Bug 967216 - Intermittent calendar/test/unit/app_test.js | app global events moztimechange | expected 2 to equal 1
========
https://hg.mozilla.org/integration/gaia-central/rev/cd4f9c6fcef5
Author: Evan Xd
Desc: Bug 967216 - Intermittent calendar/test/unit/app_test.js | app global events moztimechange | expected 2 to equal 1
========
https://hg.mozilla.org/integration/gaia-central/rev/db186c5bdc02
Author: Julien Wajsberg
Desc: Merge pull request #21192 from julienw/1032327-fix-settings-unit-test-newer-mocha
Bug 1032327 - [Settings] Fix unit tests with a newer mocha r=cctuan
========
https://hg.mozilla.org/integration/gaia-central/rev/ee8796cbae82
Author: Julien Wajsberg
Desc: Bug 1032327 - [Settings] Fix unit tests with a newer mocha r=cctuan
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index a8ad8235cee..5ecb83e9166 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "387dd3872cf8c3b09fc4fcb6c732b2830e1dff3c",
+ "revision": "b181a8d034eac37e82e964514a66ec1d61917bd7",
"repo_path": "/integration/gaia-central"
}
From 0f9e890d9e14204a6322c0cd34493ea6525fecd5 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:21:21 -0700
Subject: [PATCH 05/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 0bbcea199e6..3cffcd68cc9 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 5d446f05e31..7a7dd68e8db 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index f2d8d7f7af2..6fca705525e 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 0bbcea199e6..3cffcd68cc9 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index b70c216a7a9..8ea23e723ea 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 3fc52a7d4fc..548b1d603ac 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 6aac03cc43a..a66f64cbfa5 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index c1d181bb5b9..65c7a3541ca 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index fd16b5b9164..49bad3ba343 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 3d639633f20e07c16001917a4731210213da2815 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:30:25 -0700
Subject: [PATCH 06/67] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/0e78f442feb2
Author: Aleh Zasypkin
Desc: Merge pull request #21417 from azasypkin/bug-990020-sim-mismatch
Bug 990020 - [B2G][SMS] A MMS that has not been downloaded yet will display a "Missing SIM card" message after changing the SIM to a different valid one. r=julien
========
https://hg.mozilla.org/integration/gaia-central/rev/235cefc3cf30
Author: Aleh Zasypkin
Desc: Bug 990020 - [B2G][SMS] A MMS that has not been downloaded yet will display a "Missing SIM card" message after changing the SIM to a different valid one. r=julien
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 5ecb83e9166..536c9437b58 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "b181a8d034eac37e82e964514a66ec1d61917bd7",
+ "revision": "0e78f442feb2ef5873f307de7eb0e25421da34a3",
"repo_path": "/integration/gaia-central"
}
From 9342dc0fadda3a54018ba00e434186cf0547ba8d Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:36:39 -0700
Subject: [PATCH 07/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 3cffcd68cc9..ce43ea23c38 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 7a7dd68e8db..63219dacebe 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 6fca705525e..48d11535c1d 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 3cffcd68cc9..ce43ea23c38 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 8ea23e723ea..db288829bd1 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 548b1d603ac..576a5689438 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index a66f64cbfa5..c07510f4860 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 65c7a3541ca..cbc737501a3 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 49bad3ba343..08a43a3f2f9 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 67dc36e42264b849f8cb116a304a61716cad44b6 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:45:32 -0700
Subject: [PATCH 08/67] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/79ddb80647ce
Author: Carsten Book
Desc: Merge pull request #21466 from khuey/1035432
Bug 1035432 - InitLogoHandler entrains the DOM nodes used to display the logo. r=alive
========
https://hg.mozilla.org/integration/gaia-central/rev/255ffc1aa8c5
Author: Kyle Huey
Desc: Bug 1035432: Don't entrain the startup logos. r=alive
========
https://hg.mozilla.org/integration/gaia-central/rev/8da1e68d73a6
Author: Rudy Lu
Desc: Merge pull request #21411 from RudyLu/keyboard/Bug1027979_remove_PendingSymbols
Bug 1027979 - Remove more dead code from keyboard app.
r=timdream.
========
https://hg.mozilla.org/integration/gaia-central/rev/60dbeaccfa55
Author: Rudy Lu
Desc: Bug 1027979 - Remove more dead code from keyboard app.
- Remove the pendingSymbols relate code.
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 536c9437b58..45187ab20c8 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "0e78f442feb2ef5873f307de7eb0e25421da34a3",
+ "revision": "79ddb80647ce7c2140e0fff7f51fd76ae91b757f",
"repo_path": "/integration/gaia-central"
}
From 0c8b7f983a3184b7324e13e9566a0ad74a636012 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 00:51:18 -0700
Subject: [PATCH 09/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 4 ++--
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index ce43ea23c38..624e902e264 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 63219dacebe..c86469c6f60 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
@@ -128,7 +128,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 48d11535c1d..5846eb13885 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index ce43ea23c38..624e902e264 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index db288829bd1..080f5936cbc 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 576a5689438..5066d445ff0 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index c07510f4860..364f304c6a4 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index cbc737501a3..acca737a710 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 08a43a3f2f9..055f26b23df 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 06b5ae44ccf37b1eef20cb5bbf44efbc4b8709e0 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 01:00:27 -0700
Subject: [PATCH 10/67] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/7208f8d87131
Author: Carsten Book
Desc: Merge pull request #21306 from kamituel/Bug_1000839_encodeNDEF_fix
Bug 1000839: Fixes and unit tests for NfcUtils.encodeNDEF(). r=snowmantw
========
https://hg.mozilla.org/integration/gaia-central/rev/922949dc3a92
Author: Kamil Leszczuk
Desc: Bug 1000839: Fixes and unit tests for NfcUtils.encodeNDEF()
========
https://hg.mozilla.org/integration/gaia-central/rev/03e96d8cc929
Author: Carsten Book
Desc: Merge pull request #21247 from guilherme-pg/bug1030448-bad-lockscreen
Bug 1030448 - Also make the default lockscreen react to the 'lockscreen..... r=gweng
========
https://hg.mozilla.org/integration/gaia-central/rev/3769cbf28688
Author: Guilherme Goncalves
Desc: Bug 1030448 - Also make the default lockscreen react to the 'lockscreen.lock-immediately' setting.
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 45187ab20c8..b14251cfe89 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "79ddb80647ce7c2140e0fff7f51fd76ae91b757f",
+ "revision": "7208f8d871310786e2aac7996f11364a70c6b438",
"repo_path": "/integration/gaia-central"
}
From e99d09e7d0a7d21b4485780f636761acee42ac8a Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 01:06:11 -0700
Subject: [PATCH 11/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 624e902e264..7a548bd7bc2 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index c86469c6f60..ed2467e0820 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 5846eb13885..7e47ca4ab99 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 624e902e264..7a548bd7bc2 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 080f5936cbc..f4e825b0ac2 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 5066d445ff0..25373deeb6b 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 364f304c6a4..746e393da08 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index acca737a710..c96bf99d621 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 055f26b23df..092900abdd9 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From c5fc79d65f2ccb0ceb5e50816550f858eb1541e1 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 02:10:30 -0700
Subject: [PATCH 12/67] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/1bd6bc40a147
Author: Guillaume C. Marty
Desc: Merge pull request #21443 from gmarty/Bug-103336-Header-text-bookmarks-activity-misaligned
Bug 1033365 - Header text in bookmarks activity is misaligned
========
https://hg.mozilla.org/integration/gaia-central/rev/a3f42c308937
Author: Guillaume Marty
Desc: Bug 1033365 - Header text in bookmarks activity is misaligned
========
https://hg.mozilla.org/integration/gaia-central/rev/c54670808cea
Author: Guillaume C. Marty
Desc: Merge pull request #20610 from gmarty/bug-908300-Solution-Truncated-Headers
Bug 908300 - Solution for Truncated Headers
========
https://hg.mozilla.org/integration/gaia-central/rev/27ebe0791dd7
Author: Guillaume Marty
Desc: Bug 1026955 - Resize and center headers according to Gecko's logic
========
https://hg.mozilla.org/integration/gaia-central/rev/d267b4c7d772
Author: Julien Wajsberg
Desc: Merge pull request #21481 from julienw/1035640-use-app-in-bin-gaia-test
Bug 1035640 - Follow-up to bug 1021481: run the test-agent on app:// in ...
========
https://hg.mozilla.org/integration/gaia-central/rev/2e93309ef746
Author: Julien Wajsberg
Desc: Bug 1035640 - Follow-up to bug 1021481: run the test-agent on app:// in bin/gaia-test r=yurenju
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index b14251cfe89..4bb0af0f15f 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "7208f8d871310786e2aac7996f11364a70c6b438",
+ "revision": "1bd6bc40a14747533c1ebbd98dc5fc6134b4d539",
"repo_path": "/integration/gaia-central"
}
From 80ca58a7be59c91a03bc5ce51c20bc1a2aa91c5c Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 02:16:20 -0700
Subject: [PATCH 13/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 7a548bd7bc2..8bf67c5655b 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index ed2467e0820..3df9aabe7d3 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 7e47ca4ab99..8d455d73905 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 7a548bd7bc2..8bf67c5655b 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index f4e825b0ac2..51a6eab02f9 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 25373deeb6b..741f069b3a0 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 746e393da08..489484b6a4e 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index c96bf99d621..78afe7656fc 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 092900abdd9..3245df69cad 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From f5d274039be08573b03ce9b089d584afe7a2ed18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fernando=20Jim=C3=A9nez?=
Date: Tue, 8 Jul 2014 12:10:24 +0200
Subject: [PATCH 14/67] Bug 1024396 - Allow blocking certain permissions for
privileged apps. r=fabrice
---
dom/apps/src/PermissionsTable.jsm | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/dom/apps/src/PermissionsTable.jsm b/dom/apps/src/PermissionsTable.jsm
index 7f99651d0f4..ae2ed5099cf 100644
--- a/dom/apps/src/PermissionsTable.jsm
+++ b/dom/apps/src/PermissionsTable.jsm
@@ -163,9 +163,15 @@ this.PermissionsTable = { geolocation: {
},
attention: {
app: DENY_ACTION,
- privileged: ALLOW_ACTION,
+ privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
+ "moz-attention": {
+ app: DENY_ACTION,
+ privileged: ALLOW_ACTION,
+ certified: ALLOW_ACTION,
+ substitute: ["attention"]
+ },
"webapps-manage": {
app: DENY_ACTION,
privileged: DENY_ACTION,
@@ -267,14 +273,26 @@ this.PermissionsTable = { geolocation: {
},
"audio-channel-telephony": {
app: DENY_ACTION,
- privileged: ALLOW_ACTION,
+ privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
+ "moz-audio-channel-telephony": {
+ app: DENY_ACTION,
+ privileged: ALLOW_ACTION,
+ certified: ALLOW_ACTION,
+ substitute: ["audio-channel-telephony"]
+ },
"audio-channel-ringer": {
app: DENY_ACTION,
- privileged: ALLOW_ACTION,
+ privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
+ "moz-audio-channel-ringer": {
+ app: DENY_ACTION,
+ privileged: ALLOW_ACTION,
+ certified: ALLOW_ACTION,
+ substitute: ["audio-channel-ringer"]
+ },
"audio-channel-publicnotification": {
app: DENY_ACTION,
privileged: DENY_ACTION,
From 42595b72b5b0f7a9d0df9d69bdffe844517c258a Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 03:35:28 -0700
Subject: [PATCH 15/67] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/5c017f5f117e
Author: Arnau
Desc: Merge pull request #21487 from rnowm/1035670
Bug 1035670 - [BB] Create new shared component to manage icon fonts r=pivanov
========
https://hg.mozilla.org/integration/gaia-central/rev/b44f1a1a1c57
Author: rnowm
Desc: Bug 1035670 - [BB] Create new shared component to manage icon fonts
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 4bb0af0f15f..aa441d71ae1 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "1bd6bc40a14747533c1ebbd98dc5fc6134b4d539",
+ "revision": "5c017f5f117ea4c78aa018db0cbeca012fc4dca3",
"repo_path": "/integration/gaia-central"
}
From ea21aa77a3e1c36bb3eae9d6b4d25749984aea1f Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 03:41:11 -0700
Subject: [PATCH 16/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 8bf67c5655b..c801fc6e7ed 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 3df9aabe7d3..094c6e21ca8 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 8d455d73905..f736b909205 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 8bf67c5655b..c801fc6e7ed 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 51a6eab02f9..6d22ec7cf1c 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 741f069b3a0..f247fbed3db 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 489484b6a4e..c20a152a7de 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 78afe7656fc..b43af5438c2 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 3245df69cad..88aad23b608 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 442ec461f852c4482f05e9cfecfa93da29a6b565 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 04:00:26 -0700
Subject: [PATCH 17/67] Bumping gaia.json for 13 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/49b832dfafe5
Author: Timothy Guan-tin Chien
Desc: Merge pull request #21426 from timdream/keyboard-touch-handling
Bug 1029356 - Introduce ActiveTargetsManager, r=rudyl
========
https://hg.mozilla.org/integration/gaia-central/rev/2cc0eb8c754f
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part XII) Cancel selection target when press is moved
========
https://hg.mozilla.org/integration/gaia-central/rev/2332e0163e28
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part XI) Introduce ActiveTargetsManager and let keyboard.js use it
========
https://hg.mozilla.org/integration/gaia-central/rev/1a793bd2c66c
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part X) Introduce VisualHighlightManager and let keyboard.js use it
========
https://hg.mozilla.org/integration/gaia-central/rev/d9fbb210e476
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part IX) AlternativesCharMenuManager.isMenuTarget method
========
https://hg.mozilla.org/integration/gaia-central/rev/4dd9381de8a3
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part VIII) Have AlternativesCharMenuManager figure out alternatives
========
https://hg.mozilla.org/integration/gaia-central/rev/2b4098566c02
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part VII) Use longPressValue instead of alt char for number/tel keys
========
https://hg.mozilla.org/integration/gaia-central/rev/d4103ebee05d
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part VI) Don't handle keyObj in keyboard.js
========
https://hg.mozilla.org/integration/gaia-central/rev/79fc9bfa5267
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part V) AlternativesCharMenuManager.isMenuTouch method
========
https://hg.mozilla.org/integration/gaia-central/rev/3b815935ffd1
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part IV) FeedbackManager and let keyboard use it
========
https://hg.mozilla.org/integration/gaia-central/rev/0310c81e6d86
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part III) Introduce AlternativesCharMenuManager and use it
========
https://hg.mozilla.org/integration/gaia-central/rev/5e26ef350e00
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part II) Rename menu* to longPress*
========
https://hg.mozilla.org/integration/gaia-central/rev/4e4a26fbba5a
Author: Timothy Guan-tin Chien
Desc: Bug 1029356 - (Part I) Handle layout alternatives in LayoutLoader
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index aa441d71ae1..21463c3e1d5 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "5c017f5f117ea4c78aa018db0cbeca012fc4dca3",
+ "revision": "49b832dfafe531bdf42cf54e6fb7f76cf659fcc1",
"repo_path": "/integration/gaia-central"
}
From 96995d0cba356a08df1e971b413a713de686c275 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 04:11:11 -0700
Subject: [PATCH 18/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index c801fc6e7ed..ab6518a2057 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 094c6e21ca8..fa7634b159a 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index f736b909205..ca38e19f0b1 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index c801fc6e7ed..ab6518a2057 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 6d22ec7cf1c..d1ec52a0d1f 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index f247fbed3db..58a27a7b77b 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index c20a152a7de..e91872ce20f 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index b43af5438c2..7bd3bc925c3 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 88aad23b608..64442180e50 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From 00f9cabf17981bf6e88559a2b3a00ba66fd30661 Mon Sep 17 00:00:00 2001
From: Dimi Lee
Date: Tue, 8 Jul 2014 11:56:57 +0800
Subject: [PATCH 19/67] Bug 997576 - [NFC] Testcase for reading empty NFC tag.
r=tzimmermann
---
dom/nfc/tests/marionette/head.js | 11 ++++
dom/nfc/tests/marionette/manifest.ini | 2 +-
.../{test_nfc_tag.js => test_nfc_read_tag.js} | 57 ++++++++++++++++---
3 files changed, 60 insertions(+), 10 deletions(-)
rename dom/nfc/tests/marionette/{test_nfc_tag.js => test_nfc_read_tag.js} (57%)
diff --git a/dom/nfc/tests/marionette/head.js b/dom/nfc/tests/marionette/head.js
index d2c50355335..e2b6bfaf194 100644
--- a/dom/nfc/tests/marionette/head.js
+++ b/dom/nfc/tests/marionette/head.js
@@ -82,6 +82,16 @@ let emulator = (function() {
return deferred.promise;
};
+ function clearTagData(re) {
+ let deferred = Promise.defer();
+ let cmd = "nfc tag clear " + re;
+
+ this.run(cmd, function(result) {
+ is(result.pop(), "OK", "clear tag" + re);
+ deferred.resolve();
+ });
+ }
+
function snepPutNdef(dsap, ssap, flags, tnf, type, payload, id) {
let deferred = Promise.defer();
let cmd = "nfc snep put " + dsap + " " + ssap + " [" + flags + "," +
@@ -103,6 +113,7 @@ let emulator = (function() {
deactivate: deactivate,
notifyDiscoverRE: notifyDiscoverRE,
setTagData: setTagData,
+ clearTagData: clearTagData,
snepPutNdef: snepPutNdef
};
}());
diff --git a/dom/nfc/tests/marionette/manifest.ini b/dom/nfc/tests/marionette/manifest.ini
index aecfef0d7c3..da072c9ee14 100644
--- a/dom/nfc/tests/marionette/manifest.ini
+++ b/dom/nfc/tests/marionette/manifest.ini
@@ -10,6 +10,6 @@ qemu=true
[test_nfc_manager_tech_lost.js]
[test_nfc_peer.js]
[test_nfc_peer_sendndef.js]
-[test_nfc_tag.js]
+[test_nfc_read_tag.js]
[test_nfc_checkP2PRegistration.js]
[test_nfc_error_messages.js]
diff --git a/dom/nfc/tests/marionette/test_nfc_tag.js b/dom/nfc/tests/marionette/test_nfc_read_tag.js
similarity index 57%
rename from dom/nfc/tests/marionette/test_nfc_tag.js
rename to dom/nfc/tests/marionette/test_nfc_read_tag.js
index a9b618e202a..9c407bfe92f 100644
--- a/dom/nfc/tests/marionette/test_nfc_tag.js
+++ b/dom/nfc/tests/marionette/test_nfc_read_tag.js
@@ -6,11 +6,10 @@ MARIONETTE_HEAD_JS = "head.js";
let url = "http://www.mozilla.org";
-// TODO : Get this from emulator console command.
-const T1T_RE_INDEX = 2;
-const T2T_RE_INDEX = 3;
-const T3T_RE_INDEX = 4;
-const T4T_RE_INDEX = 5;
+const T1T_RE_INDEX = 2;
+const T2T_RE_INDEX = 3;
+const T3T_RE_INDEX = 4;
+const T4T_RE_INDEX = 5;
function testUrlTagDiscover(re) {
log("Running \'testUrlTagDiscover\'");
@@ -41,6 +40,26 @@ function testUrlTagDiscover(re) {
.then(() => emulator.activateRE(re));
}
+function testEmptyTagDiscover(re) {
+ log("Running \'testEmptyTagDiscover\'");
+
+ window.navigator.mozSetMessageHandler("nfc-manager-tech-discovered", function(msg) {
+ log("Received \'nfc-manager-tech-ndiscovered\'");
+ is(msg.type, "techDiscovered", "check for correct message type");
+ let index = msg.techList.indexOf("NDEF");
+ isnot(index, -1, "check for \'NDEF\' in tech list");
+
+ let records = msg.records;
+ ok(records == null);
+
+ toggleNFC(false).then(runNextTest);
+ });
+
+ toggleNFC(true)
+ .then(() => emulator.clearTagData(re))
+ .then(() => emulator.activateRE(re));
+}
+
function testUrlT1TDiscover() {
testUrlTagDiscover(T1T_RE_INDEX);
}
@@ -57,11 +76,31 @@ function testUrlT4TDiscover() {
testUrlTagDiscover(T4T_RE_INDEX);
}
+function testEmptyT1TDiscover() {
+ testEmptyTagDiscover(T1T_RE_INDEX);
+}
+
+function testEmptyT2TDiscover() {
+ testEmptyTagDiscover(T2T_RE_INDEX);
+}
+
+function testEmptyT3TDiscover() {
+ testEmptyTagDiscover(T3T_RE_INDEX);
+}
+
+function testEmptyT4TDiscover() {
+ testEmptyTagDiscover(T4T_RE_INDEX);
+}
+
let tests = [
- testUrlT1TDiscover,
- testUrlT2TDiscover,
- testUrlT3TDiscover,
- testUrlT4TDiscover
+ testUrlT1TDiscover,
+ testUrlT2TDiscover,
+ testUrlT3TDiscover,
+ testUrlT4TDiscover,
+ testEmptyT1TDiscover,
+ testEmptyT2TDiscover,
+ testEmptyT3TDiscover,
+ testEmptyT4TDiscover
];
SpecialPowers.pushPermissions(
From 093bc4bf486a8087993cecf3a757ba3d7be5d860 Mon Sep 17 00:00:00 2001
From: Jan Jongboom
Date: Tue, 8 Jul 2014 03:31:00 -0400
Subject: [PATCH 20/67] Bug 1026997 - Use nsISelectionPrivate to track
selection changes in forms.js. r=yxl
---
dom/inputmethod/MozKeyboard.js | 5 +
dom/inputmethod/forms.js | 79 ++++++--------
dom/inputmethod/mochitest/mochitest.ini | 1 +
.../mochitest/test_bug1026997.html | 101 ++++++++++++++++++
4 files changed, 138 insertions(+), 48 deletions(-)
create mode 100644 dom/inputmethod/mochitest/test_bug1026997.html
diff --git a/dom/inputmethod/MozKeyboard.js b/dom/inputmethod/MozKeyboard.js
index 7bec21534a5..9f4195ad475 100644
--- a/dom/inputmethod/MozKeyboard.js
+++ b/dom/inputmethod/MozKeyboard.js
@@ -394,6 +394,11 @@ MozInputContext.prototype = {
return;
}
+ // Update context first before resolving promise to avoid race condition
+ if (json.selectioninfo) {
+ this.updateSelectionContext(json.selectioninfo);
+ }
+
switch (msg.name) {
case "Keyboard:SendKey:Result:OK":
resolver.resolve();
diff --git a/dom/inputmethod/forms.js b/dom/inputmethod/forms.js
index b212a1f8cc8..dfe13e26442 100644
--- a/dom/inputmethod/forms.js
+++ b/dom/inputmethod/forms.js
@@ -224,6 +224,7 @@ let FormAssistant = {
_documentEncoder: null,
_editor: null,
_editing: false,
+ _selectionPrivate: null,
get focusedElement() {
if (this._focusedElement && Cu.isDeadWrapper(this._focusedElement))
@@ -244,8 +245,6 @@ let FormAssistant = {
return;
if (this.focusedElement) {
- this.focusedElement.removeEventListener('mousedown', this);
- this.focusedElement.removeEventListener('mouseup', this);
this.focusedElement.removeEventListener('compositionend', this);
if (this._observer) {
this._observer.disconnect();
@@ -254,6 +253,10 @@ let FormAssistant = {
if (!element) {
this.focusedElement.blur();
}
+ if (this._selectionPrivate) {
+ this._selectionPrivate.removeSelectionListener(this);
+ this._selectionPrivate = null;
+ }
}
this._documentEncoder = null;
@@ -269,8 +272,6 @@ let FormAssistant = {
}
if (element) {
- element.addEventListener('mousedown', this);
- element.addEventListener('mouseup', this);
element.addEventListener('compositionend', this);
if (isContentEditable(element)) {
this._documentEncoder = getDocumentEncoder(element);
@@ -280,6 +281,12 @@ let FormAssistant = {
// Add a nsIEditorObserver to monitor the text content of the focused
// element.
this._editor.addEditorObserver(this);
+
+ let selection = this._editor.selection;
+ if (selection) {
+ this._selectionPrivate = selection.QueryInterface(Ci.nsISelectionPrivate);
+ this._selectionPrivate.addSelectionListener(this);
+ }
}
// If our focusedElement is removed from DOM we want to handle it properly
@@ -305,6 +312,10 @@ let FormAssistant = {
this.focusedElement = element;
},
+ notifySelectionChanged: function(aDocument, aSelection, aReason) {
+ this.updateSelection();
+ },
+
get documentEncoder() {
return this._documentEncoder;
},
@@ -376,32 +387,6 @@ let FormAssistant = {
}
break;
- case 'mousedown':
- if (!this.focusedElement) {
- break;
- }
-
- // We only listen for this event on the currently focused element.
- // When the mouse goes down, note the cursor/selection position
- this.updateSelection();
- break;
-
- case 'mouseup':
- if (!this.focusedElement) {
- break;
- }
-
- // We only listen for this event on the currently focused element.
- // When the mouse goes up, see if the cursor has moved (or the
- // selection changed) since the mouse went down. If it has, we
- // need to tell the keyboard about it
- range = getSelectionRange(this.focusedElement);
- if (range[0] !== this.selectionStart ||
- range[1] !== this.selectionEnd) {
- this.updateSelection();
- }
- break;
-
case "resize":
if (!this.isKeyboardOpened)
return;
@@ -423,25 +408,12 @@ let FormAssistant = {
}
break;
- case "input":
- if (this.focusedElement) {
- // When the text content changes, notify the keyboard
- this.updateSelection();
- }
- break;
-
case "keydown":
if (!this.focusedElement) {
break;
}
CompositionManager.endComposition('');
-
- // We use 'setTimeout' to wait until the input element accomplishes the
- // change in selection range.
- content.setTimeout(function() {
- this.updateSelection();
- }.bind(this), 0);
break;
case "keyup":
@@ -450,7 +422,6 @@ let FormAssistant = {
}
CompositionManager.endComposition('');
-
break;
case "compositionend":
@@ -525,7 +496,8 @@ let FormAssistant = {
if (json.requestId && doKeypress) {
sendAsyncMessage("Forms:SendKey:Result:OK", {
- requestId: json.requestId
+ requestId: json.requestId,
+ selectioninfo: this.getSelectionInfo()
});
}
else if (json.requestId && !doKeypress) {
@@ -583,8 +555,6 @@ let FormAssistant = {
break;
}
- this.updateSelection();
-
if (json.requestId) {
sendAsyncMessage("Forms:SetSelectionRange:Result:OK", {
requestId: json.requestId,
@@ -651,6 +621,7 @@ let FormAssistant = {
json.clauses);
sendAsyncMessage("Forms:SetComposition:Result:OK", {
requestId: json.requestId,
+ selectioninfo: this.getSelectionInfo()
});
break;
}
@@ -659,6 +630,7 @@ let FormAssistant = {
CompositionManager.endComposition(json.text);
sendAsyncMessage("Forms:EndComposition:Result:OK", {
requestId: json.requestId,
+ selectioninfo: this.getSelectionInfo()
});
break;
}
@@ -757,6 +729,8 @@ let FormAssistant = {
};
},
+ _selectionTimeout: null,
+
// Notify when the selection range changes
updateSelection: function fa_updateSelection() {
if (!this.focusedElement) {
@@ -764,7 +738,16 @@ let FormAssistant = {
}
let selectionInfo = this.getSelectionInfo();
if (selectionInfo.changed) {
- sendAsyncMessage("Forms:SelectionChange", this.getSelectionInfo());
+ // A call to setSelectionRange on input field causes 2 selection changes
+ // one to [0,0] and one to actual value. Both are sent in same tick.
+ // Prevent firing two events in that scenario, always only use the last 1
+ if (this._selectionTimeout) {
+ content.clearTimeout(this._selectionTimeout);
+ }
+
+ this._selectionTimeout = content.setTimeout(function() {
+ sendAsyncMessage("Forms:SelectionChange", selectionInfo);
+ });
}
}
};
diff --git a/dom/inputmethod/mochitest/mochitest.ini b/dom/inputmethod/mochitest/mochitest.ini
index 61392de93f4..41bf6ee7156 100644
--- a/dom/inputmethod/mochitest/mochitest.ini
+++ b/dom/inputmethod/mochitest/mochitest.ini
@@ -13,5 +13,6 @@ support-files =
[test_bug949059.html]
[test_bug960946.html]
[test_bug978918.html]
+[test_bug1026997.html]
[test_delete_focused_element.html]
[test_sendkey_cancel.html]
diff --git a/dom/inputmethod/mochitest/test_bug1026997.html b/dom/inputmethod/mochitest/test_bug1026997.html
new file mode 100644
index 00000000000..9fa7ef185b8
--- /dev/null
+++ b/dom/inputmethod/mochitest/test_bug1026997.html
@@ -0,0 +1,101 @@
+
+
+
+
+ SelectionChange on InputMethod API.
+
+
+
+
+
+Mozilla Bug 1026997
+
+
+
+
+
+
+
From a3d7f1375b18bbf16577dcad0a90e447476e68aa Mon Sep 17 00:00:00 2001
From: Bevis Tseng
Date: Wed, 2 Jul 2014 19:28:33 +0800
Subject: [PATCH 21/67] Bug 1028791 - Re-write Marionette Test Cases of
CellBroadcast with Promise. r=vyang
---
dom/cellbroadcast/tests/marionette/head.js | 147 ++++-
.../marionette/test_cellbroadcast_etws.js | 333 +++++-----
.../marionette/test_cellbroadcast_gsm.js | 576 +++++++-----------
.../test_cellbroadcast_multi_sim.js | 22 +-
4 files changed, 516 insertions(+), 562 deletions(-)
diff --git a/dom/cellbroadcast/tests/marionette/head.js b/dom/cellbroadcast/tests/marionette/head.js
index 940701952fd..28bc99e84af 100644
--- a/dom/cellbroadcast/tests/marionette/head.js
+++ b/dom/cellbroadcast/tests/marionette/head.js
@@ -5,6 +5,151 @@ const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers;
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
+const PDU_DCS_CODING_GROUP_BITS = 0xF0;
+const PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00;
+const PDU_DCS_MSG_CODING_8BITS_ALPHABET = 0x04;
+const PDU_DCS_MSG_CODING_16BITS_ALPHABET = 0x08;
+
+const PDU_DCS_MSG_CLASS_BITS = 0x03;
+const PDU_DCS_MSG_CLASS_NORMAL = 0xFF;
+const PDU_DCS_MSG_CLASS_0 = 0x00;
+const PDU_DCS_MSG_CLASS_ME_SPECIFIC = 0x01;
+const PDU_DCS_MSG_CLASS_SIM_SPECIFIC = 0x02;
+const PDU_DCS_MSG_CLASS_TE_SPECIFIC = 0x03;
+const PDU_DCS_MSG_CLASS_USER_1 = 0x04;
+const PDU_DCS_MSG_CLASS_USER_2 = 0x05;
+
+const GECKO_SMS_MESSAGE_CLASSES = {};
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL] = "normal";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0] = "class-0";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_ME_SPECIFIC] = "class-1";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_SIM_SPECIFIC] = "class-2";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_TE_SPECIFIC] = "class-3";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_USER_1] = "user-1";
+GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_USER_2] = "user-2";
+
+const CB_MESSAGE_SIZE_GSM = 88;
+const CB_MESSAGE_SIZE_ETWS = 56;
+
+const CB_GSM_MESSAGEID_ETWS_BEGIN = 0x1100;
+const CB_GSM_MESSAGEID_ETWS_END = 0x1107;
+
+const CB_GSM_GEOGRAPHICAL_SCOPE_NAMES = [
+ "cell-immediate",
+ "plmn",
+ "location-area",
+ "cell"
+];
+
+const CB_ETWS_WARNING_TYPE_NAMES = [
+ "earthquake",
+ "tsunami",
+ "earthquake-tsunami",
+ "test",
+ "other"
+];
+
+const CB_DCS_LANG_GROUP_1 = [
+ "de", "en", "it", "fr", "es", "nl", "sv", "da", "pt", "fi",
+ "no", "el", "tr", "hu", "pl", null
+];
+const CB_DCS_LANG_GROUP_2 = [
+ "cs", "he", "ar", "ru", "is", null, null, null, null, null,
+ null, null, null, null, null, null
+];
+
+/**
+ * Compose input number into specified number of semi-octets.
+ *
+ * @param: aNum
+ * The number to be converted.
+ * @param: aNumSemiOctets
+ * Number of semi-octects to be composed to.
+ *
+ * @return The composed Hex String.
+ */
+function buildHexStr(aNum, aNumSemiOctets) {
+ let str = aNum.toString(16);
+ ok(str.length <= aNumSemiOctets);
+ while (str.length < aNumSemiOctets) {
+ str = "0" + str;
+ }
+ return str;
+}
+
+/**
+ * Helper function to decode the given DCS into encoding type, language,
+ * language indicator and message class.
+ *
+ * @param: aDcs
+ * The DCS to be decoded.
+ *
+ * @return [encoding, language, hasLanguageIndicator,
+ * GECKO_SMS_MESSAGE_CLASSES[messageClass]]
+ */
+function decodeGsmDataCodingScheme(aDcs) {
+ let language = null;
+ let hasLanguageIndicator = false;
+ let encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
+ let messageClass = PDU_DCS_MSG_CLASS_NORMAL;
+
+ switch (aDcs & PDU_DCS_CODING_GROUP_BITS) {
+ case 0x00: // 0000
+ language = CB_DCS_LANG_GROUP_1[aDcs & 0x0F];
+ break;
+
+ case 0x10: // 0001
+ switch (aDcs & 0x0F) {
+ case 0x00:
+ hasLanguageIndicator = true;
+ break;
+ case 0x01:
+ encoding = PDU_DCS_MSG_CODING_16BITS_ALPHABET;
+ hasLanguageIndicator = true;
+ break;
+ }
+ break;
+
+ case 0x20: // 0010
+ language = CB_DCS_LANG_GROUP_2[aDcs & 0x0F];
+ break;
+
+ case 0x40: // 01xx
+ case 0x50:
+ //case 0x60:
+ //case 0x70:
+ case 0x90: // 1001
+ encoding = (aDcs & 0x0C);
+ if (encoding == 0x0C) {
+ encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
+ }
+ messageClass = (aDcs & PDU_DCS_MSG_CLASS_BITS);
+ break;
+
+ case 0xF0:
+ encoding = (aDcs & 0x04) ? PDU_DCS_MSG_CODING_8BITS_ALPHABET
+ : PDU_DCS_MSG_CODING_7BITS_ALPHABET;
+ switch(aDcs & PDU_DCS_MSG_CLASS_BITS) {
+ case 0x01: messageClass = PDU_DCS_MSG_CLASS_USER_1; break;
+ case 0x02: messageClass = PDU_DCS_MSG_CLASS_USER_2; break;
+ case 0x03: messageClass = PDU_DCS_MSG_CLASS_TE_SPECIFIC; break;
+ }
+ break;
+
+ case 0x30: // 0011 (Reserved)
+ case 0x80: // 1000 (Reserved)
+ case 0xA0: // 1010..1100 (Reserved)
+ case 0xB0:
+ case 0xC0:
+ break;
+ default:
+ throw new Error("Unsupported CBS data coding scheme: " + aDcs);
+ }
+
+ return [encoding, language, hasLanguageIndicator,
+ GECKO_SMS_MESSAGE_CLASSES[messageClass]];
+}
+
/**
* Push required permissions and test if |navigator.mozCellBroadcast| exists.
* Resolve if it does, reject otherwise.
@@ -148,7 +293,7 @@ function sendMultipleRawCbsToEmulatorAndWait(aPdus) {
promises.push(sendRawCbsToEmulator(pdu));
}
- return Promise.all(promises);
+ return Promise.all(promises).then(aResults => aResults[0].message);
}
/**
diff --git a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js
index f08daec368c..c1e62441a56 100644
--- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js
+++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js
@@ -1,268 +1,215 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
-MARIONETTE_TIMEOUT = 10000;
+MARIONETTE_TIMEOUT = 20000;
+MARIONETTE_HEAD_JS = 'head.js';
-const CB_MESSAGE_SIZE_ETWS = 56;
-
-const CB_GSM_GEOGRAPHICAL_SCOPE_NAMES = [
- "cell-immediate",
- "plmn",
- "location-area",
- "cell"
-];
-
-const CB_ETWS_WARNING_TYPE_NAMES = [
- "earthquake",
- "tsunami",
- "earthquake-tsunami",
- "test",
- "other"
-];
-
-SpecialPowers.addPermission("cellbroadcast", true, document);
-SpecialPowers.addPermission("mobileconnection", true, document);
-
-let cbs = window.navigator.mozCellBroadcast;
-ok(cbs instanceof window.MozCellBroadcast,
- "mozCellBroadcast is instanceof " + cbs.constructor);
-
-let pendingEmulatorCmdCount = 0;
-function sendCellBroadcastMessage(pdu, callback) {
- pendingEmulatorCmdCount++;
-
- let cmd = "cbs pdu " + pdu;
- runEmulatorCmd(cmd, function(result) {
- pendingEmulatorCmdCount--;
-
- is(result[0], "OK", "Emulator response");
-
- if (callback) {
- window.setTimeout(callback, 0);
- }
- });
-}
-
-function buildHexStr(n, numSemiOctets) {
- let str = n.toString(16);
- ok(str.length <= numSemiOctets);
- while (str.length < numSemiOctets) {
- str = "0" + str;
- }
- return str;
-}
-
-function seq(end, begin) {
- let result = [];
- for (let i = begin || 0; i < end; i++) {
- result.push(i);
- }
- return result;
-}
-
-function repeat(func, array, oncomplete) {
- (function do_call(index) {
- let next = index < (array.length - 1) ? do_call.bind(null, index + 1) : oncomplete;
- func.apply(null, [array[index], next]);
- })(0);
-}
-
-function doTestHelper(pdu, nextTest, checkFunc) {
- cbs.addEventListener("received", function onreceived(event) {
- cbs.removeEventListener("received", onreceived);
-
- checkFunc(event.message);
-
- window.setTimeout(nextTest, 0);
- });
-
- if (Array.isArray(pdu)) {
- repeat(sendCellBroadcastMessage, pdu);
- } else {
- sendCellBroadcastMessage(pdu);
- }
-}
-
-/**
- * Tests receiving Cell Broadcast messages, event instance type, all attributes
- * of CellBroadcastMessage exist.
- */
-function testEtwsMessageAttributes() {
- log("Test ETWS Primary Notification message attributes");
-
- cbs.addEventListener("received", function onreceived(event) {
- cbs.removeEventListener("received", onreceived);
-
- // Bug 838542: following check throws an exception and fails this case.
- // ok(event instanceof MozCellBroadcastEvent,
- // "event is instanceof " + event.constructor)
- ok(event, "event is valid");
-
- let message = event.message;
- ok(message, "event.message is valid");
+function testReceiving_ETWS_MessageAttributes() {
+ log("Test receiving ETWS Primary Notification - Message Attributes");
+ let verifyCBMessage = (aMessage) => {
// Attributes other than `language` and `body` should always be assigned.
- ok(message.gsmGeographicalScope != null, "message.gsmGeographicalScope");
- ok(message.messageCode != null, "message.messageCode");
- ok(message.messageId != null, "message.messageId");
- ok('language' in message, "message.language");
- ok(message.language == null, "message.language");
- ok('body' in message, "message.body");
- ok(message.body == null, "message.body");
- is(message.messageClass, "normal", "message.messageClass");
- ok(message.timestamp != null, "message.timestamp");
- ok(message.etws != null, "message.etws");
- ok(message.etws.warningType != null, "message.etws.warningType");
- ok(message.etws.emergencyUserAlert != null,
- "message.etws.emergencyUserAlert");
- ok(message.etws.popup != null, "message.etws.popup");
- ok(message.cdmaServiceCategory != null, "message.cdmaServiceCategory");
-
- window.setTimeout(testReceiving_ETWS_GeographicalScope, 0);
- });
+ ok(aMessage.gsmGeographicalScope != null, "aMessage.gsmGeographicalScope");
+ ok(aMessage.messageCode != null, "aMessage.messageCode");
+ ok(aMessage.messageId != null, "aMessage.messageId");
+ ok('language' in aMessage, "aMessage.language");
+ ok(aMessage.language == null, "aMessage.language");
+ ok('body' in aMessage, "aMessage.body");
+ ok(aMessage.body == null, "aMessage.body");
+ is(aMessage.messageClass, "normal", "aMessage.messageClass");
+ ok(aMessage.timestamp != null, "aMessage.timestamp");
+ ok(aMessage.etws != null, "aMessage.etws");
+ ok(aMessage.etws.warningType != null, "aMessage.etws.warningType");
+ ok(aMessage.etws.emergencyUserAlert != null,
+ "aMessage.etws.emergencyUserAlert");
+ ok(aMessage.etws.popup != null, "aMessage.etws.popup");
+ ok(aMessage.cdmaServiceCategory != null, "aMessage.cdmaServiceCategory");
+ };
// Here we use a simple ETWS message for test.
let pdu = buildHexStr(0, CB_MESSAGE_SIZE_ETWS * 2); // 6 octets
- sendCellBroadcastMessage(pdu);
+
+ return sendMultipleRawCbsToEmulatorAndWait([pdu])
+ .then((aMessage) => verifyCBMessage(aMessage));
}
function testReceiving_ETWS_GeographicalScope() {
log("Test receiving ETWS Primary Notification - Geographical Scope");
- function do_test(gs, nextTest) {
- // Here we use a simple ETWS message for test.
- let pdu = buildHexStr(((gs & 0x03) << 14), 4)
+ let promise = Promise.resolve();
+
+ let verifyCBMessage = (aMessage, aGsName) => {
+ is(aMessage.gsmGeographicalScope, aGsName,
+ "aMessage.gsmGeographicalScope");
+ };
+
+ CB_GSM_GEOGRAPHICAL_SCOPE_NAMES.forEach(function(aGsName, aIndex) {
+ let pdu = buildHexStr(((aIndex & 0x03) << 14), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 2) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aGsName));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.gsmGeographicalScope, CB_GSM_GEOGRAPHICAL_SCOPE_NAMES[gs],
- "message.gsmGeographicalScope");
- });
- }
-
- repeat(do_test, seq(CB_GSM_GEOGRAPHICAL_SCOPE_NAMES.length),
- testReceiving_ETWS_MessageCode);
+ return promise;
}
function testReceiving_ETWS_MessageCode() {
log("Test receiving ETWS Primary Notification - Message Code");
+ let promise = Promise.resolve();
+
// Message Code has 10 bits, and is ORed into a 16 bits 'serial' number. Here
// we test every single bit to verify the operation doesn't go wrong.
- let messageCodesToTest = [
+ let messageCodes = [
0x000, 0x001, 0x002, 0x004, 0x008, 0x010, 0x020, 0x040,
0x080, 0x100, 0x200, 0x251
];
- function do_test(messageCode, nextTest) {
- let pdu = buildHexStr(((messageCode & 0x3FF) << 4), 4)
+ let verifyCBMessage = (aMessage, aMsgCode) => {
+ is(aMessage.messageCode, aMsgCode, "aMessage.messageCode");
+ };
+
+ messageCodes.forEach(function(aMsgCode) {
+ let pdu = buildHexStr(((aMsgCode & 0x3FF) << 4), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 2) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMsgCode));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageCode, messageCode, "message.messageCode");
- });
- }
-
- repeat(do_test, messageCodesToTest, testReceiving_ETWS_MessageId);
+ return promise;
}
function testReceiving_ETWS_MessageId() {
log("Test receiving ETWS Primary Notification - Message Identifier");
+ let promise = Promise.resolve();
+
// Message Identifier has 16 bits, but no bitwise operation is needed.
// Test some selected values only.
- let messageIdsToTest = [
- 0x0000, 0x0001, 0x0010, 0x0100, 0x1000, 0x1111, 0x8888, 0x8811
+ let messageIds = [
+ 0x0000, 0x0001, 0x0010, 0x0100, 0x1000, 0x1111, 0x8888, 0x8811,
];
- function do_test(messageId, nextTest) {
+ let verifyCBMessage = (aMessage, aMessageId) => {
+ is(aMessage.messageId, aMessageId, "aMessage.messageId");
+ };
+
+ messageIds.forEach(function(aMessageId) {
let pdu = buildHexStr(0, 4)
- + buildHexStr((messageId & 0xFFFF), 4)
+ + buildHexStr((aMessageId & 0xFFFF), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 4) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMessageId));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageId, messageId, "message.messageId");
- });
- }
-
- repeat(do_test, messageIdsToTest, testReceiving_ETWS_Timestamp);
+ return promise;
}
function testReceiving_ETWS_Timestamp() {
log("Test receiving ETWS Primary Notification - Timestamp");
- // Here we use a simple ETWS message for test.
- let pdu = buildHexStr(0, 12); // 6 octets
- doTestHelper(pdu, testReceiving_ETWS_WarningType, function(message) {
+ let verifyCBMessage = (aMessage) => {
// 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;
+ let msMessage = aMessage.timestamp;
let msNow = Date.now();
- ok(Math.abs(msMessage - msNow) < (1000 * 60), "message.timestamp");
- });
+ ok(Math.abs(msMessage - msNow) < (1000 * 60), "aMessage.timestamp");
+ };
+
+ // Here we use a simple ETWS message for test.
+ let pdu = buildHexStr(0, 12); // 6 octets
+
+ return sendMultipleRawCbsToEmulatorAndWait([pdu])
+ .then((aMessage) => verifyCBMessage(aMessage));
}
function testReceiving_ETWS_WarningType() {
log("Test receiving ETWS Primary Notification - Warning Type");
+ let promise = Promise.resolve();
+
// Warning Type has 7 bits, and is ORed into a 16 bits 'WarningType' field.
// Here we test every single bit to verify the operation doesn't go wrong.
- let warningTypesToTest = [
+ let warningTypes = [
0x00, 0x01, 0x02, 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, 0x41
];
- function do_test(warningType, nextTest) {
+ let verifyCBMessage = (aMessage, aWarningType) => {
+ ok(aMessage.etws, "aMessage.etws");
+ is(aMessage.etws.warningType, CB_ETWS_WARNING_TYPE_NAMES[aWarningType],
+ "aMessage.etws.warningType");
+ };
+
+ warningTypes.forEach(function(aWarningType) {
let pdu = buildHexStr(0, 8)
- + buildHexStr(((warningType & 0x7F) << 9), 4)
+ + buildHexStr(((aWarningType & 0x7F) << 9), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 6) * 2);
-
- doTestHelper(pdu, nextTest, function(message) {
- ok(message.etws, "message.etws");
- is(message.etws.warningType, CB_ETWS_WARNING_TYPE_NAMES[warningType],
- "message.etws.warningType");
- });
- }
-
- repeat(do_test, warningTypesToTest, testReceiving_ETWS_EmergencyUserAlert);
-}
-
-function doTestEmergencyUserAlert_or_Popup(name, mask, nextTest) {
- let pdu = buildHexStr(0, 8)
- + buildHexStr(mask, 4)
- + buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 6) * 2);
- doTestHelper(pdu, nextTest, function(message) {
- ok(message.etws != null, "message.etws");
- is(message.etws[name], mask != 0, "message.etws." + name);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aWarningType));
});
+
+ return promise;
}
function testReceiving_ETWS_EmergencyUserAlert() {
log("Test receiving ETWS Primary Notification - Emergency User Alert");
- repeat(doTestEmergencyUserAlert_or_Popup.bind(null, "emergencyUserAlert"),
- [0x100, 0x000], testReceiving_ETWS_Popup);
+ let promise = Promise.resolve();
+
+ let emergencyUserAlertMasks = [0x100, 0x000];
+
+ let verifyCBMessage = (aMessage, aMask) => {
+ ok(aMessage.etws != null, "aMessage.etws");
+ is(aMessage.etws.emergencyUserAlert, aMask != 0, "aMessage.etws.emergencyUserAlert");
+ };
+
+ emergencyUserAlertMasks.forEach(function(aMask) {
+ let pdu = buildHexStr(0, 8)
+ + buildHexStr(aMask, 4)
+ + buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 6) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMask));
+ });
+
+ return promise;
}
function testReceiving_ETWS_Popup() {
log("Test receiving ETWS Primary Notification - Popup");
- repeat(doTestEmergencyUserAlert_or_Popup.bind(null, "popup"),
- [0x80, 0x000], cleanUp);
+ let promise = Promise.resolve();
+
+ let popupMasks = [0x80, 0x000];
+
+ let verifyCBMessage = (aMessage, aMask) => {
+ ok(aMessage.etws != null, "aMessage.etws");
+ is(aMessage.etws.popup, aMask != 0, "aMessage.etws.popup");
+ };
+
+ popupMasks.forEach(function(aMask) {
+ let pdu = buildHexStr(0, 8)
+ + buildHexStr(aMask, 4)
+ + buildHexStr(0, (CB_MESSAGE_SIZE_ETWS - 6) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMask));
+ });
+
+ return promise;
}
-function cleanUp() {
- if (pendingEmulatorCmdCount > 0) {
- window.setTimeout(cleanUp, 100);
- return;
- }
-
- SpecialPowers.removePermission("mobileconnection", document);
- SpecialPowers.removePermission("cellbroadcast", true, document);
-
- finish();
-}
-
-waitFor(testEtwsMessageAttributes, function() {
- return navigator.mozMobileConnections[0].voice.connected;
+startTestCommon(function testCaseMain() {
+ return testReceiving_ETWS_MessageAttributes()
+ .then(() => testReceiving_ETWS_GeographicalScope())
+ .then(() => testReceiving_ETWS_MessageCode())
+ .then(() => testReceiving_ETWS_MessageId())
+ .then(() => testReceiving_ETWS_Timestamp())
+ .then(() => testReceiving_ETWS_WarningType())
+ .then(() => testReceiving_ETWS_EmergencyUserAlert())
+ .then(() => testReceiving_ETWS_Popup());
});
-
diff --git a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js
index 9d9aec2b7c3..7cf94248c20 100644
--- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js
+++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js
@@ -1,59 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
-MARIONETTE_TIMEOUT = 30000;
-
-const PDU_DCS_CODING_GROUP_BITS = 0xF0;
-const PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00;
-const PDU_DCS_MSG_CODING_8BITS_ALPHABET = 0x04;
-const PDU_DCS_MSG_CODING_16BITS_ALPHABET = 0x08;
-
-const PDU_DCS_MSG_CLASS_BITS = 0x03;
-const PDU_DCS_MSG_CLASS_NORMAL = 0xFF;
-const PDU_DCS_MSG_CLASS_0 = 0x00;
-const PDU_DCS_MSG_CLASS_ME_SPECIFIC = 0x01;
-const PDU_DCS_MSG_CLASS_SIM_SPECIFIC = 0x02;
-const PDU_DCS_MSG_CLASS_TE_SPECIFIC = 0x03;
-const PDU_DCS_MSG_CLASS_USER_1 = 0x04;
-const PDU_DCS_MSG_CLASS_USER_2 = 0x05;
-
-const GECKO_SMS_MESSAGE_CLASSES = {};
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL] = "normal";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0] = "class-0";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_ME_SPECIFIC] = "class-1";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_SIM_SPECIFIC] = "class-2";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_TE_SPECIFIC] = "class-3";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_USER_1] = "user-1";
-GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_USER_2] = "user-2";
-
-const CB_MESSAGE_SIZE_GSM = 88;
-
-const CB_GSM_MESSAGEID_ETWS_BEGIN = 0x1100;
-const CB_GSM_MESSAGEID_ETWS_END = 0x1107;
-
-const CB_GSM_GEOGRAPHICAL_SCOPE_NAMES = [
- "cell-immediate",
- "plmn",
- "location-area",
- "cell"
-];
-
-const CB_ETWS_WARNING_TYPE_NAMES = [
- "earthquake",
- "tsunami",
- "earthquake-tsunami",
- "test",
- "other"
-];
-
-const CB_DCS_LANG_GROUP_1 = [
- "de", "en", "it", "fr", "es", "nl", "sv", "da", "pt", "fi",
- "no", "el", "tr", "hu", "pl", null
-];
-const CB_DCS_LANG_GROUP_2 = [
- "cs", "he", "ar", "ru", "is", null, null, null, null, null,
- null, null, null, null, null, null
-];
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = 'head.js';
const CB_MAX_CONTENT_7BIT = Math.floor((CB_MESSAGE_SIZE_GSM - 6) * 8 / 7);
const CB_MAX_CONTENT_UCS2 = Math.floor((CB_MESSAGE_SIZE_GSM - 6) / 2);
@@ -70,412 +19,327 @@ const BODY_UCS2 = "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
+ "\u0000"; // 41 unicode chars.
const BODY_UCS2_IND = BODY_UCS2.substr(1);
-SpecialPowers.addPermission("cellbroadcast", true, document);
-SpecialPowers.addPermission("mobileconnection", true, document);
-
is(BODY_7BITS.length, CB_MAX_CONTENT_7BIT, "BODY_7BITS.length");
is(BODY_7BITS_IND.length, CB_MAX_CONTENT_7BIT - 3, "BODY_7BITS_IND.length");
is(BODY_UCS2.length, CB_MAX_CONTENT_UCS2, "BODY_UCS2.length");
-is(BODY_UCS2_IND.length, CB_MAX_CONTENT_UCS2 - 1, "BODY_UCS2_IND.length")
+is(BODY_UCS2_IND.length, CB_MAX_CONTENT_UCS2 - 1, "BODY_UCS2_IND.length");
-let cbs = window.navigator.mozCellBroadcast;
-ok(cbs instanceof window.MozCellBroadcast,
- "mozCellBroadcast is instanceof " + cbs.constructor);
-
-let pendingEmulatorCmdCount = 0;
-function sendCellBroadcastMessage(pdu, callback) {
- pendingEmulatorCmdCount++;
-
- let cmd = "cbs pdu " + pdu;
- runEmulatorCmd(cmd, function(result) {
- pendingEmulatorCmdCount--;
-
- is(result[0], "OK", "Emulator response");
-
- if (callback) {
- window.setTimeout(callback, 0);
- }
- });
-}
-
-function buildHexStr(n, numSemiOctets) {
- let str = n.toString(16);
- ok(str.length <= numSemiOctets);
- while (str.length < numSemiOctets) {
- str = "0" + str;
- }
- return str;
-}
-
-function seq(end, begin) {
- let result = [];
- for (let i = begin || 0; i < end; i++) {
- result.push(i);
- }
- return result;
-}
-
-function repeat(func, array, oncomplete) {
- (function do_call(index) {
- let next = index < (array.length - 1) ? do_call.bind(null, index + 1) : oncomplete;
- func.apply(null, [array[index], next]);
- })(0);
-}
-
-function doTestHelper(pdu, nextTest, checkFunc) {
- cbs.addEventListener("received", function onreceived(event) {
- cbs.removeEventListener("received", onreceived);
-
- checkFunc(event.message);
-
- window.setTimeout(nextTest, 0);
- });
-
- if (Array.isArray(pdu)) {
- repeat(sendCellBroadcastMessage, pdu);
- } else {
- sendCellBroadcastMessage(pdu);
- }
-}
-
-/**
- * Tests receiving Cell Broadcast messages, event instance type, all attributes
- * of CellBroadcastMessage exist.
- */
-function testGsmMessageAttributes() {
- log("Test GSM Cell Broadcast message attributes");
-
- cbs.addEventListener("received", function onreceived(event) {
- cbs.removeEventListener("received", onreceived);
-
- // Bug 838542: following check throws an exception and fails this case.
- // ok(event instanceof MozCellBroadcastEvent,
- // "event is instanceof " + event.constructor)
- ok(event, "event is valid");
-
- let message = event.message;
- ok(message, "event.message is valid");
+function testReceiving_GSM_MessageAttributes() {
+ log("Test receiving GSM Cell Broadcast - Message Attributes");
+ let verifyCBMessage = (aMessage) => {
// Attributes other than `language` and `body` should always be assigned.
- ok(message.gsmGeographicalScope != null, "message.gsmGeographicalScope");
- ok(message.messageCode != null, "message.messageCode");
- ok(message.messageId != null, "message.messageId");
- ok(message.language != null, "message.language");
- ok(message.body != null, "message.body");
- ok(message.messageClass != null, "message.messageClass");
- ok(message.timestamp != null, "message.timestamp");
- ok('etws' in message, "message.etws");
- if (message.etws) {
- ok('warningType' in message.etws, "message.etws.warningType");
- ok(message.etws.emergencyUserAlert != null, "message.etws.emergencyUserAlert");
- ok(message.etws.popup != null, "message.etws.popup");
+ ok(aMessage.gsmGeographicalScope != null, "aMessage.gsmGeographicalScope");
+ ok(aMessage.messageCode != null, "aMessage.messageCode");
+ ok(aMessage.messageId != null, "aMessage.messageId");
+ ok(aMessage.language != null, "aMessage.language");
+ ok(aMessage.body != null, "aMessage.body");
+ ok(aMessage.messageClass != null, "aMessage.messageClass");
+ ok(aMessage.timestamp != null, "aMessage.timestamp");
+ ok('etws' in aMessage, "aMessage.etws");
+ if (aMessage.etws) {
+ ok('warningType' in aMessage.etws, "aMessage.etws.warningType");
+ ok(aMessage.etws.emergencyUserAlert != null, "aMessage.etws.emergencyUserAlert");
+ ok(aMessage.etws.popup != null, "aMessage.etws.popup");
}
- ok(message.cdmaServiceCategory != null, "message.cdmaServiceCategory");
-
- window.setTimeout(testReceiving_GSM_GeographicalScope, 0);
- });
+ ok(aMessage.cdmaServiceCategory != null, "aMessage.cdmaServiceCategory");
+ };
// Here we use a simple GSM message for test.
let pdu = buildHexStr(0, CB_MESSAGE_SIZE_GSM * 2);
- sendCellBroadcastMessage(pdu);
+
+ return sendMultipleRawCbsToEmulatorAndWait([pdu])
+ .then((aMessage) => verifyCBMessage(aMessage));
}
function testReceiving_GSM_GeographicalScope() {
log("Test receiving GSM Cell Broadcast - Geographical Scope");
- function do_test(gs, nextTest) {
- let pdu = buildHexStr(((gs & 0x03) << 14), 4)
+ let promise = Promise.resolve();
+
+ let verifyCBMessage = (aMessage, aGsName) => {
+ is(aMessage.gsmGeographicalScope, aGsName,
+ "aMessage.gsmGeographicalScope");
+ };
+
+ CB_GSM_GEOGRAPHICAL_SCOPE_NAMES.forEach(function(aGsName, aIndex) {
+ let pdu = buildHexStr(((aIndex & 0x03) << 14), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 2) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aGsName));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.gsmGeographicalScope, CB_GSM_GEOGRAPHICAL_SCOPE_NAMES[gs],
- "message.gsmGeographicalScope");
- });
- }
-
- repeat(do_test, seq(CB_GSM_GEOGRAPHICAL_SCOPE_NAMES.length),
- testReceiving_GSM_MessageCode);
+ return promise;
}
function testReceiving_GSM_MessageCode() {
log("Test receiving GSM Cell Broadcast - Message Code");
+ let promise = Promise.resolve();
+
// Message Code has 10 bits, and is ORed into a 16 bits 'serial' number. Here
// we test every single bit to verify the operation doesn't go wrong.
- let messageCodesToTest = [
+ let messageCodes = [
0x000, 0x001, 0x002, 0x004, 0x008, 0x010, 0x020, 0x040,
0x080, 0x100, 0x200, 0x251
];
- function do_test(messageCode, nextTest) {
- let pdu = buildHexStr(((messageCode & 0x3FF) << 4), 4)
+ let verifyCBMessage = (aMessage, aMsgCode) => {
+ is(aMessage.messageCode, aMsgCode, "aMessage.messageCode");
+ };
+
+ messageCodes.forEach(function(aMsgCode) {
+ let pdu = buildHexStr(((aMsgCode & 0x3FF) << 4), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 2) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMsgCode));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageCode, messageCode, "message.messageCode");
- });
- }
-
- repeat(do_test, messageCodesToTest, testReceiving_GSM_MessageId);
+ return promise;
}
function testReceiving_GSM_MessageId() {
log("Test receiving GSM Cell Broadcast - Message Identifier");
+ let promise = Promise.resolve();
+
// Message Identifier has 16 bits, but no bitwise operation is needed.
// Test some selected values only.
- let messageIdsToTest = [
+ let messageIds = [
0x0000, 0x0001, 0x0010, 0x0100, 0x1000, 0x1111, 0x8888, 0x8811,
];
- function do_test(messageId, nextTest) {
+ let verifyCBMessage = (aMessage, aMessageId) => {
+ is(aMessage.messageId, aMessageId, "aMessage.messageId");
+ ok(aMessage.etws == null, "aMessage.etws");
+ };
+
+ messageIds.forEach(function(aMessageId) {
let pdu = buildHexStr(0, 4)
- + buildHexStr((messageId & 0xFFFF), 4)
+ + buildHexStr((aMessageId & 0xFFFF), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 4) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMessageId));
+ });
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageId, messageId, "message.messageId");
- ok(message.etws == null, "message.etws");
- });
- }
-
- repeat(do_test, messageIdsToTest, testReceiving_GSM_Language_and_Body);
-}
-
-// Copied from GsmPDUHelper.readCbDataCodingScheme
-function decodeDataCodingScheme(dcs) {
- let language = null;
- let hasLanguageIndicator = false;
- let encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
- let messageClass = PDU_DCS_MSG_CLASS_NORMAL;
-
- switch (dcs & PDU_DCS_CODING_GROUP_BITS) {
- case 0x00: // 0000
- language = CB_DCS_LANG_GROUP_1[dcs & 0x0F];
- break;
-
- case 0x10: // 0001
- switch (dcs & 0x0F) {
- case 0x00:
- hasLanguageIndicator = true;
- break;
- case 0x01:
- encoding = PDU_DCS_MSG_CODING_16BITS_ALPHABET;
- hasLanguageIndicator = true;
- break;
- }
- break;
-
- case 0x20: // 0010
- language = CB_DCS_LANG_GROUP_2[dcs & 0x0F];
- break;
-
- case 0x40: // 01xx
- case 0x50:
- //case 0x60:
- //case 0x70:
- case 0x90: // 1001
- encoding = (dcs & 0x0C);
- if (encoding == 0x0C) {
- encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
- }
- messageClass = (dcs & PDU_DCS_MSG_CLASS_BITS);
- break;
-
- case 0xF0:
- encoding = (dcs & 0x04) ? PDU_DCS_MSG_CODING_8BITS_ALPHABET
- : PDU_DCS_MSG_CODING_7BITS_ALPHABET;
- switch(dcs & PDU_DCS_MSG_CLASS_BITS) {
- case 0x01: messageClass = PDU_DCS_MSG_CLASS_USER_1; break;
- case 0x02: messageClass = PDU_DCS_MSG_CLASS_USER_2; break;
- case 0x03: messageClass = PDU_DCS_MSG_CLASS_TE_SPECIFIC; break;
- }
- break;
-
- case 0x30: // 0011 (Reserved)
- case 0x80: // 1000 (Reserved)
- case 0xA0: // 1010..1100 (Reserved)
- case 0xB0:
- case 0xC0:
- break;
- default:
- throw new Error("Unsupported CBS data coding scheme: " + dcs);
- }
-
- return [encoding, language, hasLanguageIndicator,
- GECKO_SMS_MESSAGE_CLASSES[messageClass]];
+ return promise;
}
function testReceiving_GSM_Language_and_Body() {
log("Test receiving GSM Cell Broadcast - Language & Body");
- function do_test(dcs) {
- let encoding, language, indicator, messageClass;
+ let promise = Promise.resolve();
+
+ let testDcs = [];
+ dcs = 0;
+ while (dcs <= 0xFF) {
try {
- [encoding, language, indicator, messageClass] = decodeDataCodingScheme(dcs);
+ let dcsInfo = { dcs: dcs };
+ [ dcsInfo.encoding, dcsInfo.language,
+ dcsInfo.indicator, dcsInfo.messageClass ] = decodeGsmDataCodingScheme(dcs);
+ testDcs.push(dcsInfo);
} catch (e) {
// Unsupported coding group, skip.
- let nextGroup = (dcs & PDU_DCS_CODING_GROUP_BITS) + 0x10;
- window.setTimeout(do_test.bind(null, nextGroup), 0);
- return;
+ let dcs = (dcs & PDU_DCS_CODING_GROUP_BITS) + 0x10;
}
-
- let pdu = buildHexStr(0, 8)
- + buildHexStr(dcs, 2)
- + buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 5) * 2);
-
- let nextTest = (dcs < 0xFF) ? do_test.bind(null, dcs + 1)
- : testReceiving_GSM_Timestamp;
- doTestHelper(pdu, nextTest, function(message) {
- if (language) {
- is(message.language, language, "message.language");
- } else if (indicator) {
- is(message.language, "@@", "message.language");
- } else {
- ok(message.language == null, "message.language");
- }
-
- switch (encoding) {
- case PDU_DCS_MSG_CODING_7BITS_ALPHABET:
- is(message.body, indicator ? BODY_7BITS_IND : BODY_7BITS, "message.body");
- break;
- case PDU_DCS_MSG_CODING_8BITS_ALPHABET:
- ok(message.body == null, "message.body");
- break;
- case PDU_DCS_MSG_CODING_16BITS_ALPHABET:
- is(message.body, indicator ? BODY_UCS2_IND : BODY_UCS2, "message.body");
- break;
- }
-
- is(message.messageClass, messageClass, "message.messageClass");
- });
+ dcs++;
}
- do_test(0);
+ let verifyCBMessage = (aMessage, aDcsInfo) => {
+ if (aDcsInfo.language) {
+ is(aMessage.language, aDcsInfo.language, "aMessage.language");
+ } else if (aDcsInfo.indicator) {
+ is(aMessage.language, "@@", "aMessage.language");
+ } else {
+ ok(aMessage.language == null, "aMessage.language");
+ }
+
+ switch (aDcsInfo.encoding) {
+ case PDU_DCS_MSG_CODING_7BITS_ALPHABET:
+ is(aMessage.body, aDcsInfo.indicator ? BODY_7BITS_IND : BODY_7BITS, "aMessage.body");
+ break;
+ case PDU_DCS_MSG_CODING_8BITS_ALPHABET:
+ ok(aMessage.body == null, "aMessage.body");
+ break;
+ case PDU_DCS_MSG_CODING_16BITS_ALPHABET:
+ is(aMessage.body, aDcsInfo.indicator ? BODY_UCS2_IND : BODY_UCS2, "aMessage.body");
+ break;
+ }
+
+ is(aMessage.messageClass, aDcsInfo.messageClass, "aMessage.messageClass");
+ };
+
+ testDcs.forEach(function(aDcsInfo) {
+ let pdu = buildHexStr(0, 8)
+ + buildHexStr(aDcsInfo.dcs, 2)
+ + buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 5) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aDcsInfo));
+ });
+
+ return promise;
}
function testReceiving_GSM_Timestamp() {
log("Test receiving GSM Cell Broadcast - Timestamp");
- let pdu = buildHexStr(0, CB_MESSAGE_SIZE_GSM * 2);
- doTestHelper(pdu, testReceiving_GSM_WarningType, function(message) {
+ let verifyCBMessage = (aMessage) => {
// 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;
+ let msMessage = aMessage.timestamp;
let msNow = Date.now();
- ok(Math.abs(msMessage - msNow) < (1000 * 60), "message.timestamp");
- });
+ ok(Math.abs(msMessage - msNow) < (1000 * 60), "aMessage.timestamp");
+ };
+
+ let pdu = buildHexStr(0, CB_MESSAGE_SIZE_GSM * 2);
+
+ return sendMultipleRawCbsToEmulatorAndWait([pdu])
+ .then((aMessage) => verifyCBMessage(aMessage));
}
function testReceiving_GSM_WarningType() {
log("Test receiving GSM Cell Broadcast - Warning Type");
- let messageIdsToTest = [];
+ let promise = Promise.resolve();
+
+ let messageIds = [];
for (let i = CB_GSM_MESSAGEID_ETWS_BEGIN; i <= CB_GSM_MESSAGEID_ETWS_END; i++) {
- messageIdsToTest.push(i);
+ messageIds.push(i);
}
- function do_test(messageId, nextTest) {
+ let verifyCBMessage = (aMessage, aMessageId) => {
+ is(aMessage.messageId, aMessageId, "aMessage.messageId");
+ ok(aMessage.etws != null, "aMessage.etws");
+
+ let offset = aMessageId - CB_GSM_MESSAGEID_ETWS_BEGIN;
+ if (offset < CB_ETWS_WARNING_TYPE_NAMES.length) {
+ is(aMessage.etws.warningType, CB_ETWS_WARNING_TYPE_NAMES[offset],
+ "aMessage.etws.warningType");
+ } else {
+ ok(aMessage.etws.warningType == null, "aMessage.etws.warningType");
+ }
+ };
+
+ messageIds.forEach(function(aMessageId) {
let pdu = buildHexStr(0, 4)
- + buildHexStr((messageId & 0xFFFF), 4)
+ + buildHexStr((aMessageId & 0xFFFF), 4)
+ buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 4) * 2);
-
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageId, messageId, "message.messageId");
- ok(message.etws != null, "message.etws");
-
- let offset = messageId - CB_GSM_MESSAGEID_ETWS_BEGIN;
- if (offset < CB_ETWS_WARNING_TYPE_NAMES.length) {
- is(message.etws.warningType, CB_ETWS_WARNING_TYPE_NAMES[offset],
- "message.etws.warningType");
- } else {
- ok(message.etws.warningType == null, "message.etws.warningType");
- }
- });
- }
-
- repeat(do_test, messageIdsToTest, testReceiving_GSM_EmergencyUserAlert);
-}
-
-function doTestEmergencyUserAlert_or_Popup(name, mask, nextTest) {
- let pdu = buildHexStr(mask, 4)
- + buildHexStr(CB_GSM_MESSAGEID_ETWS_BEGIN, 4)
- + buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 4) * 2);
-
- doTestHelper(pdu, nextTest, function(message) {
- is(message.messageId, CB_GSM_MESSAGEID_ETWS_BEGIN, "message.messageId");
- ok(message.etws != null, "message.etws");
- is(message.etws[name], mask != 0, "message.etws." + name);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMessageId));
});
+
+ return promise;
}
function testReceiving_GSM_EmergencyUserAlert() {
log("Test receiving GSM Cell Broadcast - Emergency User Alert");
- repeat(doTestEmergencyUserAlert_or_Popup.bind(null, "emergencyUserAlert"),
- [0x2000, 0x0000], testReceiving_GSM_Popup);
+ let promise = Promise.resolve();
+
+ let emergencyUserAlertMasks = [0x2000, 0x0000];
+
+ let verifyCBMessage = (aMessage, aMask) => {
+ is(aMessage.messageId, CB_GSM_MESSAGEID_ETWS_BEGIN, "aMessage.messageId");
+ ok(aMessage.etws != null, "aMessage.etws");
+ is(aMessage.etws.emergencyUserAlert, aMask != 0, "aMessage.etws.emergencyUserAlert");
+ };
+
+ emergencyUserAlertMasks.forEach(function(aMask) {
+ let pdu = buildHexStr(aMask, 4)
+ + buildHexStr(CB_GSM_MESSAGEID_ETWS_BEGIN, 4)
+ + buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 4) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMask));
+ });
+
+ return promise;
}
function testReceiving_GSM_Popup() {
log("Test receiving GSM Cell Broadcast - Popup");
- repeat(doTestEmergencyUserAlert_or_Popup.bind(null, "popup"),
- [0x1000, 0x0000], testReceiving_GSM_Multipart);
+ let promise = Promise.resolve();
+
+ let popupMasks = [0x1000, 0x0000];
+
+ let verifyCBMessage = (aMessage, aMask) => {
+ is(aMessage.messageId, CB_GSM_MESSAGEID_ETWS_BEGIN, "aMessage.messageId");
+ ok(aMessage.etws != null, "aMessage.etws");
+ is(aMessage.etws.popup, aMask != 0, "aMessage.etws.popup");
+ };
+
+ popupMasks.forEach(function(aMask) {
+ let pdu = buildHexStr(aMask, 4)
+ + buildHexStr(CB_GSM_MESSAGEID_ETWS_BEGIN, 4)
+ + buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 4) * 2);
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, aMask));
+ });
+
+ return promise;
}
function testReceiving_GSM_Multipart() {
log("Test receiving GSM Cell Broadcast - Multipart Messages");
- function do_test(numParts, nextTest) {
+ let promise = Promise.resolve();
+
+ // According to 9.4.1.2.4 Page Parameter in TS 23.041, the maximal Number of
+ // pages per CB message is 15.
+ let numParts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+
+ let verifyCBMessage = (aMessage, aNumParts) => {
+ is(aMessage.body.length, (aNumParts * CB_MAX_CONTENT_7BIT),
+ "aMessage.body");
+ };
+
+ numParts.forEach(function(aNumParts) {
let pdus = [];
- for (let i = 1; i <= numParts; i++) {
+ for (let i = 1; i <= aNumParts; i++) {
let pdu = buildHexStr(0, 10)
- + buildHexStr((i << 4) + numParts, 2)
+ + buildHexStr((i << 4) + aNumParts, 2)
+ buildHexStr(0, (CB_MESSAGE_SIZE_GSM - 6) * 2);
pdus.push(pdu);
}
+ promise = promise
+ .then(() => sendMultipleRawCbsToEmulatorAndWait(pdus))
+ .then((aMessage) => verifyCBMessage(aMessage, aNumParts));
+ });
- doTestHelper(pdus, nextTest, function(message) {
- is(message.body.length, (numParts * CB_MAX_CONTENT_7BIT),
- "message.body");
- });
- }
-
- repeat(do_test, seq(16, 1), testReceiving_GSM_ServiceCategory);
+ return promise;
}
function testReceiving_GSM_ServiceCategory() {
log("Test receiving GSM Cell Broadcast - Service Category");
- cbs.addEventListener("received", function onreceived(event) {
- cbs.removeEventListener("received", onreceived);
-
- let message = event.message;
-
+ let verifyCBMessage = (aMessage) => {
// Bug 910091
// "Service Category" is not defined in GSM. We should always get '0' here.
- is(message.cdmaServiceCategory, 0, "message.cdmaServiceCategory");
-
- window.setTimeout(cleanUp, 0);
- });
+ is(aMessage.cdmaServiceCategory, 0, "aMessage.cdmaServiceCategory");
+ };
let pdu = buildHexStr(0, CB_MESSAGE_SIZE_GSM * 2);
- sendCellBroadcastMessage(pdu);
+ return sendMultipleRawCbsToEmulatorAndWait([pdu])
+ .then((aMessage) => verifyCBMessage(aMessage));
}
-function cleanUp() {
- if (pendingEmulatorCmdCount > 0) {
- window.setTimeout(cleanUp, 100);
- return;
- }
-
- SpecialPowers.removePermission("mobileconnection", document);
- SpecialPowers.removePermission("cellbroadcast", true, document);
-
- finish();
-}
-
-waitFor(testGsmMessageAttributes, function() {
- return navigator.mozMobileConnections[0].voice.connected;
+startTestCommon(function testCaseMain() {
+ return testReceiving_GSM_MessageAttributes()
+ .then(() => testReceiving_GSM_GeographicalScope())
+ .then(() => testReceiving_GSM_MessageCode())
+ .then(() => testReceiving_GSM_MessageId())
+ .then(() => testReceiving_GSM_Language_and_Body())
+ .then(() => testReceiving_GSM_Timestamp())
+ .then(() => testReceiving_GSM_WarningType())
+ .then(() => testReceiving_GSM_EmergencyUserAlert())
+ .then(() => testReceiving_GSM_Popup())
+ .then(() => testReceiving_GSM_Multipart())
+ .then(() => testReceiving_GSM_ServiceCategory());
});
-
diff --git a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_multi_sim.js b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_multi_sim.js
index b89b54f7a13..e102045ecdf 100644
--- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_multi_sim.js
+++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_multi_sim.js
@@ -1,19 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
-MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_TIMEOUT = 10000;
MARIONETTE_HEAD_JS = 'head.js';
const BODY_7BITS = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+ "@@@@@@@@@@@@@"; // 93 ascii chars.
-const CB_PDU_SIZE = 88;
-function testReceivingMultiSIM() {
- let CB_PDU = "";
- while (CB_PDU.length < CB_PDU_SIZE * 2) {
- CB_PDU += "00";
- }
+function testReceiving_MultiSIM() {
+ log("Test receiving GSM Cell Broadcast - Multi-SIM");
+
+ let pdu = buildHexStr(0, CB_MESSAGE_SIZE_GSM * 2);
let verifyCBMessage = (aMessage, aServiceId) => {
log("Verify CB message received from serviceId: " + aServiceId);
@@ -22,13 +20,13 @@ function testReceivingMultiSIM() {
};
return selectModem(1)
- .then(() => sendMultipleRawCbsToEmulatorAndWait([CB_PDU]))
- .then((results) => verifyCBMessage(results[0].message, 1))
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, 1))
.then(() => selectModem(0))
- .then(() => sendMultipleRawCbsToEmulatorAndWait([CB_PDU]))
- .then((results) => verifyCBMessage(results[0].message, 0));
+ .then(() => sendMultipleRawCbsToEmulatorAndWait([pdu]))
+ .then((aMessage) => verifyCBMessage(aMessage, 0));
}
startTestCommon(function testCaseMain() {
- return runIfMultiSIM(testReceivingMultiSIM);
+ return runIfMultiSIM(testReceiving_MultiSIM);
});
From c2ca57f8a483fff618114087f8286b2d909bd6b2 Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 05:55:27 -0700
Subject: [PATCH 22/67] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump
========
https://hg.mozilla.org/integration/gaia-central/rev/591e51dda968
Author: Zac
Desc: Merge pull request #21284 from zacc/bug_1030819
Bug 1030819 - Move plivo requirement into the test's requirements file
========
https://hg.mozilla.org/integration/gaia-central/rev/15629ab11cb5
Author: Zac
Desc: Bug 1030819 - Move plivo requirement into the test's requirements file
========
https://hg.mozilla.org/integration/gaia-central/rev/e9b2368c02f9
Author: Steve Chung
Desc: Bug 1033260 - [Messages] Contact suggestion list didn't dismiss when focus on subject and message input field r=julien,azasypkin
---
b2g/config/gaia.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 21463c3e1d5..caa1185c7b2 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "49b832dfafe531bdf42cf54e6fb7f76cf659fcc1",
+ "revision": "591e51dda96842f6ed6c6b8f903ff3e853f34db8",
"repo_path": "/integration/gaia-central"
}
From c4b98c9ac8ab65b1d4a46fa74b8593d52ebe37bc Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 05:56:48 -0700
Subject: [PATCH 23/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/helix/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index ab6518a2057..da9ddfc1c28 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index fa7634b159a..9df09924abe 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index ca38e19f0b1..22d904cfff2 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index ab6518a2057..da9ddfc1c28 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index d1ec52a0d1f..8dd5529a647 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 58a27a7b77b..8e1f7c465e0 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index e91872ce20f..dce5932b00d 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 7bd3bc925c3..27555df23fc 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 64442180e50..ab1e83bf6d9 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
From a12bb70330e26fb98fdf47709d20767373cf26bb Mon Sep 17 00:00:00 2001
From: B2G Bumper Bot
Date: Tue, 8 Jul 2014 06:26:44 -0700
Subject: [PATCH 24/67] Bumping manifests a=b2g-bump
---
b2g/config/emulator-ics/sources.xml | 2 +-
b2g/config/emulator-jb/sources.xml | 2 +-
b2g/config/emulator-kk/sources.xml | 2 +-
b2g/config/emulator/sources.xml | 2 +-
b2g/config/flame/sources.xml | 2 +-
b2g/config/hamachi/sources.xml | 2 +-
b2g/config/nexus-4/sources.xml | 2 +-
b2g/config/wasabi/sources.xml | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index da9ddfc1c28..f0be404f241 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 9df09924abe..475c58a9482 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 22d904cfff2..296447fbd3b 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -23,7 +23,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index da9ddfc1c28..f0be404f241 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 8dd5529a647..86fe6c09269 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 8e1f7c465e0..838dbe8a2c0 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -22,7 +22,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 27555df23fc..02c1b3ee16c 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index ab1e83bf6d9..c722d9629cb 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -22,7 +22,7 @@
-
+
From a8fc8abfed2e8babacb9e97392643c77136c3972 Mon Sep 17 00:00:00 2001
From: Jan Jongboom
Date: Wed, 25 Jun 2014 07:58:00 -0400
Subject: [PATCH 25/67] Bug 957213 - Rewrite tests for inputmethod to avoid
intermittent errors. r=yxl
---
.../mochitest/file_inputmethod.html | 25 ++--
dom/inputmethod/mochitest/mochitest.ini | 1 +
dom/inputmethod/mochitest/test_bug944397.html | 138 +++++++++---------
dom/inputmethod/mochitest/test_bug953044.html | 52 +++++++
4 files changed, 138 insertions(+), 78 deletions(-)
create mode 100644 dom/inputmethod/mochitest/test_bug953044.html
diff --git a/dom/inputmethod/mochitest/file_inputmethod.html b/dom/inputmethod/mochitest/file_inputmethod.html
index f228a8d8d12..193cb050567 100644
--- a/dom/inputmethod/mochitest/file_inputmethod.html
+++ b/dom/inputmethod/mochitest/file_inputmethod.html
@@ -3,15 +3,22 @@
+Mozilla Bug 953044
+
+
+
+
+
diff --git a/dom/inputmethod/mochitest/mochitest.ini b/dom/inputmethod/mochitest/mochitest.ini
index 41bf6ee7156..54833ddd560 100644
--- a/dom/inputmethod/mochitest/mochitest.ini
+++ b/dom/inputmethod/mochitest/mochitest.ini
@@ -11,6 +11,7 @@ support-files =
[test_basic.html]
[test_bug944397.html]
[test_bug949059.html]
+[test_bug953044.html]
[test_bug960946.html]
[test_bug978918.html]
[test_bug1026997.html]
diff --git a/dom/inputmethod/mochitest/test_bug944397.html b/dom/inputmethod/mochitest/test_bug944397.html
index 8f9647dca34..ee7000ab5f4 100644
--- a/dom/inputmethod/mochitest/test_bug944397.html
+++ b/dom/inputmethod/mochitest/test_bug944397.html
@@ -23,85 +23,85 @@ inputmethod_setup(function() {
function appFrameScript() {
let input = content.document.getElementById('test-input');
input.oninput = function() {
- dump('oninput was called in file_test_app.html.');
- sendAsyncMessage('test:InputMethod:oninput', {});
+ sendAsyncMessage('test:InputMethod:oninput', {
+ value: input.value
+ });
};
-
- /*
- * Bug 957213. Sometimes we need to refocus the input field to avoid
- * intermittent test failure.
- */
- content.setInterval(function() {
- input.focus();
- }, 500);
}
function runTest() {
- let timeoutId = null;
+ let app, keyboard;
- // Create an app frame to recieve keyboard inputs.
- let app = document.createElement('iframe');
- app.src = 'file_test_app.html';
- app.setAttribute('mozbrowser', true);
- document.body.appendChild(app);
- app.addEventListener('mozbrowserloadend', function() {
- let mm = SpecialPowers.getBrowserFrameMessageManager(app);
- mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
- mm.addMessageListener("test:InputMethod:oninput", function() {
- ok(true, 'Keyboard input was received.');
- clearTimeout(timeoutId);
- inputmethod_cleanup();
- });
- });
-
- // Create a browser frame to load the input method app.
- let keyboard = document.createElement('iframe');
- keyboard.setAttribute('mozbrowser', true);
- document.body.appendChild(keyboard);
-
- // Bug 953044 setInputMethodActive(false) before input method app loads should
- // always succeed.
- let req = keyboard.setInputMethodActive(false);
- req.onsuccess = function() {
- ok(true, 'setInputMethodActive before loading succeeded.');
- };
-
- req.onerror = function() {
- ok(false, 'setInputMethodActive before loading failed: ' + this.error.name);
- clearTimeout(timeoutId);
- inputmethod_cleanup();
- };
+ /**
+ * So this test does the following:
+ * 1. Create a mozbrowser iframe with a text field in it, and focus the text field
+ * 2. 100ms. after loading we create new keyboard iframe, that will try to execute
+ * replaceSurroundingText on the current active inputcontext
+ * 3. That should trigger 'input' event on the said text field
+ * 4. And if that happens we know everything is OK
+ */
let path = location.pathname;
- let imeUrl = location.protocol + '//' + location.host +
- path.substring(0, path.lastIndexOf('/')) +
- '/file_inputmethod.html#data';
- SpecialPowers.pushPermissions([{
- type: 'input',
- allow: true,
- context: imeUrl
- }], function() {
- let req = keyboard.setInputMethodActive(true);
+ let basePath = location.protocol + '//' + location.host +
+ path.substring(0, path.lastIndexOf('/'));
- req.onsuccess = function() {
- ok(true, 'setInputMethodActive succeeded.');
- };
+ // STEP 1: Create an app frame to recieve keyboard inputs.
+ function step1() {
+ app = document.createElement('iframe');
+ app.src = basePath + '/file_test_app.html';
+ app.setAttribute('mozbrowser', true);
+ document.body.appendChild(app);
+ app.addEventListener('mozbrowserloadend', function() {
+ let mm = SpecialPowers.getBrowserFrameMessageManager(app);
+ mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
+ mm.addMessageListener("test:InputMethod:oninput", function(ev) {
+ step4(SpecialPowers.wrap(ev).json.value);
+ });
- req.onerror = function() {
- ok(false, 'setInputMethodActive failed: ' + this.error.name);
- inputmethod_cleanup();
- };
+ step2();
+ });
+ }
- // Loads the input method app to the browser frame after a delay.
- SpecialPowers.DOMWindowUtils.focus(app);
- setTimeout(function() {
- keyboard.src = imeUrl;
- timeoutId = setTimeout(function() {
- inputmethod_cleanup();
- ok(false, 'Failed to generate keyboard input.');
- }, 20000);
- }, 100);
- });
+ function step2() {
+ // STEP 2a: Create a browser frame to load the input method app.
+ keyboard = document.createElement('iframe');
+ keyboard.setAttribute('mozbrowser', true);
+ document.body.appendChild(keyboard);
+
+ // STEP 2b: Grant input privileges to the keyboard iframe
+ let imeUrl = basePath + '/file_inputmethod.html#data';
+
+ SpecialPowers.pushPermissions([{
+ type: 'input',
+ allow: true,
+ context: imeUrl
+ }], function() {
+ // STEP 2c: Tell Gecko to use this iframe as its keyboard app
+ let req = keyboard.setInputMethodActive(true);
+
+ req.onsuccess = function() {
+ ok(true, 'setInputMethodActive succeeded.');
+ };
+
+ req.onerror = function() {
+ ok(false, 'setInputMethodActive failed: ' + this.error.name);
+ inputmethod_cleanup();
+ };
+
+ // STEP 3: Loads the input method app to the browser frame after a delay.
+ setTimeout(function() {
+ keyboard.src = imeUrl;
+ }, 100);
+ });
+ }
+
+ function step4(val) {
+ ok(true, 'Keyboard input was received.');
+ is(val, '#dataYuan', 'Input value');
+ inputmethod_cleanup();
+ }
+
+ step1();
}
diff --git a/dom/inputmethod/mochitest/test_bug953044.html b/dom/inputmethod/mochitest/test_bug953044.html
new file mode 100644
index 00000000000..45625923b6e
--- /dev/null
+++ b/dom/inputmethod/mochitest/test_bug953044.html
@@ -0,0 +1,52 @@
+
+
+
+