Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2014-06-17 14:35:35 +02:00
Родитель 10e671ad1a 1526ee8c2b
Коммит 292644462f
292 изменённых файлов: 2990 добавлений и 15781 удалений

Просмотреть файл

@ -38,6 +38,7 @@
#include "nsTableOuterFrame.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
@ -869,15 +870,10 @@ HTMLTableAccessible::Description(nsString& aDescription)
bool
HTMLTableAccessible::HasDescendant(const nsAString& aTagName, bool aAllowEmpty)
{
nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mContent));
NS_ENSURE_TRUE(tableElt, false);
nsCOMPtr<nsIHTMLCollection> elements =
mContent->AsElement()->GetElementsByTagName(aTagName);
nsCOMPtr<nsIDOMHTMLCollection> nodeList;
tableElt->GetElementsByTagName(aTagName, getter_AddRefs(nodeList));
NS_ENSURE_TRUE(nodeList, false);
nsCOMPtr<nsIDOMNode> foundItem;
nodeList->Item(0, getter_AddRefs(foundItem));
Element* foundItem = elements->Item(0);
if (!foundItem)
return false;
@ -886,11 +882,10 @@ HTMLTableAccessible::HasDescendant(const nsAString& aTagName, bool aAllowEmpty)
// Make sure that the item we found has contents and either has multiple
// children or the found item is not a whitespace-only text node.
nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
if (foundItemContent->GetChildCount() > 1)
if (foundItem->GetChildCount() > 1)
return true; // Treat multiple child nodes as non-empty
nsIContent *innerItemContent = foundItemContent->GetFirstChild();
nsIContent *innerItemContent = foundItem->GetFirstChild();
if (innerItemContent && !innerItemContent->TextIsOnlyWhitespace())
return true;
@ -901,8 +896,7 @@ HTMLTableAccessible::HasDescendant(const nsAString& aTagName, bool aAllowEmpty)
// caption element only. On another hand we create accessible object for
// the first entry of caption element (see
// HTMLTableAccessible::CacheChildren).
nodeList->Item(1, getter_AddRefs(foundItem));
return !!foundItem;
return !!elements->Item(1);
}
bool

Просмотреть файл

