mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge b2g-inbound to m-c.
This commit is contained in:
commit
a40ab9abb5
@ -32,22 +32,23 @@ XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsManager",
|
||||
|
||||
this.FxAccountsMgmtService = {
|
||||
|
||||
_sendChromeEvent: function(aMsg) {
|
||||
_sendChromeEvent: function(aEventName, aMsg) {
|
||||
if (!this._shell) {
|
||||
return;
|
||||
}
|
||||
this._shell.sendCustomEvent("mozFxAccountsChromeEvent", aMsg);
|
||||
log.debug("Chrome event " + JSON.stringify(aMsg));
|
||||
this._shell.sendCustomEvent(aEventName, aMsg);
|
||||
},
|
||||
|
||||
_onFullfill: function(aMsgId, aData) {
|
||||
this._sendChromeEvent({
|
||||
this._sendChromeEvent("mozFxAccountsChromeEvent", {
|
||||
id: aMsgId,
|
||||
data: aData ? aData : null
|
||||
});
|
||||
},
|
||||
|
||||
_onReject: function(aMsgId, aReason) {
|
||||
this._sendChromeEvent({
|
||||
this._sendChromeEvent("mozFxAccountsChromeEvent", {
|
||||
id: aMsgId,
|
||||
error: aReason ? aReason : null
|
||||
});
|
||||
@ -55,14 +56,30 @@ this.FxAccountsMgmtService = {
|
||||
|
||||
init: function() {
|
||||
Services.obs.addObserver(this, "content-start", false);
|
||||
Services.obs.addObserver(this, ONLOGIN_NOTIFICATION, false);
|
||||
Services.obs.addObserver(this, ONVERIFIED_NOTIFICATION, false);
|
||||
Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION, false);
|
||||
},
|
||||
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
this._shell = Services.wm.getMostRecentWindow("navigator:browser").shell;
|
||||
let content = this._shell.contentBrowser.contentWindow;
|
||||
content.addEventListener("mozFxAccountsContentEvent",
|
||||
FxAccountsMgmtService);
|
||||
Services.obs.removeObserver(this, "content-start");
|
||||
log.debug("Observed " + aTopic);
|
||||
switch (aTopic) {
|
||||
case "content-start":
|
||||
this._shell = Services.wm.getMostRecentWindow("navigator:browser").shell;
|
||||
let content = this._shell.contentBrowser.contentWindow;
|
||||
content.addEventListener("mozFxAccountsContentEvent",
|
||||
FxAccountsMgmtService);
|
||||
Services.obs.removeObserver(this, "content-start");
|
||||
break;
|
||||
case ONLOGIN_NOTIFICATION:
|
||||
case ONVERIFIED_NOTIFICATION:
|
||||
case ONLOGOUT_NOTIFICATION:
|
||||
// FxAccounts notifications have the form of fxaccounts:*
|
||||
this._sendChromeEvent("mozFxAccountsUnsolChromeEvent", {
|
||||
eventName: aTopic.substring(aTopic.indexOf(":") + 1)
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleEvent: function(aEvent) {
|
||||
|
@ -56,11 +56,11 @@ FxAccountsUIGlue.prototype = {
|
||||
});
|
||||
|
||||
let detail = {
|
||||
method: "openFlow",
|
||||
eventName: "openFlow",
|
||||
id: id
|
||||
};
|
||||
log.debug("Send chrome event " + JSON.stringify(detail));
|
||||
this._browser.shell.sendCustomEvent("mozFxAccountsRPChromeEvent", detail);
|
||||
this._browser.shell.sendCustomEvent("mozFxAccountsUnsolChromeEvent", detail);
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
|
@ -12,13 +12,13 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -11,10 +11,10 @@
|
||||
</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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -12,13 +12,13 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "0f4f24675eee8a4211d2535a1cfa280365d581dc",
|
||||
"revision": "806d5b997ec768914eaff1c46143c55de2612dbf",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -11,12 +11,12 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||
@ -90,7 +90,7 @@
|
||||
<project name="platform/system/netd" path="system/netd" revision="2e226e6e636ca0a8cc4c51093e46f4baba1ffcce"/>
|
||||
<project name="platform/system/vold" path="system/vold" revision="8ac5eef8ea3a456b96d52ce2091bf6d814782d8c"/>
|
||||
<!-- hamachi specific things -->
|
||||
<project name="quic/lf/b2g/build" path="device/qcom/b2g_common" revision="4970f51b2c66f842dfcbc8315c8e501d0b2ac791"/>
|
||||
<project name="quic/lf/b2g/build" path="device/qcom/b2g_common" revision="9b2d2215ee4b3413addf6222fb4ee520b2858472"/>
|
||||
<project name="quic/lf/b2g/external/jsmin" path="external/jsmin" revision="cec896f0affaa0226c02605ad28d42df1bc0e393"/>
|
||||
<project name="device/qcom/common" path="device/qcom/common" revision="d13aaf080177b7c48f243d51827db5c7a7873cd0"/>
|
||||
<project name="platform/vendor/qcom/msm7627a" path="device/qcom/msm7627a" revision="f06bcacc6f13cec895dc5d4c2385c076396194ec"/>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
|
@ -12,12 +12,12 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
|
||||
|
@ -11,12 +11,12 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -11,10 +11,10 @@
|
||||
</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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -11,12 +11,12 @@
|
||||
<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="a6f1bc96ac9e0a32022c75f0ee7771a2ab9050db"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="afa75c6f431b00a2cee83c48f1bf986fc1cd6df1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e2f73049f8d52fb06cb9b5d923c1280557aa9238"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -250,6 +250,8 @@ if test -n "$gonkdir" ; then
|
||||
;;
|
||||
19)
|
||||
GONK_INCLUDES="-I$gonkdir/frameworks/native/include"
|
||||
MOZ_B2G_BT=1
|
||||
MOZ_B2G_BT_BLUEDROID=1
|
||||
MOZ_NFC=1
|
||||
|
||||
;;
|
||||
|
@ -93,12 +93,12 @@ nsresult MediaOmxReader::InitOmxDecoder()
|
||||
sp<DataSource> dataSource = new MediaStreamSource(mDecoder->GetResource(), mDecoder);
|
||||
dataSource->initCheck();
|
||||
|
||||
sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);
|
||||
if (!extractor.get()) {
|
||||
mExtractor = MediaExtractor::Create(dataSource);
|
||||
if (!mExtractor.get()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mOmxDecoder = new OmxDecoder(mDecoder->GetResource(), mDecoder);
|
||||
if (!mOmxDecoder->Init(extractor)) {
|
||||
if (!mOmxDecoder->Init(mExtractor)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -134,6 +134,9 @@ nsresult MediaOmxReader::ReadMetadata(MediaInfo* aInfo,
|
||||
mDecoder->SetMediaDuration(durationUs);
|
||||
}
|
||||
|
||||
// Check the MediaExtract flag if the source is seekable.
|
||||
mDecoder->SetMediaSeekable(mExtractor->flags() & MediaExtractor::CAN_SEEK);
|
||||
|
||||
if (mOmxDecoder->HasVideo()) {
|
||||
int32_t width, height;
|
||||
mOmxDecoder->GetVideoParameters(&width, &height);
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
namespace android {
|
||||
class OmxDecoder;
|
||||
class MediaExtractor;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
@ -37,6 +38,8 @@ class MediaOmxReader : public MediaDecoderReader
|
||||
protected:
|
||||
android::sp<android::OmxDecoder> mOmxDecoder;
|
||||
|
||||
android::sp<android::MediaExtractor> mExtractor;
|
||||
|
||||
// Called by ReadMetadata() during MediaDecoderStateMachine::DecodeMetadata()
|
||||
// on decode thread. It create and initialize the OMX decoder including
|
||||
// setting up custom extractor. The extractor provide the essential
|
||||
|
@ -500,6 +500,13 @@ bool OmxDecoder::IsWaitingMediaResources()
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isInEmulator()
|
||||
{
|
||||
char propQemu[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.kernel.qemu", propQemu, "");
|
||||
return !strncmp(propQemu, "1", 1);
|
||||
}
|
||||
|
||||
bool OmxDecoder::AllocateMediaResources()
|
||||
{
|
||||
// OMXClient::connect() always returns OK and abort's fatally if
|
||||
@ -524,9 +531,7 @@ bool OmxDecoder::AllocateMediaResources()
|
||||
// up.
|
||||
int flags = kHardwareCodecsOnly;
|
||||
|
||||
char propQemu[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.kernel.qemu", propQemu, "");
|
||||
if (!strncmp(propQemu, "1", 1)) {
|
||||
if (isInEmulator()) {
|
||||
// If we are in emulator, allow to fall back to software.
|
||||
flags = 0;
|
||||
}
|
||||
@ -966,6 +971,16 @@ nsresult OmxDecoder::Play()
|
||||
// We need to fix it until it is really happened.
|
||||
void OmxDecoder::Pause()
|
||||
{
|
||||
/* The implementation of OMXCodec::pause is flawed.
|
||||
* OMXCodec::start will not restore from the paused state and result in
|
||||
* buffer timeout which causes timeouts in mochitests.
|
||||
* Since there is not power consumption problem in emulator, we will just
|
||||
* return when running in emulator to fix timeouts in mochitests.
|
||||
*/
|
||||
if (isInEmulator()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mVideoPaused || mAudioPaused) {
|
||||
return;
|
||||
}
|
||||
|
@ -371,6 +371,16 @@ if (navigator.userAgent.indexOf("Windows") == -1 ||
|
||||
{ name:"big-buck-bunny-unseekable.mp4", type:"video/mp4" }
|
||||
]);
|
||||
}
|
||||
// Android supports fragmented MP4 playback from 4.3.
|
||||
var androidVersion = SpecialPowers.Cc['@mozilla.org/system-info;1']
|
||||
.getService(SpecialPowers.Ci.nsIPropertyBag2)
|
||||
.getProperty('version');
|
||||
// Fragmented MP4.
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 && androidVersion >= 18) {
|
||||
gUnseekableTests = gUnseekableTests.concat([
|
||||
{ name:"street.mp4", type:"video/mp4" }
|
||||
]);
|
||||
}
|
||||
|
||||
// These are files suitable for using with a "new Audio" constructor.
|
||||
var gAudioTests = [
|
||||
@ -577,6 +587,15 @@ function getMajorMimeType(mimetype) {
|
||||
}
|
||||
}
|
||||
|
||||
function removeNodeAndSource(n) {
|
||||
n.remove();
|
||||
// force release of underlying decoder
|
||||
n.src = "";
|
||||
while (n.firstChild) {
|
||||
n.removeChild(n.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// Number of tests to run in parallel. Warning: Each media element requires
|
||||
// at least 3 threads (4 on Linux), and on Linux each thread uses 10MB of
|
||||
// virtual address space. Beware!
|
||||
@ -700,12 +719,12 @@ function MediaTestManager() {
|
||||
function mediaTestCleanup() {
|
||||
var V = document.getElementsByTagName("video");
|
||||
for (i=0; i<V.length; i++) {
|
||||
V[i].parentNode.removeChild(V[i]);
|
||||
removeNodeAndSource(V[i]);
|
||||
V[i] = null;
|
||||
}
|
||||
var A = document.getElementsByTagName("audio");
|
||||
for (i=0; i<A.length; i++) {
|
||||
A[i].parentNode.removeChild(A[i]);
|
||||
removeNodeAndSource(A[i]);
|
||||
A[i] = null;
|
||||
}
|
||||
SpecialPowers.forceGC();
|
||||
|
@ -155,6 +155,7 @@ support-files =
|
||||
sound.ogg
|
||||
spacestorm-1000Hz-100ms.ogg
|
||||
split.webm
|
||||
street.mp4
|
||||
test-1-mono.opus
|
||||
test-2-stereo.opus
|
||||
test-3-LCR.opus
|
||||
|
@ -22,6 +22,7 @@ for (var i = 0; i < parent.gSmallTests.length; ++i) {
|
||||
var elemType = /^audio/.test(test.type) ? "audio" : "video";
|
||||
// Associate these elements with the subframe's document
|
||||
var e = document.createElement(elemType);
|
||||
e.preload = "auto";
|
||||
if (e.canPlayType(test.type)) {
|
||||
e.src = test.name;
|
||||
e.addEventListener("loadeddata", loadedData, false);
|
||||
|
BIN
content/media/test/street.mp4
Normal file
BIN
content/media/test/street.mp4
Normal file
Binary file not shown.
@ -31,7 +31,9 @@ function ended1(e) {
|
||||
if (v._endCount == 2) {
|
||||
ok(true, "Playing after pause while ended works for " + v._name);
|
||||
v._finished = true;
|
||||
v.parentNode.removeChild(v);
|
||||
v.removeEventListener("loadedmetadata", start, false);
|
||||
v.removeEventListener("ended", ended1, false);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
return;
|
||||
}
|
||||
@ -56,12 +58,16 @@ function seeked2(e) {
|
||||
|
||||
ok(v.paused, "Paused after seek after pause while ended for " + v._name);
|
||||
v._finished = true;
|
||||
v.parentNode.removeChild(v);
|
||||
v.removeEventListener("loadedmetadata", start, false);
|
||||
v.removeEventListener("ended", ended2, false);
|
||||
v.removeEventListener("seeked", seeked2, false);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
|
||||
function createVideo(test, x, token) {
|
||||
var v = document.createElement('video');
|
||||
v.preload = "auto";
|
||||
v.token = token;
|
||||
manager.started(token);
|
||||
v.src = test.name;
|
||||
|
@ -39,6 +39,7 @@ function mediaEnded(event) {
|
||||
function startTest(test, token) {
|
||||
var elemType = /^audio/.test(test.type) ? "audio" : "video";
|
||||
var v1 = document.createElement(elemType);
|
||||
v1.preload = "auto";
|
||||
|
||||
v1.src = test.name;
|
||||
if (test.duration) {
|
||||
|
@ -17,6 +17,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=654550
|
||||
|
||||
/* Test for Bug 654550 */
|
||||
|
||||
// Parallel test must be disabled for media.video_stats.enabled is a global setting
|
||||
// to prevent the setting from changing unexpectedly in the middle of the test.
|
||||
PARALLEL_TESTS = 1;
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var manager = new MediaTestManager;
|
||||
|
||||
function checkStats(v, aShouldBeEnabled) {
|
||||
@ -46,6 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=654550
|
||||
SpecialPowers.setBoolPref("media.video_stats.enabled", true);
|
||||
v.removeEventListener("timeupdate", ontimeupdate);
|
||||
SpecialPowers.clearUserPref("media.video_stats.enabled");
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
}
|
||||
@ -59,7 +64,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=654550
|
||||
v.play();
|
||||
SpecialPowers.setBoolPref("media.video_stats.enabled", true);
|
||||
v.addEventListener("timeupdate", ontimeupdate);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
}
|
||||
|
||||
manager.runTests(gVideoTests, startTest);
|
||||
|
@ -48,6 +48,7 @@ function onended(event) {
|
||||
|
||||
function startTest(test, token) {
|
||||
var v = document.createElement('video');
|
||||
v.preload = "auto";
|
||||
v.token = token;
|
||||
manager.started(token);
|
||||
v.src = test.name;
|
||||
|
@ -57,6 +57,7 @@ function loadStart(evt) {
|
||||
// Create all video objects.
|
||||
for (var i=0; i<g404Tests.length; ++i) {
|
||||
var v = document.createElement("video");
|
||||
v.preload = "auto";
|
||||
var test = g404Tests[i];
|
||||
if (!v.canPlayType(test.type)) {
|
||||
continue;
|
||||
|
@ -34,6 +34,7 @@ function startTest(test, token) {
|
||||
v.addEventListener("error", function(e) {
|
||||
is(v.error.code, v.error.MEDIA_ERR_DECODE,
|
||||
"decoder should reject " + test.name);
|
||||
v.removeEventListener('error', arguments.callee, false);
|
||||
manager.finished(token);
|
||||
});
|
||||
|
||||
|
@ -62,7 +62,7 @@ var gMedia = null;
|
||||
|
||||
function createMedia(tag) {
|
||||
gMedia = document.createElement(tag);
|
||||
gMedia.setAttribute("preload", "auto");
|
||||
gMedia.preload = "auto";
|
||||
for (var i=0; i<gEventTypes.length; i++) {
|
||||
gMedia.addEventListener(gEventTypes[i], listener, false);
|
||||
}
|
||||
@ -166,8 +166,10 @@ var gTests = [
|
||||
|
||||
function nextTest() {
|
||||
if (gMedia) {
|
||||
if (gMedia.parentNode)
|
||||
gMedia.parentNode.removeChild(gMedia);
|
||||
for (var i=0; i<gEventTypes.length; i++) {
|
||||
gMedia.removeEventListener(gEventTypes[i], listener, false);
|
||||
}
|
||||
removeNodeAndSource(gMedia);
|
||||
gMedia = null;
|
||||
}
|
||||
gEventNum = 0;
|
||||
|
@ -44,6 +44,7 @@ var extension = {
|
||||
|
||||
function startTest(test, token) {
|
||||
var v = document.createElement('video');
|
||||
v.preload = "auto";
|
||||
v.addEventListener("error", function(){ok(false,"Error events on source children should not bubble");}, false);
|
||||
v.token = token;
|
||||
manager.started(token);
|
||||
|
@ -22,6 +22,8 @@ function cloneLoaded(event) {
|
||||
"Clone " + e.currentSrc + " duration: " + e.duration + " expected: " + e._expectedDuration);
|
||||
}
|
||||
|
||||
e.removeEventListener("loadeddata", cloneLoaded, false);
|
||||
|
||||
manager.finished(e.token);
|
||||
}
|
||||
|
||||
@ -37,6 +39,8 @@ function tryClone(event) {
|
||||
}
|
||||
|
||||
clone.addEventListener("loadeddata", cloneLoaded, false);
|
||||
|
||||
e.removeEventListener("loadeddata", tryClone, false);
|
||||
}
|
||||
|
||||
// This test checks that loading the same URI twice in different elements at the same time
|
||||
@ -49,6 +53,7 @@ function tryClone(event) {
|
||||
function initTest(test, token) {
|
||||
var elemType = /^audio/.test(test.type) ? "audio" : "video";
|
||||
var e = document.createElement(elemType);
|
||||
e.preload = "auto";
|
||||
if (e.canPlayType(test.type)) {
|
||||
e.src = test.name;
|
||||
if (test.duration) {
|
||||
|
@ -41,7 +41,7 @@ function startTest(test, token) {
|
||||
|
||||
v.addEventListener("ended", function (e) {
|
||||
ok(!e.target.loop, "Shouldn't get ended event while looping.");
|
||||
e.target.parentNode.removeChild(v);
|
||||
removeNodeAndSource(e.target);
|
||||
manager.finished(e.target.token);
|
||||
}, false);
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
var manager = new MediaTestManager;
|
||||
|
||||
function finish_test(element) {
|
||||
if (element.parentNode)
|
||||
element.parentNode.removeChild(element);
|
||||
element.removeEventListener("error", onerror, false);
|
||||
removeNodeAndSource(element);
|
||||
manager.finished(element.token);
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ var manager = new MediaTestManager;
|
||||
|
||||
function startTest(test, token) {
|
||||
var a = document.createElement('audio');
|
||||
a.preload = "auto";
|
||||
a.token = token;
|
||||
manager.started(token);
|
||||
|
||||
|
@ -21,6 +21,7 @@ function onloadedmetadata(e) {
|
||||
function startTest(test, token) {
|
||||
var elemType = /^audio/.test(test.type) ? "audio" : "video";
|
||||
var element = document.createElement(elemType);
|
||||
element.preload = "auto";
|
||||
|
||||
element.token = token;
|
||||
manager.started(token);
|
||||
|
@ -31,7 +31,7 @@ function ended(event) {
|
||||
var v = event.target;
|
||||
v._finished = true;
|
||||
is(v._state, "canplaythrough", "Last event should be canplaythrough for " + v.src);
|
||||
v.parentNode.removeChild(v);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ function startTest(test, token) {
|
||||
if (v.ended && v.seenSuspend && !v.finished) {
|
||||
v.finished = true;
|
||||
v.removeEventListener("timeupdate", timeUpdate, false);
|
||||
v.parentNode.removeChild(v);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
}}(test, v);
|
||||
@ -53,7 +53,7 @@ function startTest(test, token) {
|
||||
if (v.ended && !v.finished) {
|
||||
v.finished = true;
|
||||
v.removeEventListener("timeupdate", timeUpdate, false);
|
||||
v.parentNode.removeChild(v);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
}}(test, v);
|
||||
|
@ -49,9 +49,7 @@ function maybeFinish(v, n) {
|
||||
}
|
||||
v._finished = true;
|
||||
log(n + ",");
|
||||
if (v.parentNode) {
|
||||
v.parentNode.removeChild(v);
|
||||
}
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,9 @@ function do_ended(e) {
|
||||
var v = e.target;
|
||||
ok(!v._finished, "Only one ended event for " + v._name);
|
||||
v._finished = true;
|
||||
v.parentNode.removeChild(v);
|
||||
v.removeEventListener("ended", do_ended, false);
|
||||
v.removeEventListener("progress", do_progress, false);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@ var elements;
|
||||
function didPlay(event) {
|
||||
ok(true, "Element ended: " + event.target.currentSrc);
|
||||
|
||||
removeNodeAndSource(event.target);
|
||||
|
||||
--testsWaiting;
|
||||
if (testsWaiting == 0) {
|
||||
SimpleTest.finish();
|
||||
|
@ -53,6 +53,16 @@ function playing(evt) {
|
||||
evt.target._playingCount++;
|
||||
}
|
||||
|
||||
function removeNodeAndListener(n) {
|
||||
n.removeEventListener("loadedmetadata", loadedMetaData, false);
|
||||
n.removeEventListener("ended", playbackEnded, false);
|
||||
n.removeEventListener("playing", playing, false);
|
||||
n.removeEventListener("loadeddata", loadedData, false);
|
||||
n.removeEventListener("seeking", seekStarted, false);
|
||||
n.removeEventListener("seeked", seekEnded, false);
|
||||
removeNodeAndSource(n);
|
||||
}
|
||||
|
||||
function playbackEnded(evt) {
|
||||
var v = evt.target;
|
||||
v._endCount++;
|
||||
@ -72,13 +82,14 @@ function playbackEnded(evt) {
|
||||
is(v._endCount, 2, "Should have received two ended events for " + v._name);
|
||||
ok(v._playingCount > 0, "Should have at least one playing event for " + v._name);
|
||||
v._finished = true;
|
||||
v.parentNode.removeChild(v);
|
||||
removeNodeAndListener(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
}
|
||||
|
||||
function startTest(test, token) {
|
||||
var v = document.createElement('video');
|
||||
v.preload = "auto";
|
||||
v.token = token;
|
||||
manager.started(token);
|
||||
v.src = test.name;
|
||||
|
@ -36,7 +36,7 @@ function playbackEnded(e) {
|
||||
ok(v.ended, "Checking ended set after seeking to EOF and playing for " + v._name);
|
||||
ok(!v._finished, "Should only hit the end once for " + v._name);
|
||||
v._finished = true;
|
||||
v.parentNode.removeChild(v);
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
}
|
||||
|
||||
@ -57,6 +57,7 @@ function playing(e) {
|
||||
function initTest(test, token) {
|
||||
var type = getMajorMimeType(test.type);
|
||||
var v = document.createElement(type);
|
||||
v.preload = "auto";
|
||||
v.token = token;
|
||||
manager.started(token);
|
||||
v.src = test.name;
|
||||
|
@ -51,6 +51,7 @@ function createTestArray() {
|
||||
function startTest(test, token) {
|
||||
var elemType = getMajorMimeType(test.type);
|
||||
var element = document.createElement(elemType);
|
||||
element.preload = "auto";
|
||||
element.src = test.name;
|
||||
element.token = token;
|
||||
test.setup(element);
|
||||
|
@ -13,6 +13,8 @@
|
||||
<script class="testbody" type="text/javascript">
|
||||
var v1 = document.getElementById("v1");
|
||||
var a1 = document.getElementById("a1");
|
||||
v1.preload = "auto";
|
||||
a1.preload = "auto";
|
||||
|
||||
is(v1.src, "", "src should be null");
|
||||
is(a1.src, "", "src should be null");
|
||||
|
@ -32,9 +32,11 @@
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
var v = document.createElement('video');
|
||||
v.preload = "auto";
|
||||
v.innerHTML = "<source src=\"" + media.name + "?fail\" media=\"not all\">" +
|
||||
"<source src=\""+ media.name + "?pass\" media=\"all\">";
|
||||
var v2 = document.createElement("video");
|
||||
v2.preload = "auto";
|
||||
v2.innerHTML = "<source src=\""+ media.name +"?pass\">" +
|
||||
"<source src=\""+ media.name + "?fail\" media=\"all\">";
|
||||
document.body.appendChild(v);
|
||||
|
@ -40,10 +40,10 @@ function ended(e) {
|
||||
// confusing the test results.
|
||||
v.removeEventListener("ended", ended, false);
|
||||
v.removeEventListener("timeupdate", timeupdate, false);
|
||||
v.removeEventListener("timeupdate", logEvent, false);
|
||||
v.removeEventListener("pause", logEvent, false);
|
||||
v.removeEventListener("stalled", logEvent, false);
|
||||
v.parentNode.removeChild(v);
|
||||
for (var i = 0; i < eventsToLog.length; ++i) {
|
||||
v.removeEventListener(eventsToLog[i], logEvent, false);
|
||||
}
|
||||
removeNodeAndSource(v);
|
||||
manager.finished(v.token);
|
||||
},
|
||||
500);
|
||||
|
@ -508,8 +508,6 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function() {
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
|
||||
return {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
|
||||
|
||||
ril: null,
|
||||
pendingMessages: [], // For queueing "RIL:SetRadioEnabled" messages.
|
||||
timer: null,
|
||||
@ -518,7 +516,6 @@ XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
|
||||
|
||||
init: function(ril) {
|
||||
this.ril = ril;
|
||||
Services.obs.addObserver(this, kSysMsgListenerReadyObserverTopic, false);
|
||||
},
|
||||
|
||||
receiveMessage: function(msg) {
|
||||
@ -674,27 +671,6 @@ XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
|
||||
}
|
||||
this._processNextMessage();
|
||||
},
|
||||
|
||||
/**
|
||||
* nsIObserver interface methods.
|
||||
*/
|
||||
observe: function observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case kSysMsgListenerReadyObserverTopic:
|
||||
Services.obs.removeObserver(this, kSysMsgListenerReadyObserverTopic);
|
||||
|
||||
let numCards = this._getNumCards();
|
||||
for (let i = 0, N = this.ril.numRadioInterfaces; i < N; ++i) {
|
||||
if (this._isRadioAbleToEnableAtClient(i, numCards)) {
|
||||
let radioInterface = this.ril.getRadioInterface(i);
|
||||
radioInterface.setRadioEnabledInternal({enabled: true}, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -254,7 +254,6 @@ let RIL = {
|
||||
* One of the RADIO_STATE_* constants.
|
||||
*/
|
||||
this.radioState = GECKO_RADIOSTATE_UNAVAILABLE;
|
||||
this._isInitialRadioState = true;
|
||||
|
||||
/**
|
||||
* True if we are on CDMA network.
|
||||
@ -5256,13 +5255,7 @@ RIL[REQUEST_RADIO_POWER] = function(length, options) {
|
||||
this.cachedDialRequest.onerror(GECKO_ERROR_RADIO_NOT_AVAILABLE);
|
||||
this.cachedDialRequest = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._isInitialRadioState) {
|
||||
this._isInitialRadioState = false;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6081,14 +6074,6 @@ RIL[RIL_REQUEST_GPRS_ATTACH] = null;
|
||||
RIL[RIL_REQUEST_GPRS_DETACH] = null;
|
||||
RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function() {
|
||||
let radioState = Buf.readInt32();
|
||||
|
||||
// Ensure radio state at boot time.
|
||||
if (this._isInitialRadioState) {
|
||||
// Even radioState is RADIO_STATE_OFF, we still have to maually turn radio off,
|
||||
// otherwise REQUEST_GET_SIM_STATUS will still report CARD_STATE_PRESENT.
|
||||
this.setRadioEnabled({enabled: false});
|
||||
}
|
||||
|
||||
let newState;
|
||||
if (radioState == RADIO_STATE_UNAVAILABLE) {
|
||||
newState = GECKO_RADIOSTATE_UNAVAILABLE;
|
||||
@ -6403,6 +6388,8 @@ RIL[UNSOLICITED_RIL_CONNECTED] = function(length) {
|
||||
this.initRILState();
|
||||
// Always ensure that we are not in emergency callback mode when init.
|
||||
this.exitEmergencyCbMode();
|
||||
// Reset radio in the case that b2g restart (or crash).
|
||||
this.setRadioEnabled({enabled: false});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -198,7 +198,7 @@ InternalMethods.prototype = {
|
||||
// We are now ready for business. This should only be invoked once
|
||||
// per setSignedInUser(), regardless of whether we've rebooted since
|
||||
// setSignedInUser() was called.
|
||||
internal.notifyObservers(ONLOGIN_NOTIFICATION);
|
||||
internal.notifyObservers(ONVERIFIED_NOTIFICATION);
|
||||
return data;
|
||||
}.bind(this));
|
||||
},
|
||||
@ -327,7 +327,7 @@ InternalMethods.prototype = {
|
||||
// that will fire when we are completely ready.
|
||||
//
|
||||
// Login is truly complete once keys have been fetched, so once getKeys()
|
||||
// obtains and stores kA and kB, it will fire the onlogin observer
|
||||
// obtains and stores kA and kB, it will fire the onverified observer
|
||||
// notification.
|
||||
return this.whenVerified(data)
|
||||
.then((data) => this.getKeys(data));
|
||||
@ -457,8 +457,8 @@ this.FxAccounts.prototype = Object.freeze({
|
||||
// set() makes sure that polling is happening, if necessary.
|
||||
// get() does not wait for verification, and returns an object even if
|
||||
// unverified. The caller of get() must check .verified .
|
||||
// The "fxaccounts:onlogin" event will fire only when the verified state
|
||||
// goes from false to true, so callers must register their observer
|
||||
// The "fxaccounts:onverified" event will fire only when the verified
|
||||
// state goes from false to true, so callers must register their observer
|
||||
// and then call get(). In particular, it will not fire when the account
|
||||
// was found to be verified in a previous boot: if our stored state says
|
||||
// the account is verified, the event will never fire. So callers must do:
|
||||
@ -495,6 +495,7 @@ this.FxAccounts.prototype = Object.freeze({
|
||||
// We're telling the caller that this is durable now.
|
||||
return internal.signedInUserStorage.set(record)
|
||||
.then(() => {
|
||||
internal.notifyObservers(ONLOGIN_NOTIFICATION);
|
||||
if (!internal.isUserEmailVerified(credentials)) {
|
||||
internal.startVerifiedCheck(credentials);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ this.POLL_STEP = 1000 * 3; // 3 seconds
|
||||
|
||||
// Observer notifications.
|
||||
this.ONLOGIN_NOTIFICATION = "fxaccounts:onlogin";
|
||||
this.ONVERIFIED_NOTIFICATION = "fxaccounts:onverified";
|
||||
this.ONLOGOUT_NOTIFICATION = "fxaccounts:onlogout";
|
||||
|
||||
// Server errno.
|
||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FxAccounts.jsm");
|
||||
Cu.import("resource://gre/modules/FxAccountsClient.jsm");
|
||||
Cu.import("resource://gre/modules/FxAccountsCommon.js");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
@ -189,27 +190,35 @@ add_test(function test_client_mock() {
|
||||
|
||||
/*
|
||||
* Sign in a user, and after a little while, verify the user's email.
|
||||
* Right after signing in the user, we should get the 'onlogin' notification.
|
||||
* Polling should detect that the email is verified, and eventually
|
||||
* 'onlogin' should be observed
|
||||
* 'onverified' should be observed
|
||||
*/
|
||||
add_test(function test_verification_poll() {
|
||||
do_test_pending();
|
||||
|
||||
let fxa = new MockFxAccounts();
|
||||
let test_user = getTestUser("francine");
|
||||
let login_notification_received = false;
|
||||
|
||||
makeObserver("fxaccounts:onlogin", function() {
|
||||
log.debug("test_verification_poll observed onlogin");
|
||||
// Once email verification is complete, we will observe onlogin
|
||||
makeObserver(ONVERIFIED_NOTIFICATION, function() {
|
||||
log.debug("test_verification_poll observed onverified");
|
||||
// Once email verification is complete, we will observe onverified
|
||||
fxa.internal.getUserAccountData().then(user => {
|
||||
// And confirm that the user's state has changed
|
||||
do_check_eq(user.verified, true);
|
||||
do_check_eq(user.email, test_user.email);
|
||||
do_check_true(login_notification_received);
|
||||
do_test_finished();
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
makeObserver(ONLOGIN_NOTIFICATION, function() {
|
||||
log.debug("test_verification_poll observer onlogin");
|
||||
login_notification_received = true;
|
||||
});
|
||||
|
||||
fxa.setSignedInUser(test_user).then(() => {
|
||||
fxa.internal.getUserAccountData().then(user => {
|
||||
// The user is signing in, but email has not been verified yet
|
||||
@ -225,21 +234,21 @@ add_test(function test_verification_poll() {
|
||||
|
||||
/*
|
||||
* Sign in the user, but never verify the email. The check-email
|
||||
* poll should time out. No login event should be observed, and the
|
||||
* poll should time out. No verifiedlogin event should be observed, and the
|
||||
* internal whenVerified promise should be rejected
|
||||
*/
|
||||
add_test(function test_polling_timeout() {
|
||||
do_test_pending();
|
||||
|
||||
// This test could be better - the onlogin observer might fire on somebody
|
||||
// else's stack, and we're not making sure that we're not receiving such a
|
||||
// message. In other words, this tests either failure, or success, but not
|
||||
// both.
|
||||
// This test could be better - the onverified observer might fire on
|
||||
// somebody else's stack, and we're not making sure that we're not receiving
|
||||
// such a message. In other words, this tests either failure, or success, but
|
||||
// not both.
|
||||
|
||||
let fxa = new MockFxAccounts();
|
||||
let test_user = getTestUser("carol");
|
||||
|
||||
let removeObserver = makeObserver("fxaccounts:onlogin", function() {
|
||||
let removeObserver = makeObserver(ONVERIFIED_NOTIFICATION, function() {
|
||||
do_throw("We should not be getting a login event!");
|
||||
});
|
||||
|
||||
@ -304,7 +313,7 @@ add_test(function test_getKeys_no_token() {
|
||||
let user = getTestUser("lettuce.protheroe");
|
||||
delete user.keyFetchToken
|
||||
|
||||
makeObserver("fxaccounts:onlogout", function() {
|
||||
makeObserver(ONLOGOUT_NOTIFICATION, function() {
|
||||
log.debug("test_getKeys_no_token observed logout");
|
||||
fxa.internal.getUserAccountData().then(user => {
|
||||
do_test_finished();
|
||||
@ -329,9 +338,9 @@ add_test(function test_overlapping_signins() {
|
||||
let alice = getTestUser("alice");
|
||||
let bob = getTestUser("bob");
|
||||
|
||||
makeObserver("fxaccounts:onlogin", function() {
|
||||
log.debug("test_overlapping_signins observed onlogin");
|
||||
// Once email verification is complete, we will observe onlogin
|
||||
makeObserver(ONVERIFIED_NOTIFICATION, function() {
|
||||
log.debug("test_overlapping_signins observed onverified");
|
||||
// Once email verification is complete, we will observe onverified
|
||||
fxa.internal.getUserAccountData().then(user => {
|
||||
do_check_eq(user.email, bob.email);
|
||||
do_check_eq(user.verified, true);
|
||||
|
@ -107,7 +107,7 @@ WeaveService.prototype = {
|
||||
// This makes sure that Weave.Service is loaded
|
||||
Svc.Obs.notify("weave:service:setup-complete");
|
||||
// TODO: this shouldn't be here. It should be at the end
|
||||
// of the promise chain of the 'fxaccounts:onlogin' handler.
|
||||
// of the promise chain of the 'fxaccounts:onverified' handler.
|
||||
Weave.Utils.nextTick(Weave.Service.sync, Weave.Service);
|
||||
this.ensureLoaded();
|
||||
}
|
||||
@ -127,7 +127,7 @@ WeaveService.prototype = {
|
||||
let os = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
os.addObserver(this, "final-ui-startup", true);
|
||||
os.addObserver(this, "fxaccounts:onlogin", true);
|
||||
os.addObserver(this, "fxaccounts:onverified", true);
|
||||
os.addObserver(this, "fxaccounts:onlogout", true);
|
||||
break;
|
||||
|
||||
@ -161,7 +161,7 @@ WeaveService.prototype = {
|
||||
}, 10000, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
break;
|
||||
|
||||
case 'fxaccounts:onlogin':
|
||||
case 'fxaccounts:onverified':
|
||||
// Tell sync that if this is a first sync, it should try and sync the
|
||||
// server data with what is on the client - despite the name implying
|
||||
// otherwise, this is what "resetClient" does.
|
||||
|
@ -15,58 +15,40 @@
|
||||
"layout/base/tests/test_bug465448.xul":"",
|
||||
|
||||
"layout/forms/test/test_bug478219.xhtml":"window.closed not working, bug 907795",
|
||||
"content/media/test":"bug 918299",
|
||||
"content/media/test/test_bug448534.html": "Timed out, bug 894922? Bug 902677 is for the timing out of a lot of media tests",
|
||||
"content/media/mediasource/test/test_MediaSource.html": " ReferenceError: MediaSource is not defined",
|
||||
"content/media/test/test_autoplay_contentEditable.html": "bug 899074 - timeouts",
|
||||
"content/media/test/test_bug465498.html":"",
|
||||
"content/media/test/test_bug493187.html":"",
|
||||
"content/media/test/test_bug495300.html":"",
|
||||
"content/media/test/test_bug495145.html": "timed out",
|
||||
"content/media/test/test_bug654550.html": "timed out",
|
||||
"content/media/test/test_bug686942.html": "timed out",
|
||||
"content/media/test/test_buffered.html" : "assertion failures",
|
||||
"content/media/test/test_can_play_type.html":"timed out",
|
||||
"content/media/test/test_can_play_type_mpeg.html":"7 failures out of 27",
|
||||
"content/media/test/test_can_play_type_no_dash.html":"",
|
||||
"content/media/test/test_can_play_type_ogg.html":"",
|
||||
"content/media/test/test_chaining.html": "timed out",
|
||||
"content/media/test/test_delay_load.html": "6 failures",
|
||||
"content/media/test/test_error_on_404.html": "timed out",
|
||||
"content/media/test/test_framebuffer.html": "timed out",
|
||||
"content/media/test/test_info_leak.html": "2 failures",
|
||||
"content/media/test/test_load.html": "Timed out after gizmo.mp4",
|
||||
"content/media/test/test_load_candidates.html": "timed out",
|
||||
"content/media/test/test_load_same_resource.html": "",
|
||||
"content/media/test/test_media_selection.html": "timed out",
|
||||
"content/media/test/test_metadata.html": "",
|
||||
"content/media/test/test_mozHasAudio.html": "",
|
||||
"content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
|
||||
"content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
|
||||
"content/media/test/test_mediarecorder_record_4ch_audiocontext.html": "",
|
||||
"content/media/test/test_mediarecorder_creation_fail.html": "",
|
||||
"content/media/test/test_playback.html": "Test timed out, bug 668973?",
|
||||
"content/media/test/test_playback_rate.html": "",
|
||||
"content/media/test/test_playback_rate_playpause.html": "",
|
||||
"content/media/test/test_played.html": "",
|
||||
"content/media/test/test_progress.html": "bug 901716 - timeouts",
|
||||
"content/media/test/test_reactivate.html": "timed out in small-shot.mp3",
|
||||
"content/media/test/test_referer.html":"",
|
||||
"content/media/test/test_replay_metadata.html": "",
|
||||
"content/media/test/test_seekable1.html": "",
|
||||
"content/media/test/test_seekable3.html": "timed out",
|
||||
"content/media/test/test_seek.html": "",
|
||||
"content/media/test/test_seek_out_of_range.html": "",
|
||||
"content/media/test/test_source.html": "",
|
||||
"content/media/test/test_source_media.html": "",
|
||||
"content/media/test/test_streams_element_capture.html": "bug 900172 - timeouts",
|
||||
"content/media/test/test_streams_element_capture_reset.html": "bug 901102",
|
||||
"content/media/test/test_streams_gc.html": "Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value",
|
||||
"content/media/test/test_unseekable.html":"",
|
||||
"content/media/webaudio":"bug 916135",
|
||||
"content/media/webspeech/recognition/test/test_recognition_service_error.html": "timed out",
|
||||
"content/media/webspeech/synth/ipc/test/test_ipc.html": "comp.classes['@mozilla.org/special-powers-observer;1'] is undefined",
|
||||
"content/media/webspeech/synth/test/test_speech_queue.html": "Test timed out",
|
||||
"content/media/webspeech/synth/test/test_speech_simple.html": "Test timed out",
|
||||
|
||||
"content/media/webaudio/test/test_mozaudiochannel.html": "",
|
||||
|
||||
"dom/imptests/editing/selecttest/test_addRange.html": "oom?, bug 775227",
|
||||
"dom/imptests/html/dom/ranges/test_Range-insertNode.html":"oom?, bug 775227",
|
||||
"dom/imptests/html/dom/ranges/test_Range-cloneContents.html":"",
|
||||
|
Loading…
Reference in New Issue
Block a user