@ -585,8 +585,7 @@ var shell = {
return;
}
this.sendEvent(getContentWindow(), "mozChromeEvent",
Cu.cloneInto(details, getContentWindow()));
this.sendCustomEvent("mozChromeEvent", details);
},
receiveMessage: function shell_receiveMessage(message) {
@ -760,16 +759,11 @@ var WebappsHelper = {
let manifest = new ManifestHelper(aManifest, json.origin);
let payload = {
__exposedProps__: {
timestamp: "r",
url: "r",
manifestURL: "r"
},
timestamp: json.timestamp,
url: manifest.fullLaunchPath(json.startPoint),
manifestURL: json.manifestURL
}
shell.sendEvent(getContentWindow(), "webapps-launch", payload);
};
shell.sendCustomEvent("webapps-launch", payload);
});
break;
case "webapps-ask-install":
@ -781,11 +775,9 @@ var WebappsHelper = {
});
break;
case "webapps-close":
shell.sendEvent(getContentWindow(), "webapps-close",
{
__exposedProps__: { "manifestURL": "r" },
"manifestURL": json.manifestURL
});
shell.sendCustomEvent("webapps-close", {
"manifestURL": json.manifestURL
});
break;
}
}
@ -984,11 +976,7 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
context.drawWindow(window, 0, 0, width, height,
'rgb(255,255,255)', flags);
// I can't use sendChromeEvent() here because it doesn't wrap
// the blob in the detail object correctly. So I use __exposedProps__
// instead to safely send the chrome detail object to content.
shell.sendEvent(getContentWindow(), 'mozChromeEvent', {
__exposedProps__: { type: 'r', file: 'r' },
shell.sendChromeEvent({
type: 'take-screenshot-success',
file: canvas.mozGetAsFile('screenshot', 'image/png')
});

Просмотреть файл

@ -19,11 +19,11 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="eb0c93761bb9919567257d19bf25fa433cda3c00"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="3326b51017252e09ccdd715dec6c5e12a7d1ecfe"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c9cc24ebbfa5427defcc4c99d4d08c2ee6cbcea8"/>
<!-- Stock Android things -->
@ -103,6 +103,6 @@
<project name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="d2685281e2e54ca14d1df304867aa82c37b27162"/>
<project name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="acba00cdb4596c6dcb61ed06f14cf4ec89623539"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="bce69473f3d63ab927442f4301f5fb4833d20008"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="4f46930827957afbce500a4a920755a218bf3155"/>
</manifest>

Просмотреть файл

@ -17,8 +17,8 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c9cc24ebbfa5427defcc4c99d4d08c2ee6cbcea8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
@ -112,7 +112,7 @@
<project name="platform/ndk" path="ndk" revision="7666b97bbaf1d645cdd6b4430a367b7a2bb53369"/>
<project name="platform/prebuilts/misc" path="prebuilts/misc" revision="f6ab40b3257abc07741188fd173ac392575cc8d2"/>
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="e52099755d0bd3a579130eefe8e58066cc6c0cb6"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="bce69473f3d63ab927442f4301f5fb4833d20008"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>
@ -128,7 +128,7 @@
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="0e31f35a2a77301e91baa8a237aa9e9fa4076084"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="cba8ebe395652e62a911d885cd6ac1bb4ad3ed57"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="ab6da65e9642e66b3a4cebc9d733975f8a318de7"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="832f4acaf481a19031e479a40b03d9ce5370ddee"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>

Просмотреть файл

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>

Просмотреть файл

@ -19,11 +19,11 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="eb0c93761bb9919567257d19bf25fa433cda3c00"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="3326b51017252e09ccdd715dec6c5e12a7d1ecfe"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c9cc24ebbfa5427defcc4c99d4d08c2ee6cbcea8"/>
<!-- Stock Android things -->
@ -103,6 +103,6 @@
<project name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="d2685281e2e54ca14d1df304867aa82c37b27162"/>
<project name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="acba00cdb4596c6dcb61ed06f14cf4ec89623539"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="bce69473f3d63ab927442f4301f5fb4833d20008"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="4f46930827957afbce500a4a920755a218bf3155"/>
</manifest>

Просмотреть файл

@ -17,8 +17,8 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c9cc24ebbfa5427defcc4c99d4d08c2ee6cbcea8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

Просмотреть файл

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "99d5a7c6f3b1d9c04dceda9b235bc5ff0c12b866",
"revision": "d25f3c113e3543c8f15143a858f8e9d880dfc071",
"repo_path": "/integration/gaia-central"
}

Просмотреть файл

@ -17,8 +17,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>

Просмотреть файл

@ -15,8 +15,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>

Просмотреть файл

@ -17,8 +17,8 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c9cc24ebbfa5427defcc4c99d4d08c2ee6cbcea8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
@ -112,7 +112,7 @@
<project name="platform/ndk" path="ndk" revision="7666b97bbaf1d645cdd6b4430a367b7a2bb53369"/>
<project name="platform/prebuilts/misc" path="prebuilts/misc" revision="f6ab40b3257abc07741188fd173ac392575cc8d2"/>
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="e52099755d0bd3a579130eefe8e58066cc6c0cb6"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="bce69473f3d63ab927442f4301f5fb4833d20008"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>

Просмотреть файл

@ -17,8 +17,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="eac13407742a55b11e1877b4df2abdfd22cd582e"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="27b2c2ef9a50d5dc79b6a771b3a3c775a888d13b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83392cae2c964fa6f8a97ac3fc515c3f94ef3c1c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>

Просмотреть файл

@ -112,6 +112,11 @@ var tests = {
iconURL: "chrome://browser/skin/Info.png",
counter: 1
};
// Disable the transition
let panel = document.getElementById("social-notification-panel");
panel.setAttribute("animate", "false");
// click on panel to open and wait for visibility
let provider = Social._getProviderFromOrigin(manifest2.origin);
let id = SocialStatus._toolbarHelper.idFromOrigin(manifest2.origin);
@ -131,8 +136,8 @@ var tests = {
case "got-social-panel-visibility":
ok(true, "got the panel message " + e.data.result);
if (e.data.result == "shown") {
let panel = document.getElementById("social-notification-panel");
panel.hidePopup();
panel.removeAttribute("animate");
} else {
port.postMessage({topic: "test-ambient-notification", data: icon});
port.close();

Просмотреть файл

@ -63,11 +63,14 @@ function checkProviderPrefsEmpty(isError) {
}
function defaultFinishChecks() {
PopupNotifications.transitionsEnabled = true;
checkProviderPrefsEmpty(true);
finish();
}
function runSocialTestWithProvider(manifest, callback, finishcallback) {
PopupNotifications.transitionsEnabled = false;
let SocialService = Cu.import("resource://gre/modules/SocialService.jsm", {}).SocialService;
let manifests = Array.isArray(manifest) ? manifest : [manifest];
@ -158,6 +161,8 @@ function runSocialTests(tests, cbPreTest, cbPostTest, cbFinish) {
let providersAtStart = Social.providers.length;
info("runSocialTests: start test run with " + providersAtStart + " providers");
PopupNotifications.transitionsEnabled = false;
if (cbPreTest === undefined) {
cbPreTest = function(cb) {cb()};
}

Просмотреть файл

@ -7,7 +7,6 @@
type="arrow"
hidden="true"
flip="slide"
animate="false"
position="bottomcenter topright"
noautofocus="true">
<panelmultiview id="PanelUI-multiView" mainViewId="PanelUI-mainView">

Просмотреть файл

@ -515,8 +515,8 @@ class Automation(object):
env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:3')
env.setdefault('R_LOG_LEVEL', '5')
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')

Просмотреть файл

@ -54,6 +54,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
JAR_MANIFEST \
JAVA_JAR_TARGETS \
JS_MODULES_PATH \
LD_VERSION_SCRIPT \
LIBRARY_NAME \
MODULE \
MSVC_ENABLE_PGO \

Просмотреть файл

@ -510,6 +510,10 @@ ifeq ($(OS_ARCH),Linux)
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
endif
ifdef LD_VERSION_SCRIPT
EXTRA_DSO_LDOPTS += -Wl,--version-script,$(LD_VERSION_SCRIPT)
EXTRA_DEPS += $(LD_VERSION_SCRIPT)
endif
endif
#
@ -1020,6 +1024,10 @@ $(filter %.s,$(CPPSRCS:%.cc=%.s)): %.s: %.cc $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(filter %.s,$(CPPSRCS:%.cxx=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(filter %.s,$(CSRCS:%.c=%.s)): %.s: %.c $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
@ -1035,6 +1043,7 @@ ifneq (,$(filter %.i,$(MAKECMDGOALS)))
_group_srcs = $(sort $(patsubst %.$1,%.i,$(filter %.$1,$2 $(notdir $2))))
_PREPROCESSED_CPP_FILES := $(call _group_srcs,cpp,$(CPPSRCS))
_PREPROCESSED_CC_FILES := $(call _group_srcs,cc,$(CPPSRCS))
_PREPROCESSED_CXX_FILES := $(call _group_srcs,cxx,$(CPPSRCS))
_PREPROCESSED_C_FILES := $(call _group_srcs,c,$(CSRCS))
_PREPROCESSED_CMM_FILES := $(call _group_srcs,mm,$(CMMSRCS))
@ -1044,7 +1053,7 @@ VPATH += $(addprefix $(srcdir)/,$(sort $(dir $(CPPSRCS) $(CSRCS) $(CMMSRCS))))
# Make preprocessed files PHONY so they are always executed, since they are
# manual targets and we don't necessarily write to $@.
.PHONY: $(_PREPROCESSED_CPP_FILES) $(_PREPROCESSED_CC_FILES) $(_PREPROCESSED_C_FILES) $(_PREPROCESSED_CMM_FILES)
.PHONY: $(_PREPROCESSED_CPP_FILES) $(_PREPROCESSED_CC_FILES) $(_PREPROCESSED_CXX_FILES) $(_PREPROCESSED_C_FILES) $(_PREPROCESSED_CMM_FILES)
$(_PREPROCESSED_CPP_FILES): %.i: %.cpp $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
@ -1056,6 +1065,11 @@ $(_PREPROCESSED_CC_FILES): %.i: %.cc $(call mkdir_deps,$(MDDEPDIR))
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
$(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(_PREPROCESSED_CXX_FILES): %.i: %.cxx $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
$(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(_PREPROCESSED_C_FILES): %.i: %.c $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
@ -1074,7 +1088,7 @@ PP_UNIFIED ?= 1
# infinite loop if the filename doesn't exist in the unified source files.
ifndef PP_REINVOKE
MATCH_cpp = \(cpp\|cc\)
MATCH_cpp = \(cpp\|cc|cxx\)
UPPER_c = C
UPPER_cpp = CPP
UPPER_mm = CMM

Просмотреть файл

@ -2928,7 +2928,7 @@ dnl Checks for library functions.
dnl ========================================================
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r)
AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r arc4random arc4random_buf)
dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
@ -3589,7 +3589,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
_USE_SYSTEM_NSS=1 )
if test -n "$_USE_SYSTEM_NSS"; then
AM_PATH_NSS(3.16, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
AM_PATH_NSS(3.16.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
fi
if test -n "$MOZ_NATIVE_NSS"; then
@ -8803,6 +8803,7 @@ AC_SUBST(CPU_ARCH)
AC_SUBST(INTEL_ARCHITECTURE)
AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
AC_SUBST(GCC_USE_GNU_LD)
AC_SUBST(MOZ_CHROME_FILE_FORMAT)

Просмотреть файл

@ -1350,6 +1350,8 @@ private:
// Set if the element has a parser insertion mode other than "in body",
// per the HTML5 "Parse state" section.
ElementHasWeirdParserInsertionMode,
// Parser sets this flag if it has notified about the node.
ParserHasNotified,
// Guard value
BooleanFlagCount
};
@ -1490,6 +1492,8 @@ public:
bool IsScopedStyleRoot() { return GetBoolFlag(ElementIsScopedStyleRoot); }
bool HasRelevantHoverRules() const { return GetBoolFlag(NodeHasRelevantHoverRules); }
void SetHasRelevantHoverRules() { SetBoolFlag(NodeHasRelevantHoverRules); }
void SetParserHasNotified() { SetBoolFlag(ParserHasNotified); };
bool HasParserNotified() { return GetBoolFlag(ParserHasNotified); }
protected:
void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
void SetInDocument() { SetBoolFlag(IsInDocument); }

Просмотреть файл

@ -559,7 +559,7 @@ WebSocket::Constructor(const GlobalObject& aGlobal,
}
nsRefPtr<WebSocket> webSocket = new WebSocket(ownerWindow);
nsresult rv = webSocket->Init(aGlobal.GetContext(), principal,
nsresult rv = webSocket->Init(aGlobal.Context(), principal,
aUrl, protocolArray);
if (NS_FAILED(rv)) {
aRv.Throw(rv);

Просмотреть файл

@ -52,8 +52,8 @@ ImageData::Constructor(const GlobalObject& aGlobal,
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
return nullptr;
}
js::AssertSameCompartment(aGlobal.GetContext(), aGlobal.Get());
JSObject* data = Uint8ClampedArray::Create(aGlobal.GetContext(),
js::AssertSameCompartment(aGlobal.Context(), aGlobal.Get());
JSObject* data = Uint8ClampedArray::Create(aGlobal.Context(),
length.value());
if (!data) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);

Просмотреть файл

@ -13,14 +13,16 @@
#include "nsDOMSettableTokenList.h"
#include "nsFormSubmission.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Output)
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Output)
namespace mozilla {
namespace dom {
HTMLOutputElement::HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
HTMLOutputElement::HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElement(aNodeInfo)
, mValueModeFlag(eModeDefault)
, mIsDoneAddingChildren(!aFromParser)
{
AddMutationObserver(this);
@ -93,6 +95,12 @@ HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
aValue, aResult);
}
void
HTMLOutputElement::DoneAddingChildren(bool aHaveNotified)
{
mIsDoneAddingChildren = true;
}
EventStates
HTMLOutputElement::IntrinsicState() const
{
@ -170,7 +178,7 @@ HTMLOutputElement::HtmlFor()
void HTMLOutputElement::DescendantsChanged()
{
if (mValueModeFlag == eModeDefault) {
if (mIsDoneAddingChildren && mValueModeFlag == eModeDefault) {
if (!nsContentUtils::GetNodeTextContent(this, true, mDefaultValue)) {
NS_RUNTIMEABORT("OOM");
}

Просмотреть файл

@ -21,7 +21,8 @@ class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
public:
using nsIConstraintValidation::GetValidationMessage;
HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
virtual ~HTMLOutputElement();
// nsISupports
@ -39,6 +40,8 @@ public:
bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult) MOZ_OVERRIDE;
virtual void DoneAddingChildren(bool aHaveNotified) MOZ_OVERRIDE;
EventStates IntrinsicState() const MOZ_OVERRIDE;
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
@ -101,6 +104,7 @@ protected:
};
ValueModeFlag mValueModeFlag;
bool mIsDoneAddingChildren;
nsString mDefaultValue;
nsRefPtr<nsDOMSettableTokenList> mTokenList;
};

Просмотреть файл

@ -1966,6 +1966,25 @@ void MediaDecoderStateMachine::DecodeSeek()
video = mReader->FindStartTime(nextSampleStartTime);
}
if (seekTime > mediaTime &&
nextSampleStartTime < mediaTime &&
mSeekTarget.mType == SeekTarget::PrevSyncPoint) {
// We are doing a fastSeek, but we ended up *before* the previous
// playback position. This is surprising UX, so switch to an accurate
// seek and decode to the seek target. This is not conformant to the
// spec, fastSeek should always be fast, but until we get the time to
// change all Readers to seek to the keyframe after the currentTime
// in this case, we'll just decode forward. Bug 1026330.
ResetPlayback();
{
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
res = mReader->DecodeToTarget(seekTime);
if (NS_SUCCEEDED(res)) {
video = mReader->FindStartTime(nextSampleStartTime);
}
}
}
// Setup timestamp state.
if (seekTime == mEndTime) {
newCurrentTime = mAudioStartTime = seekTime;

Просмотреть файл

@ -86,9 +86,9 @@ MediaKeyMessageEvent::Constructor(const GlobalObject& aGlobal,
if (aEventInitDict.mMessage.WasPassed()) {
const auto& a = aEventInitDict.mMessage.Value();
a.ComputeLengthAndData();
e->mMessage = Uint8Array::Create(aGlobal.GetContext(), owner, a.Length(), a.Data());
e->mMessage = Uint8Array::Create(aGlobal.Context(), owner, a.Length(), a.Data());
} else {
e->mMessage = Uint8Array::Create(aGlobal.GetContext(), owner, 0, nullptr);
e->mMessage = Uint8Array::Create(aGlobal.Context(), owner, 0, nullptr);
}
if (!e->mMessage) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);

Просмотреть файл

@ -78,7 +78,7 @@ MediaKeyNeededEvent::Constructor(const GlobalObject& aGlobal,
!aEventInitDict.mInitData.Value().IsNull()) {
const auto& a = aEventInitDict.mInitData.Value().Value();
a.ComputeLengthAndData();
e->mInitData = Uint8Array::Create(aGlobal.GetContext(), owner, a.Length(), a.Data());
e->mInitData = Uint8Array::Create(aGlobal.Context(), owner, a.Length(), a.Data());
if (!e->mInitData) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return nullptr;

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
</head>
<body>
<!-- This video file has a timescale of 0 in the mdhd atom -->
<video src="0-timescale.mp4"
onerror="document.documentElement.className=undefined"
onloadedmetadata="document.documentElement.className=undefined">
</video>
</body>
</html>

Двоичные данные
content/media/test/crashtests/0-timescale.mp4 Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -1,3 +1,4 @@
skip-if(B2G) load 0-timescale.html
skip-if(B2G) load 459439-1.html # bug 888557
load 466607-1.html
load 466945-1.html

Просмотреть файл

@ -347,6 +347,7 @@ skip-if = buildapp == 'b2g' # bug 1021676
[test_error_in_video_document.html]
[test_error_on_404.html]
[test_fastSeek.html]
[test_fastSeek-forwards.html]
[test_info_leak.html]
[test_invalid_reject.html]
[test_load.html]

Просмотреть файл

@ -0,0 +1,74 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1022913
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1022913</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript" src="manifest.js"></script>
<script type="application/javascript">
// Test that if we're doing a fastSeek() forwards that we don't end up
// seeking backwards. This can happen if the keyframe before the seek
// target is before the current playback position. We'd prefer to seek to
// the keyframe after the seek target in this case, but we don't implement
// this yet (bug 1026330).
var manager = new MediaTestManager;
var onSecondSeekComplete = function(event) {
var v = event.target;
ok(v.currentTime >= v.firstSeekTarget, v.name + " seek never go backwards. time=" + v.currentTime + " firstSeekTarget=" + v.firstSeekTarget + " secondSeekTarget=" + v.secondSeekTarget);
manager.finished(v.token);
};
var onFirstSeekComplete = function(event) {
var v = event.target;
v.removeEventListener("seeked", onFirstSeekComplete);
// Seek to 75% of the way between the start and the first keyframe
// using fastSeek. We then test that the currentTime doesn't drop back
// to the previous keyframe, currentTime should go forwards.
v.addEventListener("seeked", onSecondSeekComplete);
v.secondSeekTarget = v.keyframes[1] * 0.75;
v.fastSeek(v.secondSeekTarget);
}
var onLoadedMetadata = function(event) {
// Seek to the mid-point between the start and the first keyframe.
var v = event.target;
v.addEventListener("seeked", onFirstSeekComplete);
v.firstSeekTarget = v.keyframes[1] * 0.5;
v.currentTime = v.firstSeekTarget;
}
function startTest(test, token) {
manager.started(token);
v = document.createElement("video");
v.src = test.name;
v.name = test.name;
v.preload = "metadata";
v.token = token;
v.target = 0;
v.keyframes = test.keyframes;
v.keyframeIndex = 0;
ok(v.keyframes.length >= 2, v.name + " - video should have at least two sync points");
v.addEventListener("loadedmetadata", onLoadedMetadata);
document.body.appendChild(v);
}
manager.runTests(gFastSeekTests, startTest);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1022913">Mozilla Bug 1022913</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

Просмотреть файл

@ -5,6 +5,8 @@
LIB_IS_C_ONLY = 1
include $(topsrcdir)/config/config.mk
ifeq ($(OS_ARCH),WINNT)
DEFFILE = $(CURDIR)/sqlite-processed.def
@ -20,10 +22,25 @@ sqlite-version.h: sqlite-version.py sqlite3.h
# We have to preprocess our def file because we need different symbols in debug
# builds exposed that are not built in non-debug builds.
$(DEFFILE): sqlite.def
@$(call py_action,preprocessor,$(DEFINES) \
@$(call py_action,preprocessor,$(DEFINES) $(XULPPFLAGS) \
$(srcdir)/sqlite.def -o $(DEFFILE))
export:: sqlite-version.h
else
ifndef MOZ_FOLD_LIBS
ifdef GCC_USE_GNU_LD
GARBAGE += \
$(LD_VERSION_SCRIPT) \
$(NULL)
# Convert to the format we need for ld.
$(LD_VERSION_SCRIPT): $(srcdir)/sqlite.def
@$(call py_action,convert_def_file, \
$(DEFINES) $(ACDEFINES) $(XULPPFLAGS) -o $@ $^)
endif
endif
endif
ifeq (Darwin,$(OS_TARGET))

Просмотреть файл

@ -74,6 +74,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
RCFILE = 'sqlite.rc'
RESFILE = 'sqlite.res'
if CONFIG['OS_ARCH'] == 'Linux' and \
not CONFIG['MOZ_FOLD_LIBS'] and \
CONFIG['GCC_USE_GNU_LD']:
LD_VERSION_SCRIPT = 'sqlite-processed.def'
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += [

Просмотреть файл

@ -126,6 +126,9 @@ EXPORTS
sqlite3_step
sqlite3_stmt_readonly
sqlite3_stmt_status
#ifdef XP_UNIX
sqlite3_temp_directory
#endif
sqlite3_thread_cleanup
sqlite3_total_changes
sqlite3_trace
@ -151,7 +154,7 @@ EXPORTS
sqlite3_vfs_unregister
sqlite3_vfs_register
sqlite3_vmprintf
#ifdef SQLITE_DEBUG
#ifdef DEBUG
sqlite3_mutex_held
sqlite3_mutex_notheld
#endif

Просмотреть файл

@ -25,7 +25,6 @@ public:
static already_AddRefed<Activity>
Constructor(const GlobalObject& aOwner,
JSContext* aCx,
const ActivityOptions& aOptions,
ErrorResult& aRv)
{
@ -36,7 +35,7 @@ public:
}
nsRefPtr<Activity> activity = new Activity(window);
aRv = activity->Initialize(window, aCx, aOptions);
aRv = activity->Initialize(window, aOwner.Context(), aOptions);
return activity.forget();
}

Просмотреть файл

@ -910,7 +910,7 @@ Console::Method(JSContext* aCx, MethodName aMethodName,
ErrorResult rv;
nsRefPtr<nsPerformance> performance = win->GetPerformance(rv);
if (rv.Failed()) {
if (rv.Failed() || !performance) {
return;
}

Просмотреть файл

@ -70,7 +70,7 @@ public:
// The context that this returns is not guaranteed to be in the compartment of
// the object returned from Get(), in fact it's generally in the caller's
// compartment.
JSContext* GetContext() const
JSContext* Context() const
{
return mCx;
}

Просмотреть файл

@ -1835,6 +1835,7 @@ GlobalObject::GlobalObject(JSContext* aCx, JSObject* aObject)
mCx(aCx),
mGlobalObject(nullptr)
{
MOZ_ASSERT(mCx);
JS::Rooted<JSObject*> obj(aCx, aObject);
if (js::IsWrapper(obj)) {
obj = js::CheckedUnwrap(obj, /* stopAtOuter = */ false);
@ -2437,7 +2438,7 @@ ConvertExceptionToPromise(JSContext* cx,
JS_ClearPendingException(cx);
ErrorResult rv;
nsRefPtr<Promise> promise = Promise::Reject(global, cx, exn, rv);
nsRefPtr<Promise> promise = Promise::Reject(global, exn, rv);
if (rv.Failed()) {
// We just give up. Make sure to not leak memory on the
// ErrorResult, but then just put the original exception back.

Просмотреть файл

@ -5726,8 +5726,9 @@ def isResultAlreadyAddRefed(extendedAttributes):
return 'resultNotAddRefed' not in extendedAttributes
def needCx(returnType, arguments, extendedAttributes, considerTypes):
return (considerTypes and
def needCx(returnType, arguments, extendedAttributes, considerTypes,
static=False):
return (not static and considerTypes and
(typeNeedsCx(returnType, True) or
any(typeNeedsCx(a.type) for a in arguments)) or
'implicitJSContext' in extendedAttributes)
@ -6057,10 +6058,11 @@ class CGPerSignatureCall(CGThing):
# For JS-implemented interfaces we do not want to base the
# needsCx decision on the types involved, just on our extended
# attributes.
# attributes. Also, JSContext is not needed for the static case
# since GlobalObject already contains the context.
needsCx = needCx(returnType, arguments, self.extendedAttributes,
not descriptor.interface.isJSImplemented())
if needsCx and not (static and descriptor.workers):
not descriptor.interface.isJSImplemented(), static)
if needsCx:
argsPre.append("cx")
needsUnwrap = False
@ -11708,7 +11710,7 @@ class CGNativeMember(ClassMethod):
args.insert(0, Argument("JS::Value", "aThisVal"))
# And jscontext bits.
if needCx(returnType, argList, self.extendedAttrs,
self.passJSBitsAsNeeded):
self.passJSBitsAsNeeded, self.member.isStatic()):
args.insert(0, Argument("JSContext*", "cx"))
if needScopeObject(returnType, argList, self.extendedAttrs,
self.descriptorProvider.wrapperCache,
@ -13647,7 +13649,7 @@ class CGEventMethod(CGNativeMember):
self.args.insert(0, Argument("mozilla::dom::EventTarget*", "aOwner"))
constructorForNativeCaller = CGNativeMember.declare(self, cgClass)
self.args = list(self.originalArgs)
if needCx(None, self.arguments(), [], True):
if needCx(None, self.arguments(), [], considerTypes=True, static=True):
self.args.insert(0, Argument("JSContext*", "aCx"))
self.args.insert(0, Argument("const GlobalObject&", "aGlobal"))
self.args.append(Argument('ErrorResult&', 'aRv'))
@ -13698,7 +13700,7 @@ class CGEventMethod(CGNativeMember):
""",
arg0=self.args[0].name,
arg1=self.args[1].name)
if needCx(None, self.arguments(), [], True):
if needCx(None, self.arguments(), [], considerTypes=True, static=True):
self.args.insert(0, Argument("JSContext*", "aCx"))
self.args.insert(0, Argument("const GlobalObject&", "aGlobal"))
self.args.append(Argument('ErrorResult&', 'aRv'))

Просмотреть файл

@ -151,7 +151,6 @@ public:
static
already_AddRefed<TestInterface> Test2(const GlobalObject&,
JSContext*,
const DictForConstructor&,
JS::Handle<JS::Value>,
JS::Handle<JSObject*>,
@ -682,8 +681,7 @@ public:
// Static methods and attributes
static void StaticMethod(const GlobalObject&, bool);
static void StaticMethodWithContext(const GlobalObject&, JSContext*,
JS::Value);
static void StaticMethodWithContext(const GlobalObject&, JS::Value);
static bool StaticAttribute(const GlobalObject&);
static void SetStaticAttribute(const GlobalObject&, bool);

Просмотреть файл

@ -181,9 +181,6 @@ TelephonyListener::CallStateChanged(uint32_t aServiceId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -203,9 +200,6 @@ TelephonyListener::EnumerateCallState(uint32_t aServiceId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString_internal& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -276,10 +270,7 @@ TelephonyListener::NotifyConferenceError(const nsAString& aName,
NS_IMETHODIMP
TelephonyListener::NotifyCdmaCallWaiting(uint32_t aServiceId,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
const nsAString& aNumber)
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);

Просмотреть файл

@ -157,38 +157,6 @@ public:
}
};
class EnableDisableAdapterTask : public BluetoothReplyRunnable
{
public:
EnableDisableAdapterTask(Promise* aPromise)
: BluetoothReplyRunnable(nullptr)
, mPromise(aPromise)
{ }
bool
ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue)
{
/*
* It is supposed to be Promise<void> according to BluetoothAdapter.webidl,
* but we have to pass "true" since it is mandatory to pass an
* argument while calling MaybeResolve.
*/
mPromise->MaybeResolve(true);
aValue.setUndefined();
return true;
}
void
ReleaseMembers()
{
BluetoothReplyRunnable::ReleaseMembers();
mPromise = nullptr;
}
private:
nsRefPtr<Promise> mPromise;
};
static int kCreatePairedDeviceTimeout = 50000; // unit: msec
BluetoothAdapter::BluetoothAdapter(nsPIDOMWindow* aWindow,
@ -321,12 +289,8 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
mJsDeviceAddresses = deviceAddresses;
Root();
} else {
#ifdef DEBUG
nsCString warningMsg;
warningMsg.AssignLiteral("Not handling adapter property: ");
warningMsg.Append(NS_ConvertUTF16toUTF8(name));
BT_WARNING(warningMsg.get());
#endif
BT_WARNING("Not handling adapter property: %s",
NS_ConvertUTF16toUTF8(name).get());
}
}
@ -400,12 +364,8 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
DispatchTrustedEvent(event);
} else {
#ifdef DEBUG
nsCString warningMsg;
warningMsg.AssignLiteral("Not handling adapter signal: ");
warningMsg.Append(NS_ConvertUTF16toUTF8(aData.name()));
BT_WARNING(warningMsg.get());
#endif
BT_WARNING("Not handling adapter signal: %s",
NS_ConvertUTF16toUTF8(aData.name()).get());
}
}
@ -719,29 +679,37 @@ BluetoothAdapter::EnableDisable(bool aEnable)
nsRefPtr<Promise> promise = new Promise(global);
// Make sure BluetoothService is available before modifying adapter state
// Ensure BluetoothService is available before modifying adapter state
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
promise->MaybeReject(NS_ERROR_NOT_AVAILABLE);
return promise.forget();
}
nsString methodName;
if (aEnable) {
// Enable local adapter
if (mState != BluetoothAdapterState::Disabled) {
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
methodName.AssignLiteral("Enable");
mState = BluetoothAdapterState::Enabling;
} else {
// Disable local adapter
if (mState != BluetoothAdapterState::Enabled) {
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
methodName.AssignLiteral("Disable");
mState = BluetoothAdapterState::Disabling;
}
// TODO: Fire attr changed event for this state change
nsRefPtr<BluetoothReplyRunnable> result = new EnableDisableAdapterTask(promise);
nsRefPtr<BluetoothReplyRunnable> result =
new BluetoothVoidReplyRunnable(nullptr, /* DOMRequest */
promise,
methodName);
if(NS_FAILED(bs->EnableDisable(aEnable, result))) {
promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);

Просмотреть файл

@ -8,13 +8,24 @@
#include "BluetoothReplyRunnable.h"
#include "DOMRequest.h"
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
#include "mozilla/dom/Promise.h"
#include "nsServiceManagerUtils.h"
using namespace mozilla::dom;
USING_BLUETOOTH_NAMESPACE
BluetoothReplyRunnable::BluetoothReplyRunnable(nsIDOMDOMRequest* aReq)
BluetoothReplyRunnable::BluetoothReplyRunnable(nsIDOMDOMRequest* aReq,
Promise* aPromise,
const nsAString& aName)
: mDOMRequest(aReq)
{}
, mPromise(aPromise)
, mName(aName)
{
if (aPromise) {
BT_API2_LOGR("<%s>", NS_ConvertUTF16toUTF8(mName).get());
}
}
void
BluetoothReplyRunnable::SetReply(BluetoothReply* aReply)
@ -26,35 +37,61 @@ void
BluetoothReplyRunnable::ReleaseMembers()
{
mDOMRequest = nullptr;
mPromise = nullptr;
}
BluetoothReplyRunnable::~BluetoothReplyRunnable()
{}
nsresult
BluetoothReplyRunnable::FireReply(JS::Handle<JS::Value> aVal)
BluetoothReplyRunnable::FireReplySuccess(JS::Handle<JS::Value> aVal)
{
NS_ENSURE_TRUE(mDOMRequest, NS_OK);
MOZ_ASSERT(mReply->type() == BluetoothReply::TBluetoothReplySuccess);
nsCOMPtr<nsIDOMRequestService> rs =
do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
// DOMRequest
if (mDOMRequest) {
nsCOMPtr<nsIDOMRequestService> rs =
do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
return mReply->type() == BluetoothReply::TBluetoothReplySuccess ?
rs->FireSuccessAsync(mDOMRequest, aVal) :
rs->FireErrorAsync(mDOMRequest, mReply->get_BluetoothReplyError().error());
return rs->FireSuccessAsync(mDOMRequest, aVal);
}
// Promise
if (mPromise) {
BT_API2_LOGR("<%s>", NS_ConvertUTF16toUTF8(mName).get());
mPromise->MaybeResolve(aVal);
}
return NS_OK;
}
nsresult
BluetoothReplyRunnable::FireErrorString()
{
NS_ENSURE_TRUE(mDOMRequest, NS_OK);
// DOMRequest
if (mDOMRequest) {
nsCOMPtr<nsIDOMRequestService> rs =
do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRequestService> rs =
do_GetService("@mozilla.org/dom/dom-request-service;1");
NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
return rs->FireErrorAsync(mDOMRequest, mErrorString);
}
return rs->FireErrorAsync(mDOMRequest, mErrorString);
// Promise
if (mPromise) {
BT_API2_LOGR("<%s>", NS_ConvertUTF16toUTF8(mName).get());
/**
* Always reject with NS_ERROR_DOM_OPERATION_ERR.
*
* TODO: Return actual error result once bluetooth backend wraps
* nsresult instead of error string.
*/
mPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
}
return NS_OK;
}
NS_IMETHODIMP
@ -63,35 +100,38 @@ BluetoothReplyRunnable::Run()
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mReply);
nsresult rv;
AutoSafeJSContext cx;
JS::Rooted<JS::Value> v(cx, JSVAL_VOID);
nsresult rv;
if (mReply->type() != BluetoothReply::TBluetoothReplySuccess) {
rv = FireReply(v);
SetError(mReply->get_BluetoothReplyError().error());
rv = FireErrorString();
} else if (!ParseSuccessfulReply(&v)) {
rv = FireErrorString();
} else {
if (!ParseSuccessfulReply(&v)) {
rv = FireErrorString();
} else {
rv = FireReply(v);
}
rv = FireReplySuccess(v);
}
if (NS_FAILED(rv)) {
BT_WARNING("Could not fire DOMRequest!");
BT_WARNING("Could not fire DOMRequest/Promise!");
}
ReleaseMembers();
MOZ_ASSERT(!mDOMRequest,
"mDOMRequest still alive! Deriving class should call "
"mDOMRequest is still alive! Deriving class should call "
"BluetoothReplyRunnable::ReleaseMembers()!");
MOZ_ASSERT(!mPromise,
"mPromise is still alive! Deriving class should call "
"BluetoothReplyRunnable::ReleaseMembers()!");
return rv;
}
BluetoothVoidReplyRunnable::BluetoothVoidReplyRunnable(nsIDOMDOMRequest* aReq)
: BluetoothReplyRunnable(aReq)
BluetoothVoidReplyRunnable::BluetoothVoidReplyRunnable(nsIDOMDOMRequest* aReq,
Promise* aPromise,
const nsAString& aName)
: BluetoothReplyRunnable(aReq, aPromise, aName)
{}
BluetoothVoidReplyRunnable::~BluetoothVoidReplyRunnable()

Просмотреть файл

@ -14,6 +14,12 @@
class nsIDOMDOMRequest;
namespace mozilla {
namespace dom {
class Promise;
}
}
BEGIN_BLUETOOTH_NAMESPACE
class BluetoothReply;
@ -23,7 +29,9 @@ class BluetoothReplyRunnable : public nsRunnable
public:
NS_DECL_NSIRUNNABLE
BluetoothReplyRunnable(nsIDOMDOMRequest* aReq);
BluetoothReplyRunnable(nsIDOMDOMRequest* aReq,
Promise* aPromise = nullptr,
const nsAString& aName = EmptyString());
void SetReply(BluetoothReply* aReply);
@ -45,25 +53,35 @@ protected:
nsAutoPtr<BluetoothReply> mReply;
private:
nsresult FireReply(JS::Handle<JS::Value> aVal);
nsresult FireReplySuccess(JS::Handle<JS::Value> aVal);
nsresult FireErrorString();
/**
* mDOMRequest is nullptr for internal IPC that require no DOMRequest,
* e.g., GetAdaptersTask triggered by BluetoothManager
* Either mDOMRequest or mPromise is not nullptr to reply applications
* success or error string. One special case is internal IPC that require
* neither mDOMRequest nor mPromise to reply applications.
* E.g., GetAdaptersTask triggered by BluetoothManager
*
* TODO: remove mDOMRequest once all methods adopt Promise.
*/
nsCOMPtr<nsIDOMDOMRequest> mDOMRequest;
nsRefPtr<Promise> mPromise;
nsString mErrorString;
nsString mName; // for debugging
};
class BluetoothVoidReplyRunnable : public BluetoothReplyRunnable
{
public:
BluetoothVoidReplyRunnable(nsIDOMDOMRequest* aReq);
BluetoothVoidReplyRunnable(nsIDOMDOMRequest* aReq,
Promise* aPromise = nullptr,
const nsAString& aName = EmptyString());
~BluetoothVoidReplyRunnable();
protected:
virtual bool ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue) MOZ_OVERRIDE
virtual bool
ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue) MOZ_OVERRIDE
{
aValue.setUndefined();
return true;

Просмотреть файл

@ -196,7 +196,3 @@ disabled = bug 774100
# Disabled due to focus issues (no bug that I'm aware of)
[test_browserElement_oop_KeyEvents.html]
disabled =
# Disable due to certificate issue (no bug that I'm aware of)
[test_browserElement_inproc_ErrorSecurity.html]
skip-if = buildapp=='b2g'
disabled =

Просмотреть файл

@ -523,6 +523,7 @@ void
Event::SetEventType(const nsAString& aEventTypeArg)
{
if (mIsMainThreadEvent) {
mEvent->typeString.Truncate();
mEvent->userType =
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
&(mEvent->message));

Просмотреть файл

@ -114,7 +114,7 @@ MessageEvent::GetSource(Nullable<OwningWindowProxyOrMessagePort>& aValue) const
/* static */ already_AddRefed<MessageEvent>
MessageEvent::Constructor(const GlobalObject& aGlobal,
JSContext* aCx, const nsAString& aType,
const nsAString& aType,
const MessageEventInit& aParam,
ErrorResult& aRv)
{

Просмотреть файл

@ -70,7 +70,7 @@ public:
}
static already_AddRefed<MessageEvent>
Constructor(const GlobalObject& aGlobal, JSContext* aCx,
Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const MessageEventInit& aEventInit,
ErrorResult& aRv);

Просмотреть файл

@ -157,3 +157,4 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
skip-if = buildapp == 'b2g' || e10s
[test_bug985988.html]
[test_dom_storage_event.html]
[test_bug998809.html]

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=998809
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 998809</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 998809 **/
var event1 = document.createEvent("Event");
event1.initEvent("a", false, false);
event1.initEvent("b", false, false);
is(event1.type, "b");
var event2 = document.createEvent("Event");
event2.initEvent("a", false, false);
is(event2.type, "a");
event2.initEvent("b", false, false);
is(event2.type, "b");
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=998809">Mozilla Bug 998809</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

Просмотреть файл

@ -214,7 +214,7 @@ IDBKeyRange::GetUpper(JSContext* aCx, JS::MutableHandle<JS::Value> aResult,
// static
already_AddRefed<IDBKeyRange>
IDBKeyRange::Only(const GlobalObject& aGlobal, JSContext* aCx,
IDBKeyRange::Only(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
@ -222,7 +222,7 @@ IDBKeyRange::Only(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<IDBKeyRange> keyRange =
new IDBKeyRange(aGlobal.GetAsSupports(), false, false, true);
aRv = GetKeyFromJSVal(aCx, aValue, keyRange->Lower());
aRv = GetKeyFromJSVal(aGlobal.Context(), aValue, keyRange->Lower());
if (aRv.Failed()) {
return nullptr;
}
@ -232,7 +232,7 @@ IDBKeyRange::Only(const GlobalObject& aGlobal, JSContext* aCx,
// static
already_AddRefed<IDBKeyRange>
IDBKeyRange::LowerBound(const GlobalObject& aGlobal, JSContext* aCx,
IDBKeyRange::LowerBound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, bool aOpen,
ErrorResult& aRv)
{
@ -241,7 +241,7 @@ IDBKeyRange::LowerBound(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<IDBKeyRange> keyRange =
new IDBKeyRange(aGlobal.GetAsSupports(), aOpen, true, false);
aRv = GetKeyFromJSVal(aCx, aValue, keyRange->Lower());
aRv = GetKeyFromJSVal(aGlobal.Context(), aValue, keyRange->Lower());
if (aRv.Failed()) {
return nullptr;
}
@ -251,7 +251,7 @@ IDBKeyRange::LowerBound(const GlobalObject& aGlobal, JSContext* aCx,
// static
already_AddRefed<IDBKeyRange>
IDBKeyRange::UpperBound(const GlobalObject& aGlobal, JSContext* aCx,
IDBKeyRange::UpperBound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, bool aOpen,
ErrorResult& aRv)
{
@ -260,7 +260,7 @@ IDBKeyRange::UpperBound(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<IDBKeyRange> keyRange =
new IDBKeyRange(aGlobal.GetAsSupports(), true, aOpen, false);
aRv = GetKeyFromJSVal(aCx, aValue, keyRange->Upper());
aRv = GetKeyFromJSVal(aGlobal.Context(), aValue, keyRange->Upper());
if (aRv.Failed()) {
return nullptr;
}
@ -270,7 +270,7 @@ IDBKeyRange::UpperBound(const GlobalObject& aGlobal, JSContext* aCx,
// static
already_AddRefed<IDBKeyRange>
IDBKeyRange::Bound(const GlobalObject& aGlobal, JSContext* aCx,
IDBKeyRange::Bound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aLower, JS::Handle<JS::Value> aUpper,
bool aLowerOpen, bool aUpperOpen, ErrorResult& aRv)
{
@ -279,12 +279,12 @@ IDBKeyRange::Bound(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<IDBKeyRange> keyRange =
new IDBKeyRange(aGlobal.GetAsSupports(), aLowerOpen, aUpperOpen, false);
aRv = GetKeyFromJSVal(aCx, aLower, keyRange->Lower());
aRv = GetKeyFromJSVal(aGlobal.Context(), aLower, keyRange->Lower());
if (aRv.Failed()) {
return nullptr;
}
aRv = GetKeyFromJSVal(aCx, aUpper, keyRange->Upper());
aRv = GetKeyFromJSVal(aGlobal.Context(), aUpper, keyRange->Upper());
if (aRv.Failed()) {
return nullptr;
}

Просмотреть файл

@ -177,19 +177,19 @@ public:
}
static already_AddRefed<IDBKeyRange>
Only(const GlobalObject& aGlobal, JSContext* aCx,
Only(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv);
static already_AddRefed<IDBKeyRange>
LowerBound(const GlobalObject& aGlobal, JSContext* aCx,
LowerBound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, bool aOpen, ErrorResult& aRv);
static already_AddRefed<IDBKeyRange>
UpperBound(const GlobalObject& aGlobal, JSContext* aCx,
UpperBound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, bool aOpen, ErrorResult& aRv);
static already_AddRefed<IDBKeyRange>
Bound(const GlobalObject& aGlobal, JSContext* aCx,
Bound(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aLower, JS::Handle<JS::Value> aUpper,
bool aLowerOpen, bool aUpperOpen, ErrorResult& aRv);

Просмотреть файл

@ -79,7 +79,7 @@ MozNDEFRecord::Constructor(const GlobalObject& aGlobal,
return nullptr;
}
nsRefPtr<MozNDEFRecord> ndefrecord = new MozNDEFRecord(aGlobal.GetContext(),
nsRefPtr<MozNDEFRecord> ndefrecord = new MozNDEFRecord(aGlobal.Context(),
win, aTnf, aType, aId,
aPayload);
if (!ndefrecord) {

Просмотреть файл

@ -9,3 +9,5 @@ qemu=true
[test_nfc_peer.js]
[test_nfc_peer_sendndef.js]
[test_nfc_tag.js]
[test_nfc_checkP2PRegistration.js]
[test_nfc_error_messages.js]

Просмотреть файл

@ -6,11 +6,11 @@
/* globals log, is, ok, runTests, toggleNFC, runNextTest,
SpecialPowers, nfc, enableRE0, MozNDEFRecord */
const MARIONETTE_TIMEOUT = 30000;
const MARIONETTE_TIMEOUT = 60000;
const MARIONETTE_HEAD_JS = 'head.js';
const MANIFEST_URL = 'app://system.gaiamobile.org/manifest.webapp';
const NDEF_MESSAGE = [new MozNDEFRecord(new Uint8Array(0x01),
const NDEF_MESSAGE = [new MozNDEFRecord(0x01,
new Uint8Array(0x84),
new Uint8Array(0),
new Uint8Array(0x20))];
@ -76,6 +76,21 @@ function testNfcConnectError() {
.catch(handleRejectedPromise);
}
/**
* Enables nfc and RE0, registers tech-discovered msg handler, once it's
* fired set tech-lost handler and disables nfc. In both handlers checks
* if error message is not present.
*/
function testNoErrorInTechMsg() {
log('testNoErrorInTechMsg');
toggleNFC(true)
.then(enableRE0)
.then(setTechDiscoveredHandler)
.then(setAndFireTechLostHandler)
.then(endTest)
.catch(handleRejectedPromise);
}
function endTest() {
nfcPeers = [];
sessionTokens = [];
@ -155,10 +170,47 @@ function connectToNFCTagExpectError(sessionToken, tech, errorMsg) {
return deferred.promise;
}
function setTechDiscoveredHandler() {
let deferred = Promise.defer();
let techDiscoveredHandler = function(msg) {
ok('Message handler for nfc-manager-tech-discovered');
is(msg.type, 'techDiscovered');
is(msg.errorMsg, undefined, 'Should not get error msg in tech discovered');
window.navigator.mozSetMessageHandler('nfc-manager-tech-discovered', null);
deferred.resolve();
};
window.navigator.mozSetMessageHandler('nfc-manager-tech-discovered',
techDiscoveredHandler);
return deferred.promise;
}
function setAndFireTechLostHandler() {
let deferred = Promise.defer();
let techLostHandler = function(msg) {
ok('Message handler for nfc-manager-tech-lost');
is(msg.type, 'techLost');
is(msg.errorMsg, undefined, 'Should not get error msg in tech lost');
window.navigator.mozSetMessageHandler('nfc-manager-tech-lost', null);
deferred.resolve();
};
window.navigator.mozSetMessageHandler('nfc-manager-tech-lost',
techLostHandler);
// TODO should be refactored once Bug 1023079 lands
toggleNFC(false);
return deferred.promise;
}
let tests = [
testNfcNotEnabledError,
testNfcBadSessionIdError,
testNfcConnectError
testNfcConnectError,
testNoErrorInTechMsg
];
/**

Просмотреть файл

@ -593,7 +593,7 @@ Promise::CreateThenableFunction(JSContext* aCx, Promise* aPromise, uint32_t aTas
Promise::Constructor(const GlobalObject& aGlobal,
PromiseInit& aInit, ErrorResult& aRv)
{
JSContext* cx = aGlobal.GetContext();
JSContext* cx = aGlobal.Context();
nsCOMPtr<nsIGlobalObject> global;
global = do_QueryInterface(aGlobal.GetAsSupports());
@ -641,12 +641,12 @@ Promise::Constructor(const GlobalObject& aGlobal,
}
/* static */ already_AddRefed<Promise>
Promise::Resolve(const GlobalObject& aGlobal, JSContext* aCx,
Promise::Resolve(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv)
{
// If a Promise was passed, just return it.
if (aValue.isObject()) {
JS::Rooted<JSObject*> valueObj(aCx, &aValue.toObject());
JS::Rooted<JSObject*> valueObj(aGlobal.Context(), &aValue.toObject());
Promise* nextPromise;
nsresult rv = UNWRAP_OBJECT(Promise, valueObj, nextPromise);
@ -663,7 +663,7 @@ Promise::Resolve(const GlobalObject& aGlobal, JSContext* aCx,
return nullptr;
}
return Resolve(global, aCx, aValue, aRv);
return Resolve(global, aGlobal.Context(), aValue, aRv);
}
/* static */ already_AddRefed<Promise>
@ -677,7 +677,7 @@ Promise::Resolve(nsIGlobalObject* aGlobal, JSContext* aCx,
}
/* static */ already_AddRefed<Promise>
Promise::Reject(const GlobalObject& aGlobal, JSContext* aCx,
Promise::Reject(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> global =
@ -687,7 +687,7 @@ Promise::Reject(const GlobalObject& aGlobal, JSContext* aCx,
return nullptr;
}
return Reject(global, aCx, aValue, aRv);
return Reject(global, aGlobal.Context(), aValue, aRv);
}
/* static */ already_AddRefed<Promise>
@ -744,9 +744,9 @@ public:
: mPromise(aPromise), mCountdown(aCountdown)
{
MOZ_ASSERT(aCountdown != 0);
JSContext* cx = aGlobal.GetContext();
JSContext* cx = aGlobal.Context();
// The only time aGlobal.GetContext() and aGlobal.Get() are not
// The only time aGlobal.Context() and aGlobal.Get() are not
// same-compartment is when we're called via Xrays, and in that situation we
// in fact want to create the array in the callee compartment
@ -864,7 +864,7 @@ NS_INTERFACE_MAP_END_INHERITING(PromiseNativeHandler)
NS_IMPL_CYCLE_COLLECTION(AllResolveHandler, mCountdownHolder)
/* static */ already_AddRefed<Promise>
Promise::All(const GlobalObject& aGlobal, JSContext* aCx,
Promise::All(const GlobalObject& aGlobal,
const Sequence<JS::Value>& aIterable, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> global =
@ -874,21 +874,23 @@ Promise::All(const GlobalObject& aGlobal, JSContext* aCx,
return nullptr;
}
JSContext* cx = aGlobal.Context();
if (aIterable.Length() == 0) {
JS::Rooted<JSObject*> empty(aCx, JS_NewArrayObject(aCx, 0));
JS::Rooted<JSObject*> empty(cx, JS_NewArrayObject(cx, 0));
if (!empty) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return nullptr;
}
JS::Rooted<JS::Value> value(aCx, JS::ObjectValue(*empty));
return Promise::Resolve(aGlobal, aCx, value, aRv);
JS::Rooted<JS::Value> value(cx, JS::ObjectValue(*empty));
return Promise::Resolve(aGlobal, value, aRv);
}
nsRefPtr<Promise> promise = new Promise(global);
nsRefPtr<CountdownHolder> holder =
new CountdownHolder(aGlobal, promise, aIterable.Length());
JS::Rooted<JSObject*> obj(aCx, JS::CurrentGlobalOrNull(aCx));
JS::Rooted<JSObject*> obj(cx, JS::CurrentGlobalOrNull(cx));
if (!obj) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
@ -897,8 +899,8 @@ Promise::All(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<PromiseCallback> rejectCb = new RejectPromiseCallback(promise, obj);
for (uint32_t i = 0; i < aIterable.Length(); ++i) {
JS::Rooted<JS::Value> value(aCx, aIterable.ElementAt(i));
nsRefPtr<Promise> nextPromise = Promise::Resolve(aGlobal, aCx, value, aRv);
JS::Rooted<JS::Value> value(cx, aIterable.ElementAt(i));
nsRefPtr<Promise> nextPromise = Promise::Resolve(aGlobal, value, aRv);
MOZ_ASSERT(!aRv.Failed());
@ -916,7 +918,7 @@ Promise::All(const GlobalObject& aGlobal, JSContext* aCx,
}
/* static */ already_AddRefed<Promise>
Promise::Race(const GlobalObject& aGlobal, JSContext* aCx,
Promise::Race(const GlobalObject& aGlobal,
const Sequence<JS::Value>& aIterable, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> global =
@ -926,7 +928,9 @@ Promise::Race(const GlobalObject& aGlobal, JSContext* aCx,
return nullptr;
}
JS::Rooted<JSObject*> obj(aCx, JS::CurrentGlobalOrNull(aCx));
JSContext* cx = aGlobal.Context();
JS::Rooted<JSObject*> obj(cx, JS::CurrentGlobalOrNull(cx));
if (!obj) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
@ -940,8 +944,8 @@ Promise::Race(const GlobalObject& aGlobal, JSContext* aCx,
nsRefPtr<PromiseCallback> rejectCb = new RejectPromiseCallback(promise, obj);
for (uint32_t i = 0; i < aIterable.Length(); ++i) {
JS::Rooted<JS::Value> value(aCx, aIterable.ElementAt(i));
nsRefPtr<Promise> nextPromise = Promise::Resolve(aGlobal, aCx, value, aRv);
JS::Rooted<JS::Value> value(cx, aIterable.ElementAt(i));
nsRefPtr<Promise> nextPromise = Promise::Resolve(aGlobal, value, aRv);
// According to spec, Resolve can throw, but our implementation never does.
// Well it does when window isn't passed on the main thread, but that is an
// implementation detail which should never be reached since we are checking

Просмотреть файл

@ -121,7 +121,7 @@ public:
ErrorResult& aRv);
static already_AddRefed<Promise>
Resolve(const GlobalObject& aGlobal, JSContext* aCx,
Resolve(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv);
static already_AddRefed<Promise>
@ -129,7 +129,7 @@ public:
JS::Handle<JS::Value> aValue, ErrorResult& aRv);
static already_AddRefed<Promise>
Reject(const GlobalObject& aGlobal, JSContext* aCx,
Reject(const GlobalObject& aGlobal,
JS::Handle<JS::Value> aValue, ErrorResult& aRv);
static already_AddRefed<Promise>
@ -144,11 +144,11 @@ public:
Catch(JSContext* aCx, AnyCallback* aRejectCallback);
static already_AddRefed<Promise>
All(const GlobalObject& aGlobal, JSContext* aCx,
All(const GlobalObject& aGlobal,
const Sequence<JS::Value>& aIterable, ErrorResult& aRv);
static already_AddRefed<Promise>
Race(const GlobalObject& aGlobal, JSContext* aCx,
Race(const GlobalObject& aGlobal,
const Sequence<JS::Value>& aIterable, ErrorResult& aRv);
void AppendNativeHandler(PromiseNativeHandler* aRunnable);

Просмотреть файл

@ -1502,15 +1502,11 @@ this.PushService = {
},
/**
* Get mobile network information to decide if the client is capable of being
* woken up by UDP (which currently just means having an mcc and mnc along
* with an IP).
* Returns information about MCC-MNC and the IP of the current connection.
*/
_getNetworkState: function(callback) {
if (typeof callback !== 'function') {
throw new Error("No callback method. Aborting push agent !");
}
debug("getNetworkState()");
_getNetworkInformation: function() {
debug("getNetworkInformation()");
try {
if (!prefs.get("udp.wakeupEnabled")) {
debug("UDP support disabled, we do not send any carrier info");
@ -1534,16 +1530,11 @@ this.PushService = {
let prefixLengths = {};
nm.active.getAddresses(ips, prefixLengths);
this._getMobileNetworkId(function(netid) {
debug("Recovered netID = " + netid);
callback({
mcc: iccInfo.mcc,
mnc: iccInfo.mnc,
ip: ips.value[0],
netid: netid
});
});
return;
return {
mcc: iccInfo.mcc,
mnc: iccInfo.mnc,
ip: ips.value[0]
}
}
}
} catch (e) {
@ -1551,11 +1542,40 @@ this.PushService = {
}
debug("Running on wifi");
callback({
return {
mcc: 0,
mnc: 0,
ip: undefined
});
};
},
/**
* Get mobile network information to decide if the client is capable of being
* woken up by UDP (which currently just means having an mcc and mnc along
* with an IP, and optionally a netid).
*/
_getNetworkState: function(callback) {
debug("getNetworkState()");
if (typeof callback !== 'function') {
throw new Error("No callback method. Aborting push agent !");
}
var networkInfo = this._getNetworkInformation();
if (networkInfo.ip) {
this._getMobileNetworkId(function(netid) {
debug("Recovered netID = " + netid);
callback({
mcc: networkInfo.mcc,
mnc: networkInfo.mnc,
ip: networkInfo.ip,
netid: netid
});
});
} else {
callback(networkInfo);
}
},
// utility function used to add/remove observers in init() and shutdown()

Просмотреть файл

@ -46,7 +46,7 @@ public:
{
MOZ_ASSERT(aWindow);
MOZ_ASSERT(aPromise);
JSContext* cx = aGlobal.GetContext();
JSContext* cx = aGlobal.Context();
JSAutoCompartment ac(cx, mGlobal);
mNotifications = JS_NewArrayObject(cx, 0);
HoldData();

Просмотреть файл

@ -494,7 +494,7 @@ Nfc.prototype = {
debug("Received message from NFC worker: " + JSON.stringify(message));
// mapping error code to error message
if(message.status !== NFC.NFC_SUCCESS) {
if (message.status !== undefined && message.status !== NFC.NFC_SUCCESS) {
message.errorMsg = this.getErrorMessage(message.status);
}

Просмотреть файл

@ -2075,7 +2075,7 @@ RadioInterface.prototype = {
gTelephonyService.notifyConferenceCallStateChanged(message.state);
break;
case "cdmaCallWaiting":
gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.waitingCall);
gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.number);
break;
case "suppSvcNotification":
gTelephonyService.notifySupplementaryService(this.clientId,

Просмотреть файл

@ -5529,7 +5529,7 @@ RilObject.prototype[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CA
if (RILQUIRKS_CALLSTATE_EXTRA_UINT32) {
Buf.readInt32();
}
call.number = Buf.readString();
call.number = Buf.readString(); //TODO munge with TOA
call.numberPresentation = Buf.readInt32(); // CALL_PRESENTATION_*
call.name = Buf.readString();
call.namePresentation = Buf.readInt32();
@ -6860,7 +6860,7 @@ RilObject.prototype[UNSOLICITED_CDMA_CALL_WAITING] = function UNSOLICITED_CDMA_C
call.alertPitch = Buf.readInt32();
call.signal = Buf.readInt32();
this.sendChromeMessage({rilMessageType: "cdmaCallWaiting",
waitingCall: call});
number: call.number});
};
RilObject.prototype[UNSOLICITED_CDMA_OTA_PROVISION_STATUS] = function UNSOLICITED_CDMA_OTA_PROVISION_STATUS() {
let status = this.context.Buf.readInt32List()[0];

Просмотреть файл

@ -25,7 +25,6 @@
#include "CallsList.h"
#include "TelephonyCall.h"
#include "TelephonyCallGroup.h"
#include "TelephonyCallId.h"
using namespace mozilla::dom;
using mozilla::ErrorResult;
@ -277,9 +276,6 @@ Telephony::CreateNewDialingCall(uint32_t aServiceId, const nsAString& aNumber,
{
nsRefPtr<TelephonyCall> call =
TelephonyCall::Create(this, aServiceId, aNumber,
nsITelephonyService::CALL_PRESENTATION_ALLOWED,
EmptyString(),
nsITelephonyService::CALL_PRESENTATION_ALLOWED,
nsITelephonyService::CALL_STATE_DIALING, aCallIndex);
NS_ASSERTION(call, "This should never fail!");
@ -478,10 +474,8 @@ Telephony::EventListenerAdded(nsIAtom* aType)
NS_IMETHODIMP
Telephony::CallStateChanged(uint32_t aServiceId, uint32_t aCallIndex,
uint16_t aCallState, const nsAString& aNumber,
uint16_t aNumberPresentation, const nsAString& aName,
uint16_t aNamePresentation, bool aIsOutgoing,
bool aIsEmergency, bool aIsConference,
bool aIsSwitchable, bool aIsMergeable)
bool aIsOutgoing, bool aIsEmergency,
bool aIsConference, bool aIsSwitchable, bool aIsMergeable)
{
nsRefPtr<TelephonyCall> modifiedCall
= GetCallFromEverywhere(aServiceId, aCallIndex);
@ -526,10 +520,9 @@ Telephony::CallStateChanged(uint32_t aServiceId, uint32_t aCallIndex,
// Didn't find this call in mCalls or mGroup. Create a new call.
nsRefPtr<TelephonyCall> call =
TelephonyCall::Create(this, aServiceId, aNumber, aNumberPresentation,
aName, aNamePresentation, aCallState, aCallIndex,
aIsEmergency, aIsConference, aIsSwitchable,
aIsMergeable);
TelephonyCall::Create(this, aServiceId, aNumber, aCallState, aCallIndex,
aIsEmergency, aIsConference, aIsSwitchable,
aIsMergeable);
NS_ASSERTION(call, "This should never fail!");
NS_ASSERTION(aIsConference ? mGroup->CallsArray().Contains(call) :
@ -571,10 +564,8 @@ Telephony::EnumerateCallStateComplete()
NS_IMETHODIMP
Telephony::EnumerateCallState(uint32_t aServiceId, uint32_t aCallIndex,
uint16_t aCallState, const nsAString& aNumber,
uint16_t aNumberPresentation, const nsAString& aName,
uint16_t aNamePresentation, bool aIsOutgoing,
bool aIsEmergency, bool aIsConference,
bool aIsSwitchable, bool aIsMergeable)
bool aIsOutgoing, bool aIsEmergency,
bool aIsConference, bool aIsSwitchable, bool aIsMergeable)
{
nsRefPtr<TelephonyCall> call;
@ -589,8 +580,7 @@ Telephony::EnumerateCallState(uint32_t aServiceId, uint32_t aCallIndex,
}
// Didn't know anything about this call before now.
call = TelephonyCall::Create(this, aServiceId, aNumber, aNumberPresentation,
aName, aNamePresentation, aCallState,
call = TelephonyCall::Create(this, aServiceId, aNumber, aCallState,
aCallIndex, aIsEmergency, aIsConference,
aIsSwitchable, aIsMergeable);
NS_ASSERTION(call, "This should never fail!");
@ -652,20 +642,14 @@ Telephony::NotifyError(uint32_t aServiceId,
}
NS_IMETHODIMP
Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber)
{
MOZ_ASSERT(mCalls.Length() == 1);
nsRefPtr<TelephonyCall> callToNotify = mCalls[0];
MOZ_ASSERT(callToNotify && callToNotify->ServiceId() == aServiceId);
nsRefPtr<TelephonyCallId> id =
new TelephonyCallId(GetOwner(), aNumber, aNumberPresentation, aName,
aNamePresentation);
callToNotify->UpdateSecondId(id);
callToNotify->UpdateSecondNumber(aNumber);
DispatchCallEvent(NS_LITERAL_STRING("callschanged"), callToNotify);
return NS_OK;
}

Просмотреть файл

@ -19,29 +19,25 @@ using mozilla::ErrorResult;
// static
already_AddRefed<TelephonyCall>
TelephonyCall::Create(Telephony* aTelephony, uint32_t aServiceId,
const nsAString& aNumber, uint16_t aNumberPresentation,
const nsAString& aName, uint16_t aNamePresentation,
uint16_t aCallState, uint32_t aCallIndex, bool aEmergency,
bool aIsConference, bool aSwitchable, bool aMergeable)
const nsAString& aNumber, uint16_t aCallState,
uint32_t aCallIndex, bool aEmergency, bool aIsConference,
bool aSwitchable, bool aMergeable)
{
NS_ASSERTION(aTelephony, "Null pointer!");
NS_ASSERTION(!aNumber.IsEmpty(), "Empty number!");
NS_ASSERTION(aCallIndex >= 1, "Invalid call index!");
nsRefPtr<TelephonyCall> call = new TelephonyCall(aTelephony->GetOwner());
nsRefPtr<TelephonyCallId> id = new TelephonyCallId(aTelephony->GetOwner(),
aNumber, aNumberPresentation,
aName, aNamePresentation);
call->mTelephony = aTelephony;
call->mServiceId = aServiceId;
call->mNumber = aNumber;
call->mCallIndex = aCallIndex;
call->mError = nullptr;
call->mEmergency = aEmergency;
call->mGroup = aIsConference ? aTelephony->ConferenceGroup() : nullptr;
call->mSwitchable = aSwitchable;
call->mMergeable = aMergeable;
call->mId = id;
call->ChangeStateInternal(aCallState, false);
@ -191,9 +187,7 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(TelephonyCall,
DOMEventTargetHelper,
mTelephony,
mError,
mGroup,
mId,
mSecondId);
mGroup);
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TelephonyCall)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
@ -203,20 +197,6 @@ NS_IMPL_RELEASE_INHERITED(TelephonyCall, DOMEventTargetHelper)
// TelephonyCall WebIDL
already_AddRefed<TelephonyCallId>
TelephonyCall::Id() const
{
nsRefPtr<TelephonyCallId> id = mId;
return id.forget();
}
already_AddRefed<TelephonyCallId>
TelephonyCall::GetSecondId() const
{
nsRefPtr<TelephonyCallId> id = mSecondId;
return id.forget();
}
already_AddRefed<DOMError>
TelephonyCall::GetError() const
{
@ -292,7 +272,7 @@ TelephonyCall::Hold(ErrorResult& aRv)
return;
}
if (mSecondId) {
if (!mSecondNumber.IsEmpty()) {
// No state transition when we switch two numbers within one TelephonyCall
// object. Otherwise, the state here will be inconsistent with the backend
// RIL and will never be right.

Просмотреть файл

@ -11,8 +11,6 @@
#include "mozilla/dom/DOMError.h"
#include "TelephonyCallId.h"
class nsPIDOMWindow;
namespace mozilla {
@ -23,10 +21,9 @@ class TelephonyCall MOZ_FINAL : public DOMEventTargetHelper
nsRefPtr<Telephony> mTelephony;
nsRefPtr<TelephonyCallGroup> mGroup;
nsRefPtr<TelephonyCallId> mId;
nsRefPtr<TelephonyCallId> mSecondId;
uint32_t mServiceId;
nsString mNumber;
nsString mSecondNumber;
nsString mState;
bool mEmergency;
nsRefPtr<DOMError> mError;
@ -42,6 +39,7 @@ public:
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall,
DOMEventTargetHelper)
friend class Telephony;
nsPIDOMWindow*
@ -55,11 +53,17 @@ public:
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// WebIDL
already_AddRefed<TelephonyCallId>
Id() const;
void
GetNumber(nsString& aNumber) const
{
aNumber.Assign(mNumber);
}
already_AddRefed<TelephonyCallId>
GetSecondId() const;
void
GetSecondNumber(nsString& aSecondNumber) const
{
aSecondNumber.Assign(mSecondNumber);
}
void
GetState(nsString& aState) const
@ -118,9 +122,7 @@ public:
static already_AddRefed<TelephonyCall>
Create(Telephony* aTelephony, uint32_t aServiceId,
const nsAString& aNumber, uint16_t aNumberPresentation,
const nsAString& aName, uint16_t aNamePresentation,
uint16_t aCallState, uint32_t aCallIndex,
const nsAString& aNumber, uint16_t aCallState, uint32_t aCallIndex,
bool aEmergency = false, bool aIsConference = false,
bool aSwitchable = true, bool aMergeable = true);
@ -154,6 +156,12 @@ public:
mEmergency = aEmergency;
}
void
UpdateSecondNumber(const nsAString& aNumber)
{
mSecondNumber = aNumber;
}
void
UpdateSwitchable(bool aSwitchable) {
mSwitchable = aSwitchable;
@ -164,11 +172,6 @@ public:
mMergeable = aMergeable;
}
void
UpdateSecondId(TelephonyCallId* aId) {
mSecondId = aId;
}
void
NotifyError(const nsAString& aError);

Просмотреть файл

@ -1,77 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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/. */
#include "TelephonyCallId.h"
#include "nsITelephonyService.h"
namespace mozilla {
namespace dom {
TelephonyCallId::TelephonyCallId(nsPIDOMWindow* aWindow,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
: mWindow(aWindow), mNumber(aNumber), mNumberPresentation(aNumberPresentation),
mName(aName), mNamePresentation(aNamePresentation)
{
SetIsDOMBinding();
}
TelephonyCallId::~TelephonyCallId()
{
}
JSObject*
TelephonyCallId::WrapObject(JSContext* aCx)
{
return TelephonyCallIdBinding::Wrap(aCx, this);
}
CallIdPresentation
TelephonyCallId::GetPresentationStr(uint16_t aPresentation) const
{
switch (aPresentation) {
case nsITelephonyService::CALL_PRESENTATION_ALLOWED:
return CallIdPresentation::Allowed;
case nsITelephonyService::CALL_PRESENTATION_RESTRICTED:
return CallIdPresentation::Restricted;
case nsITelephonyService::CALL_PRESENTATION_UNKNOWN:
return CallIdPresentation::Unknown;
case nsITelephonyService::CALL_PRESENTATION_PAYPHONE:
return CallIdPresentation::Payphone;
default:
MOZ_ASSUME_UNREACHABLE("Bad presentation!");
}
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TelephonyCallId, mWindow)
NS_IMPL_CYCLE_COLLECTING_ADDREF(TelephonyCallId)
NS_IMPL_CYCLE_COLLECTING_RELEASE(TelephonyCallId)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TelephonyCallId)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
// WebIDL
CallIdPresentation
TelephonyCallId::NumberPresentation() const
{
return GetPresentationStr(mNumberPresentation);
}
CallIdPresentation
TelephonyCallId::NamePresentation() const
{
return GetPresentationStr(mNamePresentation);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,76 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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/. */
#ifndef mozilla_dom_TelephonyCallId_h
#define mozilla_dom_TelephonyCallId_h
#include "mozilla/dom/TelephonyCallIdBinding.h"
#include "mozilla/dom/telephony/TelephonyCommon.h"
#include "nsWrapperCache.h"
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class TelephonyCallId MOZ_FINAL : public nsISupports,
public nsWrapperCache
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TelephonyCallId)
TelephonyCallId(nsPIDOMWindow* aWindow, const nsAString& aNumber,
uint16_t aNumberPresentation, const nsAString& aName,
uint16_t aNamePresentation);
nsPIDOMWindow*
GetParentObject() const
{
return mWindow;
}
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// WebIDL
void
GetNumber(nsString& aNumber) const
{
aNumber.Assign(mNumber);
}
CallIdPresentation
NumberPresentation() const;
void
GetName(nsString& aName) const
{
aName.Assign(mName);
}
CallIdPresentation
NamePresentation() const;
private:
~TelephonyCallId();
nsCOMPtr<nsPIDOMWindow> mWindow;
nsString mNumber;
uint16_t mNumberPresentation;
nsString mName;
uint16_t mNamePresentation;
CallIdPresentation
GetPresentationStr(uint16_t aPresentation) const;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_TelephonyCallId_h

Просмотреть файл

@ -361,9 +361,7 @@ TelephonyService.prototype = {
for (let i = 0, indexes = Object.keys(calls); i < indexes.length; ++i) {
let call = calls[indexes[i]];
aListener.enumerateCallState(call.clientId, call.callIndex,
call.state, call.number,
call.numberPresentation, call.name,
call.namePresentation, call.isOutgoing,
call.state, call.number, call.isOutgoing,
call.isEmergency, call.isConference,
call.isSwitchable, call.isMergeable);
}
@ -731,9 +729,6 @@ TelephonyService.prototype = {
aCall.callIndex,
aCall.state,
aCall.number,
aCall.numberPresentation,
aCall.name,
aCall.namePresentation,
aCall.isOutgoing,
aCall.isEmergency,
aCall.isConference,
@ -798,13 +793,6 @@ TelephonyService.prototype = {
call.isMergeable = aCall.isMergeable != null ?
aCall.isMergeable : true;
call.numberPresentation = aCall.numberPresentation != null ?
aCall.numberPresentation : nsITelephonyProvider.CALL_PRESENTATION_ALLOWED;
call.name = aCall.name != null ?
aCall.name : "";
call.namePresentation = aCall.namePresentation != null ?
aCall.namePresentation : nsITelephonyProvider.CALL_PRESENTATION_ALLOWED;
this._currentCalls[aClientId][aCall.callIndex] = call;
}
@ -812,9 +800,6 @@ TelephonyService.prototype = {
call.callIndex,
call.state,
call.number,
call.numberPresentation,
call.name,
call.namePresentation,
call.isOutgoing,
call.isEmergency,
call.isConference,
@ -822,7 +807,7 @@ TelephonyService.prototype = {
call.isMergeable]);
},
notifyCdmaCallWaiting: function(aClientId, aCall) {
notifyCdmaCallWaiting: function(aClientId, aNumber) {
// We need to acquire a CPU wake lock to avoid the system falling into
// the sleep mode when the RIL handles the incoming call.
this._acquireCallRingWakeLock();
@ -833,11 +818,7 @@ TelephonyService.prototype = {
// call comes after a 3way call.
this.notifyCallDisconnected(aClientId, call);
}
this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId,
aCall.number,
aCall.numberPresentation,
aCall.name,
aCall.namePresentation]);
this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId, aNumber]);
},
notifySupplementaryService: function(aClientId, aCallIndex, aNotification) {

Просмотреть файл

@ -39,7 +39,7 @@ child:
NotifyCallStateChanged(uint32_t aClientId, IPCCallStateData aData);
NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
NotifyCdmaCallWaiting(uint32_t aClientId, nsString aNumber);
NotifyConferenceCallStateChanged(uint16_t aCallState);

Просмотреть файл

@ -65,9 +65,6 @@ TelephonyChild::RecvNotifyCallStateChanged(const uint32_t& aClientId,
aData.callIndex(),
aData.callState(),
aData.number(),
aData.numberPresentation(),
aData.name(),
aData.namePresentation(),
aData.isOutGoing(),
aData.isEmergency(),
aData.isConference(),
@ -78,15 +75,11 @@ TelephonyChild::RecvNotifyCallStateChanged(const uint32_t& aClientId,
bool
TelephonyChild::RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
const IPCCdmaWaitingCallData& aData)
const nsString& aNumber)
{
MOZ_ASSERT(mService);
mService->NotifyCdmaCallWaiting(aClientId,
aData.number(),
aData.numberPresentation(),
aData.name(),
aData.namePresentation());
mService->NotifyCdmaCallWaiting(aClientId, aNumber);
return true;
}
@ -165,9 +158,6 @@ TelephonyRequestChild::RecvNotifyEnumerateCallState(const uint32_t& aClientId,
aData.callIndex(),
aData.callState(),
aData.number(),
aData.numberPresentation(),
aData.name(),
aData.namePresentation(),
aData.isOutGoing(),
aData.isEmergency(),
aData.isConference(),

Просмотреть файл

@ -42,7 +42,7 @@ protected:
virtual bool
RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
const IPCCdmaWaitingCallData& aData) MOZ_OVERRIDE;
const nsString& aNumber) MOZ_OVERRIDE;
virtual bool
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) MOZ_OVERRIDE;

Просмотреть файл

@ -355,9 +355,6 @@ TelephonyIPCService::CallStateChanged(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -366,7 +363,6 @@ TelephonyIPCService::CallStateChanged(uint32_t aClientId,
{
for (uint32_t i = 0; i < mListeners.Length(); i++) {
mListeners[i]->CallStateChanged(aClientId, aCallIndex, aCallState, aNumber,
aNumberPresentation, aName, aNamePresentation,
aIsOutgoing, aIsEmergency, aIsConference,
aIsSwitchable, aIsMergeable);
}
@ -393,9 +389,6 @@ TelephonyIPCService::EnumerateCallState(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -407,14 +400,10 @@ TelephonyIPCService::EnumerateCallState(uint32_t aClientId,
NS_IMETHODIMP
TelephonyIPCService::NotifyCdmaCallWaiting(uint32_t aClientId,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
const nsAString& aNumber)
{
for (uint32_t i = 0; i < mListeners.Length(); i++) {
mListeners[i]->NotifyCdmaCallWaiting(aClientId, aNumber, aNumberPresentation,
aName, aNamePresentation);
mListeners[i]->NotifyCdmaCallWaiting(aClientId, aNumber);
}
return NS_OK;
}

Просмотреть файл

@ -283,9 +283,6 @@ TelephonyParent::CallStateChanged(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -295,7 +292,6 @@ TelephonyParent::CallStateChanged(uint32_t aClientId,
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber),
aNumberPresentation, nsString(aName), aNamePresentation,
aIsOutgoing, aIsEmergency, aIsConference,
aIsSwitchable, aIsMergeable);
return SendNotifyCallStateChanged(aClientId, data) ? NS_OK : NS_ERROR_FAILURE;
@ -321,9 +317,6 @@ TelephonyParent::EnumerateCallState(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -335,16 +328,12 @@ TelephonyParent::EnumerateCallState(uint32_t aClientId,
NS_IMETHODIMP
TelephonyParent::NotifyCdmaCallWaiting(uint32_t aClientId,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
const nsAString& aNumber)
{
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
IPCCdmaWaitingCallData data(nsString(aNumber), aNumberPresentation,
nsString(aName), aNamePresentation);
return SendNotifyCdmaCallWaiting(aClientId, data) ? NS_OK : NS_ERROR_FAILURE;
return SendNotifyCdmaCallWaiting(aClientId, nsString(aNumber))
? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
@ -441,9 +430,6 @@ TelephonyRequestParent::CallStateChanged(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -472,9 +458,6 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -484,7 +467,6 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber),
aNumberPresentation, nsString(aName), aNamePresentation,
aIsOutgoing, aIsEmergency, aIsConference,
aIsSwitchable, aIsMergeable);
return SendNotifyEnumerateCallState(aClientId, data) ? NS_OK
@ -493,10 +475,7 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
NS_IMETHODIMP
TelephonyRequestParent::NotifyCdmaCallWaiting(uint32_t aClientId,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation)
const nsAString& aNumber)
{
MOZ_CRASH("Not a TelephonyParent!");
}

Просмотреть файл

@ -13,9 +13,6 @@ struct IPCCallStateData
uint32_t callIndex;
uint16_t callState;
nsString number;
uint16_t numberPresentation;
nsString name;
uint16_t namePresentation;
bool isOutGoing;
bool isEmergency;
bool isConference;
@ -23,14 +20,6 @@ struct IPCCallStateData
bool isMergeable;
};
struct IPCCdmaWaitingCallData
{
nsString number;
uint16_t numberPresentation;
nsString name;
uint16_t namePresentation;
};
} /* namespace telephony */
} /* namespace dom */
} /* namespace mozilla */

Просмотреть файл

@ -15,7 +15,6 @@ EXPORTS.mozilla.dom += [
'Telephony.h',
'TelephonyCall.h',
'TelephonyCallGroup.h',
'TelephonyCallId.h',
]
EXPORTS.mozilla.dom.telephony += [
@ -33,7 +32,6 @@ UNIFIED_SOURCES += [
'Telephony.cpp',
'TelephonyCall.cpp',
'TelephonyCallGroup.cpp',
'TelephonyCallId.cpp',
'TelephonyFactory.cpp',
]

Просмотреть файл

@ -10,7 +10,7 @@
"@mozilla.org/telephony/gonktelephonyservice;1"
%}
[scriptable, uuid(8790e2cc-2c68-4ce9-90dc-f68e1b6e4886)]
[scriptable, uuid(2ff3dcbb-ae63-443e-9c5d-76811f2f9b42)]
interface nsIGonkTelephonyService : nsITelephonyService
{
void notifyCallDisconnected(in unsigned long clientId, in jsval call);
@ -20,7 +20,7 @@ interface nsIGonkTelephonyService : nsITelephonyService
void notifyCallStateChanged(in unsigned long clientId, in jsval call,
[optional] in boolean skipStateConversion);
void notifyCdmaCallWaiting(in unsigned long clientId, in jsval waitingCall);
void notifyCdmaCallWaiting(in unsigned long clientId, in AString number);
void notifySupplementaryService(in unsigned long clientId, in long callIndex,
in AString notification);

Просмотреть файл

@ -4,7 +4,7 @@
#include "nsISupports.idl"
[scriptable, uuid(464d4cf8-454a-4cdb-9329-bfe7ede97103)]
[scriptable, uuid(cd83030f-31eb-40c0-8f0e-0edef3527eec)]
interface nsITelephonyListener : nsISupports
{
/**
@ -18,14 +18,6 @@ interface nsITelephonyListener : nsISupports
* One of the nsITelephonyService::CALL_STATE_* values.
* @param number
* Number of the other party.
* @param numberPresentation
* Presentation of the call number.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
* @param name
* Name of the other party.
* @param namePresentation
* Presentation of the call name.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
* @param isOutgoing
* Indicates whether this call is outgoing or incoming.
* @param isEmergency
@ -43,9 +35,6 @@ interface nsITelephonyListener : nsISupports
in unsigned long callIndex,
in unsigned short callState,
in AString number,
in unsigned short numberPresentation,
in AString name,
in unsigned short namePresentation,
in boolean isOutgoing,
in boolean isEmergency,
in boolean isConference,
@ -82,14 +71,6 @@ interface nsITelephonyListener : nsISupports
* One of the nsITelephonyService::CALL_STATE_* values.
* @param number
* Number of the other party.
* @param numberPresentation
* Presentation of the call number.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
* @param name
* Name of the other party.
* @param namePresentation
* Presentation of the call name.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
* @param isOutgoing
* Indicates whether this call is outgoing or incoming.
* @param isConference
@ -105,9 +86,6 @@ interface nsITelephonyListener : nsISupports
in unsigned long callIndex,
in unsigned short callState,
in AString number,
in unsigned short numberPresentation,
in AString name,
in unsigned short namePresentation,
in boolean isOutgoing,
in boolean isEmergency,
in boolean isConference,
@ -149,20 +127,8 @@ interface nsITelephonyListener : nsISupports
Indicate the RIL client, 0 ~ (number of client - 1).
* @param number
* Number of the other party.
* @param numberPresentation
* Presentation of the call number.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
* @param name
* Name of the other party.
* @param namePresentation
* Presentation of the call name.
* One of the nsITelephonyService::CALL_PRESENTATION_* values.
*/
void notifyCdmaCallWaiting(in unsigned long clientId,
in AString number,
in unsigned short numberPresentation,
in AString name,
in unsigned short namePresentation);
void notifyCdmaCallWaiting(in unsigned long clientId, in AString number);
/**
* Called when RIL error occurs to creating or separating a conference call.
@ -221,11 +187,6 @@ interface nsITelephonyService : nsISupports
const unsigned short NOTIFICATION_REMOTE_HELD = 0;
const unsigned short NOTIFICATION_REMOTE_RESUMED = 1;
const unsigned short CALL_PRESENTATION_ALLOWED = 0;
const unsigned short CALL_PRESENTATION_RESTRICTED = 1;
const unsigned short CALL_PRESENTATION_UNKNOWN = 2;
const unsigned short CALL_PRESENTATION_PAYPHONE = 3;
readonly attribute unsigned long defaultServiceId;
/**

Просмотреть файл

@ -288,38 +288,6 @@ let emulator = (function() {
};
}
/**
* Convenient helper to check the expected call number and name.
*
* @param number
* A string sent to modem.
* @param numberPresentation
* An unsigned short integer sent to modem.
* @param name
* A string sent to modem.
* @param namePresentation
* An unsigned short integer sent to modem.
* @param receivedNumber
* A string exposed by Telephony API.
* @param receivedName
* A string exposed by Telephony API.
*/
function checkCallId(number, numberPresentation, name, namePresentation,
receivedNumber, receivedName) {
let expectedNum = !numberPresentation ? number : "";
is(receivedNumber, expectedNum, "check number per numberPresentation");
let expectedName;
if (numberPresentation) {
expectedName = "";
} else if (!namePresentation) {
expectedName = name ? name : "";
} else {
expectedName = "";
}
is(receivedName, expectedName, "check name per number/namePresentation");
}
/**
* Convenient helper to check the call list existing in the emulator.
*
@ -426,7 +394,7 @@ let emulator = (function() {
telephony.dial(number, serviceId).then(call => {
ok(call);
is(call.id.number, number);
is(call.number, number);
is(call.state, "dialing");
is(call.serviceId, serviceId);
@ -529,41 +497,14 @@ let emulator = (function() {
return deferred.promise;
}
/**
* Locally hang up a call.
*
* @param call
* A TelephonyCall object.
* @return A deferred promise.
*/
function hangUp(call) {
let deferred = Promise.defer();
call.ondisconnected = function(event) {
log("Received 'disconnected' call event");
call.ondisconnected = null;
checkEventCallState(event, call, "disconnected");
deferred.resolve(call);
};
call.hangUp();
return deferred.promise;
}
/**
* Simulate an incoming call.
*
* @param number
* A string.
* @param numberPresentation [optional]
* An unsigned short integer.
* @param name [optional]
* A string.
* @param namePresentation [optional]
* An unsigned short integer.
* @return A deferred promise.
*/
function remoteDial(number, numberPresentation, name, namePresentation) {
function remoteDial(number) {
log("Simulating an incoming call.");
let deferred = Promise.defer();
@ -575,17 +516,13 @@ let emulator = (function() {
let call = event.call;
ok(call);
is(call.number, number);
is(call.state, "incoming");
checkCallId(number, numberPresentation, name, namePresentation,
call.id.number, call.id.name);
deferred.resolve(call);
};
emulator.run("gsm call " + number);
numberPresentation = numberPresentation || "";
name = name || "";
namePresentation = namePresentation || "";
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
"," + namePresentation);
return deferred.promise;
}
@ -607,7 +544,7 @@ let emulator = (function() {
checkEventCallState(event, call, "connected");
deferred.resolve(call);
};
emulator.run("gsm accept " + call.id.number);
emulator.run("gsm accept " + call.number);
return deferred.promise;
}
@ -630,7 +567,7 @@ let emulator = (function() {
checkEventCallState(event, call, "disconnected");
deferred.resolve(call);
};
emulator.run("gsm cancel " + call.id.number);
emulator.run("gsm cancel " + call.number);
return deferred.promise;
}
@ -679,7 +616,7 @@ let emulator = (function() {
let check_onconnected = StateEventChecker('connected', 'onresuming');
for (let call of callsToAdd) {
let callName = "callToAdd (" + call.id.number + ')';
let callName = "callToAdd (" + call.number + ')';
let ongroupchange = callName + ".ongroupchange";
pending.push(ongroupchange);
@ -740,7 +677,7 @@ let emulator = (function() {
let check_onheld = StateEventChecker('held', 'onholding');
for (let call of calls) {
let callName = "call (" + call.id.number + ')';
let callName = "call (" + call.number + ')';
let onholding = callName + ".onholding";
pending.push(onholding);
@ -793,7 +730,7 @@ let emulator = (function() {
let check_onconnected = StateEventChecker('connected', 'onresuming');
for (let call of calls) {
let callName = "call (" + call.id.number + ')';
let callName = "call (" + call.number + ')';
let onresuming = callName + ".onresuming";
pending.push(onresuming);
@ -852,7 +789,7 @@ let emulator = (function() {
// Remained call in conference will be held.
for (let call of remainedCalls) {
let callName = "remainedCall (" + call.id.number + ')';
let callName = "remainedCall (" + call.number + ')';
let onstatechange = callName + ".onstatechange";
pending.push(onstatechange);
@ -863,7 +800,7 @@ let emulator = (function() {
// When a call is removed from conference with 2 calls, another one will be
// automatically removed from group and be put on hold.
for (let call of autoRemovedCalls) {
let callName = "autoRemovedCall (" + call.id.number + ')';
let callName = "autoRemovedCall (" + call.number + ')';
let ongroupchange = callName + ".ongroupchange";
pending.push(ongroupchange);
@ -936,7 +873,7 @@ let emulator = (function() {
// When a call is hang up from conference with 2 calls, another one will be
// automatically removed from group.
for (let call of autoRemovedCalls) {
let callName = "autoRemovedCall (" + call.id.number + ')';
let callName = "autoRemovedCall (" + call.number + ')';
let ongroupchange = callName + ".ongroupchange";
pending.push(ongroupchange);
@ -1025,8 +962,8 @@ let emulator = (function() {
function createCallAndAddToConference(inNumber, conferenceCalls) {
// Create an info array. allInfo = [info1, info2, ...].
let allInfo = conferenceCalls.map(function(call, i) {
return (i === 0) ? outCallStrPool(call.id.number)
: inCallStrPool(call.id.number);
return (i === 0) ? outCallStrPool(call.number)
: inCallStrPool(call.number);
});
// Define state property of the info array.
@ -1105,7 +1042,6 @@ let emulator = (function() {
this.gCheckAll = checkAll;
this.gDial = dial;
this.gAnswer = answer;
this.gHangUp = hangUp;
this.gHold = hold;
this.gRemoteDial = remoteDial;
this.gRemoteAnswer = remoteAnswer;

Просмотреть файл

@ -57,4 +57,3 @@ disabled = Bug 821958
[test_conference_three_hangup_one.js]
[test_conference_three_remove_one.js]
[test_outgoing_when_two_calls_on_line.js]
[test_call_presentation.js]

Просмотреть файл

@ -1,71 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
const ALLOWED = 0;
const RESTRICTED = 1;
const UNKNOWN = 2;
const PAYPHONE =3;
function getPresentationStr(presentation) {
let str;
switch (presentation) {
case ALLOWED:
str = "allowed";
break;
case RESTRICTED:
str = "restricted";
break;
case UNKNOWN:
str = "unknown";
break;
case PAYPHONE:
str = "payphone";
break;
}
return str;
}
function getNamePresentation(numberPresentation, namePresentation) {
// See TS 23.096 Figure 3a and Annex A Note 1.
if (!numberPresentation) {
if (namePresentation == undefined) {
namePresentation = ALLOWED;
}
} else {
namePresentation = ALLOWED;
}
return getPresentationStr(namePresentation);
}
function test(number, numberPresentation, name, namePresentation) {
return gRemoteDial(number, numberPresentation, name, namePresentation)
.then(call => {
is(call.id.numberPresentation, getPresentationStr(numberPresentation),
"check numberPresentation");
is(call.id.namePresentation,
getNamePresentation(numberPresentation, namePresentation),
"check namePresentation");
return call;
})
.then(gHangUp);
}
startTest(function() {
let inNumber = "5555550201";
Promise.resolve()
.then(() => test(inNumber, ALLOWED))
.then(() => test(inNumber, RESTRICTED))
.then(() => test(inNumber, UNKNOWN))
.then(() => test(inNumber, PAYPHONE))
.then(() => test(inNumber, ALLOWED, "TestName"))
.then(() => test(inNumber, ALLOWED, "TestName", ALLOWED))
.then(() => test(inNumber, ALLOWED, "TestName", RESTRICTED))
.then(() => test(inNumber, ALLOWED, "TestName", UNKNOWN))
.then(() => test(inNumber, RESTRICTED, "TestName", ALLOWED))
.then(() => test(inNumber, RESTRICTED, "TestName", RESTRICTED))
.then(() => test(inNumber, RESTRICTED, "TestName", UNKNOWN))
.then(finish);
});

Просмотреть файл

@ -14,7 +14,7 @@ function dial() {
telephony.dialEmergency(number).then(call => {
outgoing = call;
ok(outgoing);
is(outgoing.id.number, number);
is(outgoing.number, number);
is(outgoing.state, "dialing");
is(outgoing, telephony.active);

Просмотреть файл

@ -15,7 +15,7 @@ function dial() {
telephony.dial(outNumber).then(call => {
outgoingCall = call;
ok(outgoingCall);
is(outgoingCall.id.number, outNumber);
is(outgoingCall.number, outNumber);
is(outgoingCall.state, "dialing");
is(outgoingCall, telephony.active);
@ -74,7 +74,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
// Should be two calls now

Просмотреть файл

@ -15,7 +15,7 @@ function dial() {
telephony.dial(outNumber).then(call => {
outgoingCall = call;
ok(outgoingCall);
is(outgoingCall.id.number, outNumber);
is(outgoingCall.number, outNumber);
is(outgoingCall.state, "dialing");
is(outgoingCall, telephony.active);
@ -105,7 +105,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
// Should be two calls now

Просмотреть файл

@ -15,7 +15,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incoming = event.call;
ok(incoming);
is(incoming.id.number, number);
is(incoming.number, number);
is(incoming.state, "incoming");
//ok(telephony.calls === calls); // bug 717414

Просмотреть файл

@ -22,7 +22,7 @@ function simulateIncoming() {
incoming = event.call;
ok(incoming);
is(incoming.id.number, number);
is(incoming.number, number);
is(incoming.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -15,7 +15,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, number);
is(incomingCall.number, number);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -15,7 +15,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incoming = event.call;
ok(incoming);
is(incoming.id.number, number);
is(incoming.number, number);
is(incoming.state, "incoming");
//ok(telephony.calls === calls); // bug 717414

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -14,7 +14,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);

Просмотреть файл

@ -16,7 +16,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);
@ -99,7 +99,7 @@ function dial() {
telephony.dial(outNumber).then(call => {
outgoingCall = call;
ok(outgoingCall);
is(outgoingCall.id.number, outNumber);
is(outgoingCall.number, outNumber);
is(outgoingCall.state, "dialing");
is(outgoingCall, telephony.active);
is(telephony.calls.length, 2);

Просмотреть файл

@ -16,7 +16,7 @@ function simulateIncoming() {
log("Received 'incoming' call event.");
incomingCall = event.call;
ok(incomingCall);
is(incomingCall.id.number, inNumber);
is(incomingCall.number, inNumber);
is(incomingCall.state, "incoming");
is(telephony.calls.length, 1);
@ -112,7 +112,7 @@ function dial() {
telephony.dial(outNumber).then(call => {
outgoingCall = call;
ok(outgoingCall);
is(outgoingCall.id.number, outNumber);
is(outgoingCall.number, outNumber);
is(outgoingCall.state, "dialing");
is(outgoingCall, telephony.active);

Просмотреть файл

@ -14,7 +14,7 @@ function dial() {
telephony.dial(number).then(call => {
outgoing = call;
ok(outgoing);
is(outgoing.id.number, number);
is(outgoing.number, number);
is(outgoing.state, "dialing");
is(outgoing, telephony.active);

Просмотреть файл

@ -25,7 +25,7 @@ function dial() {
if (event.call.state == "dialing") {
outgoing = event.call;
ok(outgoing);
is(outgoing.id.number, number);
is(outgoing.number, number);
is(outgoing, telephony.active);
is(telephony.calls.length, 1);

Просмотреть файл

@ -13,7 +13,7 @@ function dial() {
telephony.dial(outNumber).then(call => {
outgoingCall = call;
ok(outgoingCall);
is(outgoingCall.id.number, outNumber);
is(outgoingCall.number, outNumber);
is(outgoingCall.state, "dialing");
is(outgoingCall, telephony.active);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше