зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to m-i
This commit is contained in:
Коммит
448dc3df90
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
|
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</project>
|
</project>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
|
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"git": {
|
"git": {
|
||||||
"git_revision": "2a7461a2c839280440239214552d3c2cf79b5e2d",
|
"git_revision": "4d9b996be4b1935651057d0651461c1a36d98a18",
|
||||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||||
"branch": ""
|
"branch": ""
|
||||||
},
|
},
|
||||||
"revision": "229ccafd68fd865b99244b220ba2d1d13ff62621",
|
"revision": "616fa9b10c5e498a185d34f6da3cbd69fe2d0a24",
|
||||||
"repo_path": "integration/gaia-central"
|
"repo_path": "integration/gaia-central"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</project>
|
</project>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="2a7461a2c839280440239214552d3c2cf79b5e2d"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d9b996be4b1935651057d0651461c1a36d98a18"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||||
|
|
|
@ -654,7 +654,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return !this.state.localSrcVideoObject && !this.props.localPosterUrl;
|
return !this.state.localSrcMediaElement && !this.props.localPosterUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -665,7 +665,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(!this.state.remoteSrcVideoObject &&
|
return !!(!this.state.remoteSrcMediaElement &&
|
||||||
!this.props.remotePosterUrl &&
|
!this.props.remotePosterUrl &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
@ -702,14 +702,14 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
isRemoteLoading: this._isRemoteLoading(),
|
isRemoteLoading: this._isRemoteLoading(),
|
||||||
isScreenShareLoading: false,
|
isScreenShareLoading: false,
|
||||||
localPosterUrl: this.props.localPosterUrl,
|
localPosterUrl: this.props.localPosterUrl,
|
||||||
localSrcVideoObject: this.state.localSrcVideoObject,
|
localSrcMediaElement: this.state.localSrcMediaElement,
|
||||||
localVideoMuted: !this.props.video.enabled,
|
localVideoMuted: !this.props.video.enabled,
|
||||||
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
||||||
remotePosterUrl: this.props.remotePosterUrl,
|
remotePosterUrl: this.props.remotePosterUrl,
|
||||||
remoteSrcVideoObject: this.state.remoteSrcVideoObject,
|
remoteSrcMediaElement: this.state.remoteSrcMediaElement,
|
||||||
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
||||||
|
screenShareMediaElement: this.state.screenShareMediaElement,
|
||||||
screenSharePosterUrl: null,
|
screenSharePosterUrl: null,
|
||||||
screenShareVideoObject: this.state.screenShareVideoObject,
|
|
||||||
showContextRoomName: false,
|
showContextRoomName: false,
|
||||||
useDesktopPaths: true},
|
useDesktopPaths: true},
|
||||||
React.createElement(loop.shared.views.ConversationToolbar, {
|
React.createElement(loop.shared.views.ConversationToolbar, {
|
||||||
|
@ -822,7 +822,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
dispatcher: this.props.dispatcher,
|
dispatcher: this.props.dispatcher,
|
||||||
mediaConnected: this.state.mediaConnected,
|
mediaConnected: this.state.mediaConnected,
|
||||||
mozLoop: this.props.mozLoop,
|
mozLoop: this.props.mozLoop,
|
||||||
remoteSrcVideoObject: this.state.remoteSrcVideoObject,
|
remoteSrcMediaElement: this.state.remoteSrcMediaElement,
|
||||||
remoteVideoEnabled: this.state.remoteVideoEnabled,
|
remoteVideoEnabled: this.state.remoteVideoEnabled,
|
||||||
video: { enabled: !this.state.videoMuted, visible: true}})
|
video: { enabled: !this.state.videoMuted, visible: true}})
|
||||||
);
|
);
|
||||||
|
|
|
@ -654,7 +654,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return !this.state.localSrcVideoObject && !this.props.localPosterUrl;
|
return !this.state.localSrcMediaElement && !this.props.localPosterUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -665,7 +665,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(!this.state.remoteSrcVideoObject &&
|
return !!(!this.state.remoteSrcMediaElement &&
|
||||||
!this.props.remotePosterUrl &&
|
!this.props.remotePosterUrl &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
@ -702,14 +702,14 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
isRemoteLoading={this._isRemoteLoading()}
|
isRemoteLoading={this._isRemoteLoading()}
|
||||||
isScreenShareLoading={false}
|
isScreenShareLoading={false}
|
||||||
localPosterUrl={this.props.localPosterUrl}
|
localPosterUrl={this.props.localPosterUrl}
|
||||||
localSrcVideoObject={this.state.localSrcVideoObject}
|
localSrcMediaElement={this.state.localSrcMediaElement}
|
||||||
localVideoMuted={!this.props.video.enabled}
|
localVideoMuted={!this.props.video.enabled}
|
||||||
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
||||||
remotePosterUrl={this.props.remotePosterUrl}
|
remotePosterUrl={this.props.remotePosterUrl}
|
||||||
remoteSrcVideoObject={this.state.remoteSrcVideoObject}
|
remoteSrcMediaElement={this.state.remoteSrcMediaElement}
|
||||||
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
||||||
|
screenShareMediaElement={this.state.screenShareMediaElement}
|
||||||
screenSharePosterUrl={null}
|
screenSharePosterUrl={null}
|
||||||
screenShareVideoObject={this.state.screenShareVideoObject}
|
|
||||||
showContextRoomName={false}
|
showContextRoomName={false}
|
||||||
useDesktopPaths={true}>
|
useDesktopPaths={true}>
|
||||||
<loop.shared.views.ConversationToolbar
|
<loop.shared.views.ConversationToolbar
|
||||||
|
@ -822,7 +822,7 @@ loop.conversationViews = (function(mozL10n) {
|
||||||
dispatcher={this.props.dispatcher}
|
dispatcher={this.props.dispatcher}
|
||||||
mediaConnected={this.state.mediaConnected}
|
mediaConnected={this.state.mediaConnected}
|
||||||
mozLoop={this.props.mozLoop}
|
mozLoop={this.props.mozLoop}
|
||||||
remoteSrcVideoObject={this.state.remoteSrcVideoObject}
|
remoteSrcMediaElement={this.state.remoteSrcMediaElement}
|
||||||
remoteVideoEnabled={this.state.remoteVideoEnabled}
|
remoteVideoEnabled={this.state.remoteVideoEnabled}
|
||||||
video={{ enabled: !this.state.videoMuted, visible: true }} />
|
video={{ enabled: !this.state.videoMuted, visible: true }} />
|
||||||
);
|
);
|
||||||
|
|
|
@ -707,7 +707,7 @@ loop.roomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
||||||
!this.state.localSrcVideoObject;
|
!this.state.localSrcMediaElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -719,7 +719,7 @@ loop.roomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
||||||
!this.state.remoteSrcVideoObject &&
|
!this.state.remoteSrcMediaElement &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -801,14 +801,14 @@ loop.roomViews = (function(mozL10n) {
|
||||||
isRemoteLoading: this._isRemoteLoading(),
|
isRemoteLoading: this._isRemoteLoading(),
|
||||||
isScreenShareLoading: false,
|
isScreenShareLoading: false,
|
||||||
localPosterUrl: this.props.localPosterUrl,
|
localPosterUrl: this.props.localPosterUrl,
|
||||||
localSrcVideoObject: this.state.localSrcVideoObject,
|
localSrcMediaElement: this.state.localSrcMediaElement,
|
||||||
localVideoMuted: this.state.videoMuted,
|
localVideoMuted: this.state.videoMuted,
|
||||||
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
||||||
remotePosterUrl: this.props.remotePosterUrl,
|
remotePosterUrl: this.props.remotePosterUrl,
|
||||||
remoteSrcVideoObject: this.state.remoteSrcVideoObject,
|
remoteSrcMediaElement: this.state.remoteSrcMediaElement,
|
||||||
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
||||||
|
screenShareMediaElement: this.state.screenShareMediaElement,
|
||||||
screenSharePosterUrl: null,
|
screenSharePosterUrl: null,
|
||||||
screenShareVideoObject: this.state.screenShareVideoObject,
|
|
||||||
showContextRoomName: false,
|
showContextRoomName: false,
|
||||||
useDesktopPaths: true},
|
useDesktopPaths: true},
|
||||||
React.createElement(sharedViews.ConversationToolbar, {
|
React.createElement(sharedViews.ConversationToolbar, {
|
||||||
|
|
|
@ -707,7 +707,7 @@ loop.roomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
||||||
!this.state.localSrcVideoObject;
|
!this.state.localSrcMediaElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -719,7 +719,7 @@ loop.roomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
||||||
!this.state.remoteSrcVideoObject &&
|
!this.state.remoteSrcMediaElement &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -801,14 +801,14 @@ loop.roomViews = (function(mozL10n) {
|
||||||
isRemoteLoading={this._isRemoteLoading()}
|
isRemoteLoading={this._isRemoteLoading()}
|
||||||
isScreenShareLoading={false}
|
isScreenShareLoading={false}
|
||||||
localPosterUrl={this.props.localPosterUrl}
|
localPosterUrl={this.props.localPosterUrl}
|
||||||
localSrcVideoObject={this.state.localSrcVideoObject}
|
localSrcMediaElement={this.state.localSrcMediaElement}
|
||||||
localVideoMuted={this.state.videoMuted}
|
localVideoMuted={this.state.videoMuted}
|
||||||
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
||||||
remotePosterUrl={this.props.remotePosterUrl}
|
remotePosterUrl={this.props.remotePosterUrl}
|
||||||
remoteSrcVideoObject={this.state.remoteSrcVideoObject}
|
remoteSrcMediaElement={this.state.remoteSrcMediaElement}
|
||||||
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
||||||
|
screenShareMediaElement={this.state.screenShareMediaElement}
|
||||||
screenSharePosterUrl={null}
|
screenSharePosterUrl={null}
|
||||||
screenShareVideoObject={this.state.screenShareVideoObject}
|
|
||||||
showContextRoomName={false}
|
showContextRoomName={false}
|
||||||
useDesktopPaths={true}>
|
useDesktopPaths={true}>
|
||||||
<sharedViews.ConversationToolbar
|
<sharedViews.ConversationToolbar
|
||||||
|
|
|
@ -233,7 +233,7 @@ loop.shared.actions = (function() {
|
||||||
MediaStreamCreated: Action.define("mediaStreamCreated", {
|
MediaStreamCreated: Action.define("mediaStreamCreated", {
|
||||||
hasVideo: Boolean,
|
hasVideo: Boolean,
|
||||||
isLocal: Boolean,
|
isLocal: Boolean,
|
||||||
srcVideoObject: Object
|
srcMediaElement: Object
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,7 +294,7 @@ loop.shared.actions = (function() {
|
||||||
*/
|
*/
|
||||||
ReceivingScreenShare: Action.define("receivingScreenShare", {
|
ReceivingScreenShare: Action.define("receivingScreenShare", {
|
||||||
receiving: Boolean
|
receiving: Boolean
|
||||||
// srcVideoObject: Object (only present if receiving is true)
|
// srcMediaElement: Object (only present if receiving is true)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -106,15 +106,15 @@ loop.store.ActiveRoomStore = (function() {
|
||||||
*/
|
*/
|
||||||
_statesToResetOnLeave: [
|
_statesToResetOnLeave: [
|
||||||
"audioMuted",
|
"audioMuted",
|
||||||
"localSrcVideoObject",
|
"localSrcMediaElement",
|
||||||
"localVideoDimensions",
|
"localVideoDimensions",
|
||||||
"mediaConnected",
|
"mediaConnected",
|
||||||
"receivingScreenShare",
|
"receivingScreenShare",
|
||||||
"remoteSrcVideoObject",
|
"remoteSrcMediaElement",
|
||||||
"remoteVideoDimensions",
|
"remoteVideoDimensions",
|
||||||
"remoteVideoEnabled",
|
"remoteVideoEnabled",
|
||||||
"screenSharingState",
|
"screenSharingState",
|
||||||
"screenShareVideoObject",
|
"screenShareMediaElement",
|
||||||
"videoMuted"
|
"videoMuted"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -640,14 +640,14 @@ loop.store.ActiveRoomStore = (function() {
|
||||||
if (actionData.isLocal) {
|
if (actionData.isLocal) {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
localVideoEnabled: actionData.hasVideo,
|
localVideoEnabled: actionData.hasVideo,
|
||||||
localSrcVideoObject: actionData.srcVideoObject
|
localSrcMediaElement: actionData.srcMediaElement
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
remoteVideoEnabled: actionData.hasVideo,
|
remoteVideoEnabled: actionData.hasVideo,
|
||||||
remoteSrcVideoObject: actionData.srcVideoObject
|
remoteSrcMediaElement: actionData.srcMediaElement
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -659,13 +659,13 @@ loop.store.ActiveRoomStore = (function() {
|
||||||
mediaStreamDestroyed: function(actionData) {
|
mediaStreamDestroyed: function(actionData) {
|
||||||
if (actionData.isLocal) {
|
if (actionData.isLocal) {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
localSrcVideoObject: null
|
localSrcMediaElement: null
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
remoteSrcVideoObject: null
|
remoteSrcMediaElement: null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -713,13 +713,13 @@ loop.store.ActiveRoomStore = (function() {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
receivingScreenShare: actionData.receiving,
|
receivingScreenShare: actionData.receiving,
|
||||||
remoteVideoDimensions: newDimensions,
|
remoteVideoDimensions: newDimensions,
|
||||||
screenShareVideoObject: null
|
screenShareMediaElement: null
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
receivingScreenShare: actionData.receiving,
|
receivingScreenShare: actionData.receiving,
|
||||||
screenShareVideoObject: actionData.srcVideoObject ?
|
screenShareMediaElement: actionData.srcMediaElement ?
|
||||||
actionData.srcVideoObject : null
|
actionData.srcMediaElement : null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -829,7 +829,7 @@ loop.store.ActiveRoomStore = (function() {
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
participants: participants,
|
participants: participants,
|
||||||
roomState: ROOM_STATES.SESSION_CONNECTED,
|
roomState: ROOM_STATES.SESSION_CONNECTED,
|
||||||
remoteSrcVideoObject: null
|
remoteSrcMediaElement: null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -448,14 +448,14 @@ loop.store = loop.store || {};
|
||||||
if (actionData.isLocal) {
|
if (actionData.isLocal) {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
localVideoEnabled: actionData.hasVideo,
|
localVideoEnabled: actionData.hasVideo,
|
||||||
localSrcVideoObject: actionData.srcVideoObject
|
localSrcMediaElement: actionData.srcMediaElement
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
remoteVideoEnabled: actionData.hasVideo,
|
remoteVideoEnabled: actionData.hasVideo,
|
||||||
remoteSrcVideoObject: actionData.srcVideoObject
|
remoteSrcMediaElement: actionData.srcMediaElement
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -467,13 +467,13 @@ loop.store = loop.store || {};
|
||||||
mediaStreamDestroyed: function(actionData) {
|
mediaStreamDestroyed: function(actionData) {
|
||||||
if (actionData.isLocal) {
|
if (actionData.isLocal) {
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
localSrcVideoObject: null
|
localSrcMediaElement: null
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStoreState({
|
this.setStoreState({
|
||||||
remoteSrcVideoObject: null
|
remoteSrcMediaElement: null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -601,7 +601,7 @@ loop.OTSdkDriver = (function() {
|
||||||
this.dispatcher.dispatch(new sharedActions.MediaStreamCreated({
|
this.dispatcher.dispatch(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: sdkSubscriberObject.stream[STREAM_PROPERTIES.HAS_VIDEO],
|
hasVideo: sdkSubscriberObject.stream[STREAM_PROPERTIES.HAS_VIDEO],
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: sdkSubscriberVideo
|
srcMediaElement: sdkSubscriberVideo
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._subscribedRemoteStream = true;
|
this._subscribedRemoteStream = true;
|
||||||
|
@ -635,7 +635,7 @@ loop.OTSdkDriver = (function() {
|
||||||
// _handleRemoteScreenShareCreated. Maybe these should be separate
|
// _handleRemoteScreenShareCreated. Maybe these should be separate
|
||||||
// actions. But even so, this shouldn't be necessary....
|
// actions. But even so, this shouldn't be necessary....
|
||||||
this.dispatcher.dispatch(new sharedActions.ReceivingScreenShare({
|
this.dispatcher.dispatch(new sharedActions.ReceivingScreenShare({
|
||||||
receiving: true, srcVideoObject: sdkSubscriberVideo
|
receiving: true, srcMediaElement: sdkSubscriberVideo
|
||||||
}));
|
}));
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -767,7 +767,7 @@ loop.OTSdkDriver = (function() {
|
||||||
this.dispatcher.dispatch(new sharedActions.MediaStreamCreated({
|
this.dispatcher.dispatch(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: hasVideo,
|
hasVideo: hasVideo,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: sdkLocalVideo
|
srcMediaElement: sdkLocalVideo
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Only dispatch the video dimensions if we actually have video.
|
// Only dispatch the video dimensions if we actually have video.
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
* instead of the video, and attaching a video stream to the video element.
|
* instead of the video, and attaching a video stream to the video element.
|
||||||
*/
|
*/
|
||||||
var MediaView = React.createClass({displayName: "MediaView",
|
var MediaView = React.createClass({displayName: "MediaView",
|
||||||
// srcVideoObject should be ok for a shallow comparison, so we are safe
|
// srcMediaElement should be ok for a shallow comparison, so we are safe
|
||||||
// to use the pure render mixin here.
|
// to use the pure render mixin here.
|
||||||
mixins: [React.addons.PureRenderMixin],
|
mixins: [React.addons.PureRenderMixin],
|
||||||
|
|
||||||
|
@ -1085,18 +1085,18 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
mediaType: React.PropTypes.string.isRequired,
|
mediaType: React.PropTypes.string.isRequired,
|
||||||
posterUrl: React.PropTypes.string,
|
posterUrl: React.PropTypes.string,
|
||||||
// Expecting "local" or "remote".
|
// Expecting "local" or "remote".
|
||||||
srcVideoObject: React.PropTypes.object
|
srcMediaElement: React.PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
if (!this.props.displayAvatar) {
|
if (!this.props.displayAvatar) {
|
||||||
this.attachVideo(this.props.srcVideoObject);
|
this.attachVideo(this.props.srcMediaElement);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate: function() {
|
componentDidUpdate: function() {
|
||||||
if (!this.props.displayAvatar) {
|
if (!this.props.displayAvatar) {
|
||||||
this.attachVideo(this.props.srcVideoObject);
|
this.attachVideo(this.props.srcMediaElement);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1104,14 +1104,14 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
* Attaches a video stream from a donor video element to this component's
|
* Attaches a video stream from a donor video element to this component's
|
||||||
* video element if the component is displaying one.
|
* video element if the component is displaying one.
|
||||||
*
|
*
|
||||||
* @param {Object} srcVideoObject The src video object to clone the stream
|
* @param {Object} srcMediaElement The src video object to clone the stream
|
||||||
* from.
|
* from.
|
||||||
*
|
*
|
||||||
* XXX need to have a corresponding detachVideo or change this to syncVideo
|
* XXX need to have a corresponding detachVideo or change this to syncVideo
|
||||||
* to protect from leaks (bug 1171978)
|
* to protect from leaks (bug 1171978)
|
||||||
*/
|
*/
|
||||||
attachVideo: function(srcVideoObject) {
|
attachVideo: function(srcMediaElement) {
|
||||||
if (!srcVideoObject) {
|
if (!srcMediaElement) {
|
||||||
// Not got anything to display.
|
// Not got anything to display.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1141,8 +1141,8 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the object hasn't changed it, then don't reattach it.
|
// If the object hasn't changed it, then don't reattach it.
|
||||||
if (videoElement[attrName] !== srcVideoObject[attrName]) {
|
if (videoElement[attrName] !== srcMediaElement[attrName]) {
|
||||||
videoElement[attrName] = srcVideoObject[attrName];
|
videoElement[attrName] = srcMediaElement[attrName];
|
||||||
}
|
}
|
||||||
videoElement.play();
|
videoElement.play();
|
||||||
},
|
},
|
||||||
|
@ -1156,7 +1156,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
return React.createElement(AvatarView, null);
|
return React.createElement(AvatarView, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.props.srcVideoObject && !this.props.posterUrl) {
|
if (!this.props.srcMediaElement && !this.props.posterUrl) {
|
||||||
return React.createElement("div", {className: "no-video"});
|
return React.createElement("div", {className: "no-video"});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1192,16 +1192,16 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isScreenShareLoading: React.PropTypes.bool.isRequired,
|
isScreenShareLoading: React.PropTypes.bool.isRequired,
|
||||||
// The poster URLs are for UI-showcase testing and development.
|
// The poster URLs are for UI-showcase testing and development.
|
||||||
localPosterUrl: React.PropTypes.string,
|
localPosterUrl: React.PropTypes.string,
|
||||||
localSrcVideoObject: React.PropTypes.object,
|
localSrcMediaElement: React.PropTypes.object,
|
||||||
localVideoMuted: React.PropTypes.bool.isRequired,
|
localVideoMuted: React.PropTypes.bool.isRequired,
|
||||||
// Passing in matchMedia, allows it to be overriden for ui-showcase's
|
// Passing in matchMedia, allows it to be overriden for ui-showcase's
|
||||||
// benefit. We expect either the override or window.matchMedia.
|
// benefit. We expect either the override or window.matchMedia.
|
||||||
matchMedia: React.PropTypes.func.isRequired,
|
matchMedia: React.PropTypes.func.isRequired,
|
||||||
remotePosterUrl: React.PropTypes.string,
|
remotePosterUrl: React.PropTypes.string,
|
||||||
remoteSrcVideoObject: React.PropTypes.object,
|
remoteSrcMediaElement: React.PropTypes.object,
|
||||||
renderRemoteVideo: React.PropTypes.bool.isRequired,
|
renderRemoteVideo: React.PropTypes.bool.isRequired,
|
||||||
|
screenShareMediaElement: React.PropTypes.object,
|
||||||
screenSharePosterUrl: React.PropTypes.string,
|
screenSharePosterUrl: React.PropTypes.string,
|
||||||
screenShareVideoObject: React.PropTypes.object,
|
|
||||||
showContextRoomName: React.PropTypes.bool.isRequired,
|
showContextRoomName: React.PropTypes.bool.isRequired,
|
||||||
useDesktopPaths: React.PropTypes.bool.isRequired
|
useDesktopPaths: React.PropTypes.bool.isRequired
|
||||||
},
|
},
|
||||||
|
@ -1255,7 +1255,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading: this.props.isLocalLoading,
|
isLoading: this.props.isLocalLoading,
|
||||||
mediaType: "local",
|
mediaType: "local",
|
||||||
posterUrl: this.props.localPosterUrl,
|
posterUrl: this.props.localPosterUrl,
|
||||||
srcVideoObject: this.props.localSrcVideoObject})
|
srcMediaElement: this.props.localSrcMediaElement})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1274,9 +1274,9 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
var mediaWrapperClasses = React.addons.classSet({
|
var mediaWrapperClasses = React.addons.classSet({
|
||||||
"media-wrapper": true,
|
"media-wrapper": true,
|
||||||
"receiving-screen-share": this.props.displayScreenShare,
|
"receiving-screen-share": this.props.displayScreenShare,
|
||||||
"showing-local-streams": this.props.localSrcVideoObject ||
|
"showing-local-streams": this.props.localSrcMediaElement ||
|
||||||
this.props.localPosterUrl,
|
this.props.localPosterUrl,
|
||||||
"showing-remote-streams": this.props.remoteSrcVideoObject ||
|
"showing-remote-streams": this.props.remoteSrcMediaElement ||
|
||||||
this.props.remotePosterUrl || this.props.isRemoteLoading
|
this.props.remotePosterUrl || this.props.isRemoteLoading
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1291,7 +1291,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading: this.props.isRemoteLoading,
|
isLoading: this.props.isRemoteLoading,
|
||||||
mediaType: "remote",
|
mediaType: "remote",
|
||||||
posterUrl: this.props.remotePosterUrl,
|
posterUrl: this.props.remotePosterUrl,
|
||||||
srcVideoObject: this.props.remoteSrcVideoObject}),
|
srcMediaElement: this.props.remoteSrcMediaElement}),
|
||||||
this.state.localMediaAboslutelyPositioned ?
|
this.state.localMediaAboslutelyPositioned ?
|
||||||
this.renderLocalVideo() : null,
|
this.renderLocalVideo() : null,
|
||||||
this.props.children
|
this.props.children
|
||||||
|
@ -1302,7 +1302,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading: this.props.isScreenShareLoading,
|
isLoading: this.props.isScreenShareLoading,
|
||||||
mediaType: "screen-share",
|
mediaType: "screen-share",
|
||||||
posterUrl: this.props.screenSharePosterUrl,
|
posterUrl: this.props.screenSharePosterUrl,
|
||||||
srcVideoObject: this.props.screenShareVideoObject})
|
srcMediaElement: this.props.screenShareMediaElement})
|
||||||
),
|
),
|
||||||
React.createElement(loop.shared.views.chat.TextChatView, {
|
React.createElement(loop.shared.views.chat.TextChatView, {
|
||||||
dispatcher: this.props.dispatcher,
|
dispatcher: this.props.dispatcher,
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
* instead of the video, and attaching a video stream to the video element.
|
* instead of the video, and attaching a video stream to the video element.
|
||||||
*/
|
*/
|
||||||
var MediaView = React.createClass({
|
var MediaView = React.createClass({
|
||||||
// srcVideoObject should be ok for a shallow comparison, so we are safe
|
// srcMediaElement should be ok for a shallow comparison, so we are safe
|
||||||
// to use the pure render mixin here.
|
// to use the pure render mixin here.
|
||||||
mixins: [React.addons.PureRenderMixin],
|
mixins: [React.addons.PureRenderMixin],
|
||||||
|
|
||||||
|
@ -1085,18 +1085,18 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
mediaType: React.PropTypes.string.isRequired,
|
mediaType: React.PropTypes.string.isRequired,
|
||||||
posterUrl: React.PropTypes.string,
|
posterUrl: React.PropTypes.string,
|
||||||
// Expecting "local" or "remote".
|
// Expecting "local" or "remote".
|
||||||
srcVideoObject: React.PropTypes.object
|
srcMediaElement: React.PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
if (!this.props.displayAvatar) {
|
if (!this.props.displayAvatar) {
|
||||||
this.attachVideo(this.props.srcVideoObject);
|
this.attachVideo(this.props.srcMediaElement);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate: function() {
|
componentDidUpdate: function() {
|
||||||
if (!this.props.displayAvatar) {
|
if (!this.props.displayAvatar) {
|
||||||
this.attachVideo(this.props.srcVideoObject);
|
this.attachVideo(this.props.srcMediaElement);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1104,14 +1104,14 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
* Attaches a video stream from a donor video element to this component's
|
* Attaches a video stream from a donor video element to this component's
|
||||||
* video element if the component is displaying one.
|
* video element if the component is displaying one.
|
||||||
*
|
*
|
||||||
* @param {Object} srcVideoObject The src video object to clone the stream
|
* @param {Object} srcMediaElement The src video object to clone the stream
|
||||||
* from.
|
* from.
|
||||||
*
|
*
|
||||||
* XXX need to have a corresponding detachVideo or change this to syncVideo
|
* XXX need to have a corresponding detachVideo or change this to syncVideo
|
||||||
* to protect from leaks (bug 1171978)
|
* to protect from leaks (bug 1171978)
|
||||||
*/
|
*/
|
||||||
attachVideo: function(srcVideoObject) {
|
attachVideo: function(srcMediaElement) {
|
||||||
if (!srcVideoObject) {
|
if (!srcMediaElement) {
|
||||||
// Not got anything to display.
|
// Not got anything to display.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1141,8 +1141,8 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the object hasn't changed it, then don't reattach it.
|
// If the object hasn't changed it, then don't reattach it.
|
||||||
if (videoElement[attrName] !== srcVideoObject[attrName]) {
|
if (videoElement[attrName] !== srcMediaElement[attrName]) {
|
||||||
videoElement[attrName] = srcVideoObject[attrName];
|
videoElement[attrName] = srcMediaElement[attrName];
|
||||||
}
|
}
|
||||||
videoElement.play();
|
videoElement.play();
|
||||||
},
|
},
|
||||||
|
@ -1156,7 +1156,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
return <AvatarView />;
|
return <AvatarView />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.props.srcVideoObject && !this.props.posterUrl) {
|
if (!this.props.srcMediaElement && !this.props.posterUrl) {
|
||||||
return <div className="no-video"/>;
|
return <div className="no-video"/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1192,16 +1192,16 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isScreenShareLoading: React.PropTypes.bool.isRequired,
|
isScreenShareLoading: React.PropTypes.bool.isRequired,
|
||||||
// The poster URLs are for UI-showcase testing and development.
|
// The poster URLs are for UI-showcase testing and development.
|
||||||
localPosterUrl: React.PropTypes.string,
|
localPosterUrl: React.PropTypes.string,
|
||||||
localSrcVideoObject: React.PropTypes.object,
|
localSrcMediaElement: React.PropTypes.object,
|
||||||
localVideoMuted: React.PropTypes.bool.isRequired,
|
localVideoMuted: React.PropTypes.bool.isRequired,
|
||||||
// Passing in matchMedia, allows it to be overriden for ui-showcase's
|
// Passing in matchMedia, allows it to be overriden for ui-showcase's
|
||||||
// benefit. We expect either the override or window.matchMedia.
|
// benefit. We expect either the override or window.matchMedia.
|
||||||
matchMedia: React.PropTypes.func.isRequired,
|
matchMedia: React.PropTypes.func.isRequired,
|
||||||
remotePosterUrl: React.PropTypes.string,
|
remotePosterUrl: React.PropTypes.string,
|
||||||
remoteSrcVideoObject: React.PropTypes.object,
|
remoteSrcMediaElement: React.PropTypes.object,
|
||||||
renderRemoteVideo: React.PropTypes.bool.isRequired,
|
renderRemoteVideo: React.PropTypes.bool.isRequired,
|
||||||
|
screenShareMediaElement: React.PropTypes.object,
|
||||||
screenSharePosterUrl: React.PropTypes.string,
|
screenSharePosterUrl: React.PropTypes.string,
|
||||||
screenShareVideoObject: React.PropTypes.object,
|
|
||||||
showContextRoomName: React.PropTypes.bool.isRequired,
|
showContextRoomName: React.PropTypes.bool.isRequired,
|
||||||
useDesktopPaths: React.PropTypes.bool.isRequired
|
useDesktopPaths: React.PropTypes.bool.isRequired
|
||||||
},
|
},
|
||||||
|
@ -1255,7 +1255,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading={this.props.isLocalLoading}
|
isLoading={this.props.isLocalLoading}
|
||||||
mediaType="local"
|
mediaType="local"
|
||||||
posterUrl={this.props.localPosterUrl}
|
posterUrl={this.props.localPosterUrl}
|
||||||
srcVideoObject={this.props.localSrcVideoObject} />
|
srcMediaElement={this.props.localSrcMediaElement} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1274,9 +1274,9 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
var mediaWrapperClasses = React.addons.classSet({
|
var mediaWrapperClasses = React.addons.classSet({
|
||||||
"media-wrapper": true,
|
"media-wrapper": true,
|
||||||
"receiving-screen-share": this.props.displayScreenShare,
|
"receiving-screen-share": this.props.displayScreenShare,
|
||||||
"showing-local-streams": this.props.localSrcVideoObject ||
|
"showing-local-streams": this.props.localSrcMediaElement ||
|
||||||
this.props.localPosterUrl,
|
this.props.localPosterUrl,
|
||||||
"showing-remote-streams": this.props.remoteSrcVideoObject ||
|
"showing-remote-streams": this.props.remoteSrcMediaElement ||
|
||||||
this.props.remotePosterUrl || this.props.isRemoteLoading
|
this.props.remotePosterUrl || this.props.isRemoteLoading
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1291,7 +1291,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading={this.props.isRemoteLoading}
|
isLoading={this.props.isRemoteLoading}
|
||||||
mediaType="remote"
|
mediaType="remote"
|
||||||
posterUrl={this.props.remotePosterUrl}
|
posterUrl={this.props.remotePosterUrl}
|
||||||
srcVideoObject={this.props.remoteSrcVideoObject} />
|
srcMediaElement={this.props.remoteSrcMediaElement} />
|
||||||
{ this.state.localMediaAboslutelyPositioned ?
|
{ this.state.localMediaAboslutelyPositioned ?
|
||||||
this.renderLocalVideo() : null }
|
this.renderLocalVideo() : null }
|
||||||
{ this.props.children }
|
{ this.props.children }
|
||||||
|
@ -1302,7 +1302,7 @@ loop.shared.views = (function(_, mozL10n) {
|
||||||
isLoading={this.props.isScreenShareLoading}
|
isLoading={this.props.isScreenShareLoading}
|
||||||
mediaType="screen-share"
|
mediaType="screen-share"
|
||||||
posterUrl={this.props.screenSharePosterUrl}
|
posterUrl={this.props.screenSharePosterUrl}
|
||||||
srcVideoObject={this.props.screenShareVideoObject} />
|
srcMediaElement={this.props.screenShareMediaElement} />
|
||||||
</div>
|
</div>
|
||||||
<loop.shared.views.chat.TextChatView
|
<loop.shared.views.chat.TextChatView
|
||||||
dispatcher={this.props.dispatcher}
|
dispatcher={this.props.dispatcher}
|
||||||
|
|
|
@ -513,7 +513,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
||||||
!this.state.localSrcVideoObject;
|
!this.state.localSrcMediaElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -525,7 +525,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
||||||
!this.state.remoteSrcVideoObject &&
|
!this.state.remoteSrcMediaElement &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isScreenShareLoading: function() {
|
_isScreenShareLoading: function() {
|
||||||
return this.state.receivingScreenShare &&
|
return this.state.receivingScreenShare &&
|
||||||
!this.state.screenShareVideoObject &&
|
!this.state.screenShareMediaElement &&
|
||||||
!this.props.screenSharePosterUrl;
|
!this.props.screenSharePosterUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -557,14 +557,14 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
isRemoteLoading: this._isRemoteLoading(),
|
isRemoteLoading: this._isRemoteLoading(),
|
||||||
isScreenShareLoading: this._isScreenShareLoading(),
|
isScreenShareLoading: this._isScreenShareLoading(),
|
||||||
localPosterUrl: this.props.localPosterUrl,
|
localPosterUrl: this.props.localPosterUrl,
|
||||||
localSrcVideoObject: this.state.localSrcVideoObject,
|
localSrcMediaElement: this.state.localSrcMediaElement,
|
||||||
localVideoMuted: this.state.videoMuted,
|
localVideoMuted: this.state.videoMuted,
|
||||||
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
matchMedia: this.state.matchMedia || window.matchMedia.bind(window),
|
||||||
remotePosterUrl: this.props.remotePosterUrl,
|
remotePosterUrl: this.props.remotePosterUrl,
|
||||||
remoteSrcVideoObject: this.state.remoteSrcVideoObject,
|
remoteSrcMediaElement: this.state.remoteSrcMediaElement,
|
||||||
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
renderRemoteVideo: this.shouldRenderRemoteVideo(),
|
||||||
|
screenShareMediaElement: this.state.screenShareMediaElement,
|
||||||
screenSharePosterUrl: this.props.screenSharePosterUrl,
|
screenSharePosterUrl: this.props.screenSharePosterUrl,
|
||||||
screenShareVideoObject: this.state.screenShareVideoObject,
|
|
||||||
showContextRoomName: true,
|
showContextRoomName: true,
|
||||||
useDesktopPaths: false},
|
useDesktopPaths: false},
|
||||||
React.createElement(StandaloneRoomInfoArea, {activeRoomStore: this.props.activeRoomStore,
|
React.createElement(StandaloneRoomInfoArea, {activeRoomStore: this.props.activeRoomStore,
|
||||||
|
|
|
@ -513,7 +513,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isLocalLoading: function () {
|
_isLocalLoading: function () {
|
||||||
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
return this.state.roomState === ROOM_STATES.MEDIA_WAIT &&
|
||||||
!this.state.localSrcVideoObject;
|
!this.state.localSrcMediaElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -525,7 +525,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isRemoteLoading: function() {
|
_isRemoteLoading: function() {
|
||||||
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
return !!(this.state.roomState === ROOM_STATES.HAS_PARTICIPANTS &&
|
||||||
!this.state.remoteSrcVideoObject &&
|
!this.state.remoteSrcMediaElement &&
|
||||||
!this.state.mediaConnected);
|
!this.state.mediaConnected);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
*/
|
*/
|
||||||
_isScreenShareLoading: function() {
|
_isScreenShareLoading: function() {
|
||||||
return this.state.receivingScreenShare &&
|
return this.state.receivingScreenShare &&
|
||||||
!this.state.screenShareVideoObject &&
|
!this.state.screenShareMediaElement &&
|
||||||
!this.props.screenSharePosterUrl;
|
!this.props.screenSharePosterUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -557,14 +557,14 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
isRemoteLoading={this._isRemoteLoading()}
|
isRemoteLoading={this._isRemoteLoading()}
|
||||||
isScreenShareLoading={this._isScreenShareLoading()}
|
isScreenShareLoading={this._isScreenShareLoading()}
|
||||||
localPosterUrl={this.props.localPosterUrl}
|
localPosterUrl={this.props.localPosterUrl}
|
||||||
localSrcVideoObject={this.state.localSrcVideoObject}
|
localSrcMediaElement={this.state.localSrcMediaElement}
|
||||||
localVideoMuted={this.state.videoMuted}
|
localVideoMuted={this.state.videoMuted}
|
||||||
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
matchMedia={this.state.matchMedia || window.matchMedia.bind(window)}
|
||||||
remotePosterUrl={this.props.remotePosterUrl}
|
remotePosterUrl={this.props.remotePosterUrl}
|
||||||
remoteSrcVideoObject={this.state.remoteSrcVideoObject}
|
remoteSrcMediaElement={this.state.remoteSrcMediaElement}
|
||||||
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
renderRemoteVideo={this.shouldRenderRemoteVideo()}
|
||||||
|
screenShareMediaElement={this.state.screenShareMediaElement}
|
||||||
screenSharePosterUrl={this.props.screenSharePosterUrl}
|
screenSharePosterUrl={this.props.screenSharePosterUrl}
|
||||||
screenShareVideoObject={this.state.screenShareVideoObject}
|
|
||||||
showContextRoomName={true}
|
showContextRoomName={true}
|
||||||
useDesktopPaths={false}>
|
useDesktopPaths={false}>
|
||||||
<StandaloneRoomInfoArea activeRoomStore={this.props.activeRoomStore}
|
<StandaloneRoomInfoArea activeRoomStore={this.props.activeRoomStore}
|
||||||
|
|
|
@ -538,7 +538,7 @@ describe("loop.conversationViews", function () {
|
||||||
|
|
||||||
it("should display the remote video when the stream is enabled", function() {
|
it("should display the remote video when the stream is enabled", function() {
|
||||||
conversationStore.setStoreState({
|
conversationStore.setStoreState({
|
||||||
remoteSrcVideoObject: { fake: 1 }
|
remoteSrcMediaElement: { fake: 1 }
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
|
@ -551,7 +551,7 @@ describe("loop.conversationViews", function () {
|
||||||
|
|
||||||
it("should display the local video when the stream is enabled", function() {
|
it("should display the local video when the stream is enabled", function() {
|
||||||
conversationStore.setStoreState({
|
conversationStore.setStoreState({
|
||||||
localSrcVideoObject: { fake: 1 }
|
localSrcMediaElement: { fake: 1 }
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
|
|
|
@ -594,11 +594,11 @@ describe("loop.roomViews", function () {
|
||||||
sinon.assert.calledOnce(onCallTerminatedStub);
|
sinon.assert.calledOnce(onCallTerminatedStub);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should display loading spinner when localSrcVideoObject is null",
|
it("should display loading spinner when localSrcMediaElement is null",
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.MEDIA_WAIT,
|
roomState: ROOM_STATES.MEDIA_WAIT,
|
||||||
localSrcVideoObject: null
|
localSrcMediaElement: null
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
@ -611,7 +611,7 @@ describe("loop.roomViews", function () {
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.MEDIA_WAIT,
|
roomState: ROOM_STATES.MEDIA_WAIT,
|
||||||
localSrcVideoObject: { fake: "video" }
|
localSrcMediaElement: { fake: "video" }
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
@ -624,7 +624,7 @@ describe("loop.roomViews", function () {
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: null
|
remoteSrcMediaElement: null
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
@ -637,7 +637,7 @@ describe("loop.roomViews", function () {
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: { fake: "video" }
|
remoteSrcMediaElement: { fake: "video" }
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
@ -664,7 +664,7 @@ describe("loop.roomViews", function () {
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
mediaConnected: true,
|
mediaConnected: true,
|
||||||
remoteVideoEnabled: true,
|
remoteVideoEnabled: true,
|
||||||
remoteSrcVideoObject: { fake: 1 }
|
remoteSrcMediaElement: { fake: 1 }
|
||||||
});
|
});
|
||||||
|
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
@ -684,7 +684,7 @@ describe("loop.roomViews", function () {
|
||||||
|
|
||||||
it("should display the local video when the stream is enabled", function() {
|
it("should display the local video when the stream is enabled", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
localSrcVideoObject: { fake: 1 },
|
localSrcMediaElement: { fake: 1 },
|
||||||
videoMuted: false
|
videoMuted: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -995,23 +995,23 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#mediaStreamCreated", function() {
|
describe("#mediaStreamCreated", function() {
|
||||||
var fakeVideoElement;
|
var fakeStreamElement;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
fakeVideoElement = {name: "fakeVideoElement"};
|
fakeStreamElement = {name: "fakeStreamElement"};
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should add a local video object to the store", function() {
|
it("should add a local video object to the store", function() {
|
||||||
expect(store.getStoreState()).to.not.have.property("localSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("localSrcMediaElement");
|
||||||
|
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().localSrcMediaElement).eql(fakeStreamElement);
|
||||||
expect(store.getStoreState()).to.not.have.property("remoteSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("remoteSrcMediaElement");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set the local video enabled", function() {
|
it("should set the local video enabled", function() {
|
||||||
|
@ -1023,7 +1023,7 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localVideoEnabled).eql(true);
|
expect(store.getStoreState().localVideoEnabled).eql(true);
|
||||||
|
@ -1031,16 +1031,16 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should add a remote video object to the store", function() {
|
it("should add a remote video object to the store", function() {
|
||||||
expect(store.getStoreState()).to.not.have.property("remoteSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("remoteSrcMediaElement");
|
||||||
|
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState()).not.have.property("localSrcVideoObject");
|
expect(store.getStoreState()).not.have.property("localSrcMediaElement");
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(fakeStreamElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set the remote video enabled", function() {
|
it("should set the remote video enabled", function() {
|
||||||
|
@ -1052,7 +1052,7 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localVideoEnabled).eql(false);
|
expect(store.getStoreState().localVideoEnabled).eql(false);
|
||||||
|
@ -1061,14 +1061,14 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#mediaStreamDestroyed", function() {
|
describe("#mediaStreamDestroyed", function() {
|
||||||
var fakeVideoElement;
|
var fakeStreamElement;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
fakeVideoElement = {name: "fakeVideoElement"};
|
fakeStreamElement = {name: "fakeStreamElement"};
|
||||||
|
|
||||||
store.setStoreState({
|
store.setStoreState({
|
||||||
localSrcVideoObject: fakeVideoElement,
|
localSrcMediaElement: fakeStreamElement,
|
||||||
remoteSrcVideoObject: fakeVideoElement
|
remoteSrcMediaElement: fakeStreamElement
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1077,8 +1077,8 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
isLocal: true
|
isLocal: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(null);
|
expect(store.getStoreState().localSrcMediaElement).eql(null);
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(fakeStreamElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clear the remote video object", function() {
|
it("should clear the remote video object", function() {
|
||||||
|
@ -1086,8 +1086,8 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
isLocal: false
|
isLocal: false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().localSrcMediaElement).eql(fakeStreamElement);
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(null);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1166,32 +1166,32 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
expect(store.getStoreState().receivingScreenShare).eql(true);
|
expect(store.getStoreState().receivingScreenShare).eql(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should add a screenShareVideoObject to the store when sharing is active", function() {
|
it("should add a screenShareMediaElement to the store when sharing is active", function() {
|
||||||
var fakeVideoElement = {name: "fakeVideoElement"};
|
var fakeStreamElement = {name: "fakeStreamElement"};
|
||||||
expect(store.getStoreState()).to.not.have.property("screenShareVideoObject");
|
expect(store.getStoreState()).to.not.have.property("screenShareMediaElement");
|
||||||
|
|
||||||
store.receivingScreenShare(new sharedActions.ReceivingScreenShare({
|
store.receivingScreenShare(new sharedActions.ReceivingScreenShare({
|
||||||
receiving: true,
|
receiving: true,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState()).to.have.property("screenShareVideoObject",
|
expect(store.getStoreState()).to.have.property("screenShareMediaElement",
|
||||||
fakeVideoElement);
|
fakeStreamElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clear the screenShareVideoObject from the store when sharing is inactive", function() {
|
it("should clear the screenShareMediaElement from the store when sharing is inactive", function() {
|
||||||
store.setStoreState({
|
store.setStoreState({
|
||||||
screenShareVideoObject: {
|
screenShareMediaElement: {
|
||||||
name: "fakeVideoElement"
|
name: "fakeStreamElement"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
store.receivingScreenShare(new sharedActions.ReceivingScreenShare({
|
store.receivingScreenShare(new sharedActions.ReceivingScreenShare({
|
||||||
receiving: false,
|
receiving: false,
|
||||||
srcVideoObject: null
|
srcMediaElement: null
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().screenShareVideoObject).eql(null);
|
expect(store.getStoreState().screenShareMediaElement).eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should delete the screen remote video dimensions if screen sharing is not active", function() {
|
it("should delete the screen remote video dimensions if screen sharing is not active", function() {
|
||||||
|
@ -1356,14 +1356,14 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||||
expect(store.getStoreState().mediaConnected).eql(false);
|
expect(store.getStoreState().mediaConnected).eql(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clear the remoteSrcVideoObject", function() {
|
it("should clear the remoteSrcMediaElement", function() {
|
||||||
store.setStoreState({
|
store.setStoreState({
|
||||||
remoteSrcVideoObject: { name: "fakeVideoElement" }
|
remoteSrcMediaElement: { name: "fakeStreamElement" }
|
||||||
});
|
});
|
||||||
|
|
||||||
store.remotePeerDisconnected();
|
store.remotePeerDisconnected();
|
||||||
|
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(null);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should remove non-owner participants", function() {
|
it("should remove non-owner participants", function() {
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe("loop.store.ConversationStore", function () {
|
||||||
var sharedActions = loop.shared.actions;
|
var sharedActions = loop.shared.actions;
|
||||||
var sharedUtils = loop.shared.utils;
|
var sharedUtils = loop.shared.utils;
|
||||||
var sandbox, dispatcher, client, store, fakeSessionData, sdkDriver;
|
var sandbox, dispatcher, client, store, fakeSessionData, sdkDriver;
|
||||||
var contact, fakeMozLoop, fakeVideoElement;
|
var contact, fakeMozLoop, fakeStreamElement;
|
||||||
var connectPromise, resolveConnectPromise, rejectConnectPromise;
|
var connectPromise, resolveConnectPromise, rejectConnectPromise;
|
||||||
var wsCancelSpy, wsCloseSpy, wsDeclineSpy, wsMediaUpSpy, fakeWebsocket;
|
var wsCancelSpy, wsCloseSpy, wsDeclineSpy, wsMediaUpSpy, fakeWebsocket;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ describe("loop.store.ConversationStore", function () {
|
||||||
progressURL: "fakeURL"
|
progressURL: "fakeURL"
|
||||||
};
|
};
|
||||||
|
|
||||||
fakeVideoElement = { id: "fakeVideoElement" };
|
fakeStreamElement = { id: "fakeStreamElement" };
|
||||||
|
|
||||||
var dummySocket = {
|
var dummySocket = {
|
||||||
close: sinon.spy(),
|
close: sinon.spy(),
|
||||||
|
@ -957,16 +957,16 @@ describe("loop.store.ConversationStore", function () {
|
||||||
|
|
||||||
describe("#mediaStreamCreated", function() {
|
describe("#mediaStreamCreated", function() {
|
||||||
it("should add a local video object to the store", function() {
|
it("should add a local video object to the store", function() {
|
||||||
expect(store.getStoreState()).to.not.have.property("localSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("localSrcMediaElement");
|
||||||
|
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().localSrcMediaElement).eql(fakeStreamElement);
|
||||||
expect(store.getStoreState()).to.not.have.property("remoteSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("remoteSrcMediaElement");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set the local video enabled", function() {
|
it("should set the local video enabled", function() {
|
||||||
|
@ -978,7 +978,7 @@ describe("loop.store.ConversationStore", function () {
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localVideoEnabled).eql(true);
|
expect(store.getStoreState().localVideoEnabled).eql(true);
|
||||||
|
@ -986,16 +986,16 @@ describe("loop.store.ConversationStore", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should add a remote video object to the store", function() {
|
it("should add a remote video object to the store", function() {
|
||||||
expect(store.getStoreState()).to.not.have.property("remoteSrcVideoObject");
|
expect(store.getStoreState()).to.not.have.property("remoteSrcMediaElement");
|
||||||
|
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState()).not.have.property("localSrcVideoObject");
|
expect(store.getStoreState()).not.have.property("localSrcMediaElement");
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(fakeStreamElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set the remote video enabled", function() {
|
it("should set the remote video enabled", function() {
|
||||||
|
@ -1007,7 +1007,7 @@ describe("loop.store.ConversationStore", function () {
|
||||||
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
store.mediaStreamCreated(new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: fakeVideoElement
|
srcMediaElement: fakeStreamElement
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localVideoEnabled).eql(false);
|
expect(store.getStoreState().localVideoEnabled).eql(false);
|
||||||
|
@ -1018,8 +1018,8 @@ describe("loop.store.ConversationStore", function () {
|
||||||
describe("#mediaStreamDestroyed", function() {
|
describe("#mediaStreamDestroyed", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
store.setStoreState({
|
store.setStoreState({
|
||||||
localSrcVideoObject: fakeVideoElement,
|
localSrcMediaElement: fakeStreamElement,
|
||||||
remoteSrcVideoObject: fakeVideoElement
|
remoteSrcMediaElement: fakeStreamElement
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1028,8 +1028,8 @@ describe("loop.store.ConversationStore", function () {
|
||||||
isLocal: true
|
isLocal: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(null);
|
expect(store.getStoreState().localSrcMediaElement).eql(null);
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(fakeStreamElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clear the remote video object", function() {
|
it("should clear the remote video object", function() {
|
||||||
|
@ -1037,8 +1037,8 @@ describe("loop.store.ConversationStore", function () {
|
||||||
isLocal: false
|
isLocal: false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(store.getStoreState().localSrcVideoObject).eql(fakeVideoElement);
|
expect(store.getStoreState().localSrcMediaElement).eql(fakeStreamElement);
|
||||||
expect(store.getStoreState().remoteSrcVideoObject).eql(null);
|
expect(store.getStoreState().remoteSrcMediaElement).eql(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -901,7 +901,7 @@ describe("loop.OTSdkDriver", function () {
|
||||||
new sharedActions.MediaStreamCreated({
|
new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeMockVideo
|
srcMediaElement: fakeMockVideo
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -914,7 +914,7 @@ describe("loop.OTSdkDriver", function () {
|
||||||
new sharedActions.MediaStreamCreated({
|
new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
srcVideoObject: fakeMockVideo
|
srcMediaElement: fakeMockVideo
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ describe("loop.OTSdkDriver", function () {
|
||||||
new sharedActions.MediaStreamCreated({
|
new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: true,
|
hasVideo: true,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: videoElement
|
srcMediaElement: videoElement
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1006,7 +1006,7 @@ describe("loop.OTSdkDriver", function () {
|
||||||
new sharedActions.MediaStreamCreated({
|
new sharedActions.MediaStreamCreated({
|
||||||
hasVideo: false,
|
hasVideo: false,
|
||||||
isLocal: false,
|
isLocal: false,
|
||||||
srcVideoObject: videoElement
|
srcMediaElement: videoElement
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ describe("loop.shared.views", function() {
|
||||||
mediaType: "local",
|
mediaType: "local",
|
||||||
// This doesn't actually get assigned to the video element, but is enough
|
// This doesn't actually get assigned to the video element, but is enough
|
||||||
// for this test to check display of the video element.
|
// for this test to check display of the video element.
|
||||||
srcVideoObject: {
|
srcMediaElement: {
|
||||||
fake: 1
|
fake: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1272,7 +1272,7 @@ describe("loop.shared.views", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
displayAvatar: false,
|
displayAvatar: false,
|
||||||
mediaType: "local",
|
mediaType: "local",
|
||||||
srcVideoObject: {
|
srcMediaElement: {
|
||||||
fake: 1
|
fake: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1404,7 +1404,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should not mark the wrapper as showing local streams when not displaying a stream", function() {
|
it("should not mark the wrapper as showing local streams when not displaying a stream", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
localSrcVideoObject: null,
|
localSrcMediaElement: null,
|
||||||
localPosterUrl: null
|
localPosterUrl: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1414,7 +1414,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should mark the wrapper as showing local streams when displaying a stream", function() {
|
it("should mark the wrapper as showing local streams when displaying a stream", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
localSrcVideoObject: {},
|
localSrcMediaElement: {},
|
||||||
localPosterUrl: null
|
localPosterUrl: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1424,7 +1424,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should mark the wrapper as showing local streams when displaying a poster url", function() {
|
it("should mark the wrapper as showing local streams when displaying a poster url", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
localSrcVideoObject: {},
|
localSrcMediaElement: {},
|
||||||
localPosterUrl: "fake/url"
|
localPosterUrl: "fake/url"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1434,7 +1434,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should not mark the wrapper as showing remote streams when not displaying a stream", function() {
|
it("should not mark the wrapper as showing remote streams when not displaying a stream", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
remoteSrcVideoObject: null,
|
remoteSrcMediaElement: null,
|
||||||
remotePosterUrl: null
|
remotePosterUrl: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1444,7 +1444,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should mark the wrapper as showing remote streams when displaying a stream", function() {
|
it("should mark the wrapper as showing remote streams when displaying a stream", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
remoteSrcVideoObject: {},
|
remoteSrcMediaElement: {},
|
||||||
remotePosterUrl: null
|
remotePosterUrl: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1454,7 +1454,7 @@ describe("loop.shared.views", function() {
|
||||||
|
|
||||||
it("should mark the wrapper as showing remote streams when displaying a poster url", function() {
|
it("should mark the wrapper as showing remote streams when displaying a poster url", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
remoteSrcVideoObject: {},
|
remoteSrcMediaElement: {},
|
||||||
remotePosterUrl: "fake/url"
|
remotePosterUrl: "fake/url"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -486,10 +486,10 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
|
|
||||||
describe("screenShare", function() {
|
describe("screenShare", function() {
|
||||||
it("should show a loading screen if receivingScreenShare is true " +
|
it("should show a loading screen if receivingScreenShare is true " +
|
||||||
"but no screenShareVideoObject is present", function() {
|
"but no screenShareMediaElement is present", function() {
|
||||||
view.setState({
|
view.setState({
|
||||||
"receivingScreenShare": true,
|
"receivingScreenShare": true,
|
||||||
"screenShareVideoObject": null
|
"screenShareMediaElement": null
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
||||||
|
@ -497,23 +497,23 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not show loading screen if receivingScreenShare is false " +
|
it("should not show loading screen if receivingScreenShare is false " +
|
||||||
"and screenShareVideoObject is null", function() {
|
"and screenShareMediaElement is null", function() {
|
||||||
view.setState({
|
view.setState({
|
||||||
"receivingScreenShare": false,
|
"receivingScreenShare": false,
|
||||||
"screenShareVideoObject": null
|
"screenShareMediaElement": null
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
||||||
.eql(null);
|
.eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not show a loading screen if screenShareVideoObject is set",
|
it("should not show a loading screen if screenShareMediaElement is set",
|
||||||
function() {
|
function() {
|
||||||
var videoElement = document.createElement("video");
|
var videoElement = document.createElement("video");
|
||||||
|
|
||||||
view.setState({
|
view.setState({
|
||||||
"receivingScreenShare": true,
|
"receivingScreenShare": true,
|
||||||
"screenShareVideoObject": videoElement
|
"screenShareMediaElement": videoElement
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
expect(view.getDOMNode().querySelector(".screen .loading-stream"))
|
||||||
|
@ -531,7 +531,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
it("should render local video when video_muted is false", function() {
|
it("should render local video when video_muted is false", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
localSrcVideoObject: videoElement,
|
localSrcMediaElement: videoElement,
|
||||||
videoMuted: false
|
videoMuted: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -547,33 +547,33 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
expect(view.getDOMNode().querySelector(".local .avatar")).eql(null);
|
expect(view.getDOMNode().querySelector(".local .avatar")).eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render local loading screen when no srcVideoObject",
|
it("should render local loading screen when no srcMediaElement",
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.MEDIA_WAIT,
|
roomState: ROOM_STATES.MEDIA_WAIT,
|
||||||
remoteSrcVideoObject: null
|
remoteSrcMediaElement: null
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".local .loading-stream"))
|
expect(view.getDOMNode().querySelector(".local .loading-stream"))
|
||||||
.not.eql(null);
|
.not.eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not render local loading screen when srcVideoObject is set",
|
it("should not render local loading screen when srcMediaElement is set",
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.MEDIA_WAIT,
|
roomState: ROOM_STATES.MEDIA_WAIT,
|
||||||
localSrcVideoObject: videoElement
|
localSrcMediaElement: videoElement
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".local .loading-stream"))
|
expect(view.getDOMNode().querySelector(".local .loading-stream"))
|
||||||
.eql(null);
|
.eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not render remote loading screen when srcVideoObject is set",
|
it("should not render remote loading screen when srcMediaElement is set",
|
||||||
function() {
|
function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement
|
remoteSrcMediaElement: videoElement
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(view.getDOMNode().querySelector(".remote .loading-stream"))
|
expect(view.getDOMNode().querySelector(".remote .loading-stream"))
|
||||||
|
@ -584,7 +584,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
" remoteVideoEnabled is true", function() {
|
" remoteVideoEnabled is true", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
remoteVideoEnabled: true
|
remoteVideoEnabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -595,7 +595,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
" remoteVideoEnabled is true", function() {
|
" remoteVideoEnabled is true", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
remoteVideoEnabled: true
|
remoteVideoEnabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -606,7 +606,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
" remoteVideoEnabled is false, and mediaConnected is true", function() {
|
" remoteVideoEnabled is false, and mediaConnected is true", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
mediaConnected: true,
|
mediaConnected: true,
|
||||||
remoteVideoEnabled: false
|
remoteVideoEnabled: false
|
||||||
});
|
});
|
||||||
|
@ -618,7 +618,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
" and both remoteVideoEnabled and mediaConnected are false", function() {
|
" and both remoteVideoEnabled and mediaConnected are false", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
remoteVideoEnabled: false
|
remoteVideoEnabled: false
|
||||||
});
|
});
|
||||||
|
@ -629,7 +629,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
it("should not render a remote avatar when the room is in MEDIA_WAIT", function() {
|
it("should not render a remote avatar when the room is in MEDIA_WAIT", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.MEDIA_WAIT,
|
roomState: ROOM_STATES.MEDIA_WAIT,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
remoteVideoEnabled: false
|
remoteVideoEnabled: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -640,7 +640,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
" remoteVideoEnabled is false", function() {
|
" remoteVideoEnabled is false", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.CLOSING,
|
roomState: ROOM_STATES.CLOSING,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
remoteVideoEnabled: false
|
remoteVideoEnabled: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
"remoteVideoEnabled is false, and mediaConnected is true", function() {
|
"remoteVideoEnabled is false, and mediaConnected is true", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: videoElement,
|
remoteSrcMediaElement: videoElement,
|
||||||
remoteVideoEnabled: false,
|
remoteVideoEnabled: false,
|
||||||
mediaConnected: true
|
mediaConnected: true
|
||||||
});
|
});
|
||||||
|
@ -660,10 +660,10 @@ describe("loop.standaloneRoomViews", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render a remote avatar when the room HAS_PARTICIPANTS, " +
|
it("should render a remote avatar when the room HAS_PARTICIPANTS, " +
|
||||||
"remoteSrcVideoObject is false, mediaConnected is true", function() {
|
"remoteSrcMediaElement is false, mediaConnected is true", function() {
|
||||||
activeRoomStore.setStoreState({
|
activeRoomStore.setStoreState({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: null,
|
remoteSrcMediaElement: null,
|
||||||
remoteVideoEnabled: false,
|
remoteVideoEnabled: false,
|
||||||
mediaConnected: true
|
mediaConnected: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
var loadingRemoteVideoRoomStore = makeActiveRoomStore({
|
var loadingRemoteVideoRoomStore = makeActiveRoomStore({
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var readyRoomStore = makeActiveRoomStore({
|
var readyRoomStore = makeActiveRoomStore({
|
||||||
|
@ -246,7 +246,7 @@
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
receivingScreenShare: true,
|
receivingScreenShare: true,
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
});
|
});
|
||||||
var loadingScreenSharingRoomStore = makeActiveRoomStore({
|
var loadingScreenSharingRoomStore = makeActiveRoomStore({
|
||||||
receivingScreenShare: true,
|
receivingScreenShare: true,
|
||||||
|
@ -256,11 +256,11 @@
|
||||||
/* Set up the stores for pending screen sharing */
|
/* Set up the stores for pending screen sharing */
|
||||||
loadingScreenSharingRoomStore.receivingScreenShare({
|
loadingScreenSharingRoomStore.receivingScreenShare({
|
||||||
receiving: true,
|
receiving: true,
|
||||||
srcVideoObject: false
|
srcMediaElement: false
|
||||||
});
|
});
|
||||||
loadingRemoteLoadingScreenStore.receivingScreenShare({
|
loadingRemoteLoadingScreenStore.receivingScreenShare({
|
||||||
receiving: true,
|
receiving: true,
|
||||||
srcVideoObject: false
|
srcMediaElement: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var fullActiveRoomStore = makeActiveRoomStore({
|
var fullActiveRoomStore = makeActiveRoomStore({
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
activeRoomStore: makeActiveRoomStore({
|
activeRoomStore: makeActiveRoomStore({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
var loadingRemoteVideoRoomStore = makeActiveRoomStore({
|
var loadingRemoteVideoRoomStore = makeActiveRoomStore({
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var readyRoomStore = makeActiveRoomStore({
|
var readyRoomStore = makeActiveRoomStore({
|
||||||
|
@ -246,7 +246,7 @@
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
receivingScreenShare: true,
|
receivingScreenShare: true,
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
});
|
});
|
||||||
var loadingScreenSharingRoomStore = makeActiveRoomStore({
|
var loadingScreenSharingRoomStore = makeActiveRoomStore({
|
||||||
receivingScreenShare: true,
|
receivingScreenShare: true,
|
||||||
|
@ -256,11 +256,11 @@
|
||||||
/* Set up the stores for pending screen sharing */
|
/* Set up the stores for pending screen sharing */
|
||||||
loadingScreenSharingRoomStore.receivingScreenShare({
|
loadingScreenSharingRoomStore.receivingScreenShare({
|
||||||
receiving: true,
|
receiving: true,
|
||||||
srcVideoObject: false
|
srcMediaElement: false
|
||||||
});
|
});
|
||||||
loadingRemoteLoadingScreenStore.receivingScreenShare({
|
loadingRemoteLoadingScreenStore.receivingScreenShare({
|
||||||
receiving: true,
|
receiving: true,
|
||||||
srcVideoObject: false
|
srcMediaElement: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var fullActiveRoomStore = makeActiveRoomStore({
|
var fullActiveRoomStore = makeActiveRoomStore({
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
activeRoomStore: makeActiveRoomStore({
|
activeRoomStore: makeActiveRoomStore({
|
||||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||||
mediaConnected: false,
|
mediaConnected: false,
|
||||||
remoteSrcVideoObject: false
|
remoteSrcMediaElement: false
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,8 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
||||||
HandleEventReport(pktHeaders);
|
HandleEventReport(pktHeaders);
|
||||||
} else if (type.EqualsLiteral("x-bt/messageStatus")) {
|
} else if (type.EqualsLiteral("x-bt/messageStatus")) {
|
||||||
HandleSetMessageStatus(pktHeaders);
|
HandleSetMessageStatus(pktHeaders);
|
||||||
|
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||||
|
HandleSmsMmsPushMessage(pktHeaders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -819,6 +821,23 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
|
||||||
static_cast<uint32_t>(statusValue));
|
static_cast<uint32_t>(statusValue));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Map::AppParametersTagId::Transparent: {
|
||||||
|
uint8_t transparent = *((uint8_t *)buf);
|
||||||
|
// convert big endian to little endian
|
||||||
|
transparent = (transparent >> 8) | (transparent << 8);
|
||||||
|
BT_LOGR("msg filter statusvalue: %d", transparent);
|
||||||
|
AppendNamedValue(aValues, "transparent",
|
||||||
|
static_cast<uint32_t>(transparent));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Map::AppParametersTagId::Retry: {
|
||||||
|
uint8_t retry = *((uint8_t *)buf);
|
||||||
|
// convert big endian to little endian
|
||||||
|
retry = (retry >> 8) | (retry << 8);
|
||||||
|
BT_LOGR("msg filter retry: %d", retry);
|
||||||
|
AppendNamedValue(aValues, "retry", static_cast<uint32_t>(retry));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
BT_LOGR("Unsupported AppParameterTag: %x", aTagId);
|
BT_LOGR("Unsupported AppParameterTag: %x", aTagId);
|
||||||
break;
|
break;
|
||||||
|
@ -980,6 +999,28 @@ BluetoothMapSmsManager::HandleSetMessageStatus(const ObexHeaderSet& aHeader)
|
||||||
NS_LITERAL_STRING(KEY_ADAPTER), data);
|
NS_LITERAL_STRING(KEY_ADAPTER), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothMapSmsManager::HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
|
NS_ENSURE_TRUE_VOID(bs);
|
||||||
|
|
||||||
|
InfallibleTArray<BluetoothNamedValue> data;
|
||||||
|
nsString name;
|
||||||
|
aHeader.GetName(name);
|
||||||
|
AppendNamedValue(data, "folderName", name);
|
||||||
|
|
||||||
|
AppendBtNamedValueByTagId(aHeader, data,
|
||||||
|
Map::AppParametersTagId::Transparent);
|
||||||
|
AppendBtNamedValueByTagId(aHeader, data, Map::AppParametersTagId::Retry);
|
||||||
|
AppendBtNamedValueByTagId(aHeader, data, Map::AppParametersTagId::Charset);
|
||||||
|
|
||||||
|
bs->DistributeSignal(NS_LITERAL_STRING(MAP_PUSH_MESSAGE_REQ_ID),
|
||||||
|
NS_LITERAL_STRING(KEY_ADAPTER), data);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothMapSmsManager::ReplyError(uint8_t aError)
|
BluetoothMapSmsManager::ReplyError(uint8_t aError)
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,6 +98,8 @@ private:
|
||||||
void HandleSmsMmsFolderListing(const ObexHeaderSet& aHeader);
|
void HandleSmsMmsFolderListing(const ObexHeaderSet& aHeader);
|
||||||
void HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader);
|
void HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader);
|
||||||
void HandleSmsMmsGetMessage(const ObexHeaderSet& aHeader);
|
void HandleSmsMmsGetMessage(const ObexHeaderSet& aHeader);
|
||||||
|
void HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader);
|
||||||
|
|
||||||
void AppendBtNamedValueByTagId(const ObexHeaderSet& aHeader,
|
void AppendBtNamedValueByTagId(const ObexHeaderSet& aHeader,
|
||||||
InfallibleTArray<BluetoothNamedValue>& aValues,
|
InfallibleTArray<BluetoothNamedValue>& aValues,
|
||||||
const Map::AppParametersTagId aTagId);
|
const Map::AppParametersTagId aTagId);
|
||||||
|
|
|
@ -186,22 +186,13 @@ extern bool gBluetoothDebugFlag;
|
||||||
#define PULL_VCARD_LISTING_REQ_ID "pullvcardlistingreq"
|
#define PULL_VCARD_LISTING_REQ_ID "pullvcardlistingreq"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When receiving a MAP request of 'messages listing' from a remote device,
|
* When receiving a MAP request from a remote device,
|
||||||
* we'll dispatch an event.
|
* we'll dispatch an event.
|
||||||
*/
|
*/
|
||||||
#define MAP_MESSAGES_LISTING_REQ_ID "mapmessageslistingreq"
|
#define MAP_MESSAGES_LISTING_REQ_ID "mapmessageslistingreq"
|
||||||
|
|
||||||
/**
|
|
||||||
* When receiving a MAP request of 'get message' from a remote device,
|
|
||||||
* we'll dispatch an event.
|
|
||||||
*/
|
|
||||||
#define MAP_GET_MESSAGE_REQ_ID "mapgetmessagereq"
|
#define MAP_GET_MESSAGE_REQ_ID "mapgetmessagereq"
|
||||||
|
|
||||||
/**
|
|
||||||
* When receiving a MAP request of 'set message' from a remote device,
|
|
||||||
* we'll dispatch an event.
|
|
||||||
*/
|
|
||||||
#define MAP_SET_MESSAGE_STATUS_REQ_ID "mapsetmessagestatusreq"
|
#define MAP_SET_MESSAGE_STATUS_REQ_ID "mapsetmessagestatusreq"
|
||||||
|
#define MAP_PUSH_MESSAGE_REQ_ID "mappushmessagereq"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the value of a characteristic of a remote BLE device changes, we'll
|
* When the value of a characteristic of a remote BLE device changes, we'll
|
||||||
|
|
Двоичный файл не отображается.
|
@ -0,0 +1,336 @@
|
||||||
|
/**
|
||||||
|
* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
var testGenerator = testSteps();
|
||||||
|
|
||||||
|
function testSteps()
|
||||||
|
{
|
||||||
|
const testName = "schema21upgrade";
|
||||||
|
const testKeys = [
|
||||||
|
-1/0,
|
||||||
|
-1.7e308,
|
||||||
|
-10000,
|
||||||
|
-2,
|
||||||
|
-1.5,
|
||||||
|
-1,
|
||||||
|
-1.00001e-200,
|
||||||
|
-1e-200,
|
||||||
|
0,
|
||||||
|
1e-200,
|
||||||
|
1.00001e-200,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
10000,
|
||||||
|
1.7e308,
|
||||||
|
1/0,
|
||||||
|
new Date("1750-01-02"),
|
||||||
|
new Date("1800-12-31T12:34:56.001Z"),
|
||||||
|
new Date(-1000),
|
||||||
|
new Date(-10),
|
||||||
|
new Date(-1),
|
||||||
|
new Date(0),
|
||||||
|
new Date(1),
|
||||||
|
new Date(2),
|
||||||
|
new Date(1000),
|
||||||
|
new Date("1971-01-01"),
|
||||||
|
new Date("1971-01-01T01:01:01Z"),
|
||||||
|
new Date("1971-01-01T01:01:01.001Z"),
|
||||||
|
new Date("1971-01-01T01:01:01.01Z"),
|
||||||
|
new Date("1971-01-01T01:01:01.1Z"),
|
||||||
|
new Date("1980-02-02"),
|
||||||
|
new Date("3333-03-19T03:33:33.333Z"),
|
||||||
|
"",
|
||||||
|
"\x00",
|
||||||
|
"\x00\x00",
|
||||||
|
"\x00\x01",
|
||||||
|
"\x01",
|
||||||
|
"\x02",
|
||||||
|
"\x03",
|
||||||
|
"\x04",
|
||||||
|
"\x07",
|
||||||
|
"\x08",
|
||||||
|
"\x0F",
|
||||||
|
"\x10",
|
||||||
|
"\x1F",
|
||||||
|
"\x20",
|
||||||
|
"01234",
|
||||||
|
"\x3F",
|
||||||
|
"\x40",
|
||||||
|
"A",
|
||||||
|
"A\x00",
|
||||||
|
"A1",
|
||||||
|
"ZZZZ",
|
||||||
|
"a",
|
||||||
|
"a\x00",
|
||||||
|
"aa",
|
||||||
|
"azz",
|
||||||
|
"}",
|
||||||
|
"\x7E",
|
||||||
|
"\x7F",
|
||||||
|
"\x80",
|
||||||
|
"\xFF",
|
||||||
|
"\u0100",
|
||||||
|
"\u01FF",
|
||||||
|
"\u0200",
|
||||||
|
"\u03FF",
|
||||||
|
"\u0400",
|
||||||
|
"\u07FF",
|
||||||
|
"\u0800",
|
||||||
|
"\u0FFF",
|
||||||
|
"\u1000",
|
||||||
|
"\u1FFF",
|
||||||
|
"\u2000",
|
||||||
|
"\u3FFF",
|
||||||
|
"\u4000",
|
||||||
|
"\u7FFF",
|
||||||
|
"\u8000",
|
||||||
|
"\uD800",
|
||||||
|
"\uD800a",
|
||||||
|
"\uD800\uDC01",
|
||||||
|
"\uDBFF",
|
||||||
|
"\uDC00",
|
||||||
|
"\uDFFF\uD800",
|
||||||
|
"\uFFFE",
|
||||||
|
"\uFFFF",
|
||||||
|
"\uFFFF\x00",
|
||||||
|
"\uFFFFZZZ",
|
||||||
|
[],
|
||||||
|
[-1/0],
|
||||||
|
[-1],
|
||||||
|
[0],
|
||||||
|
[1],
|
||||||
|
[1, "a"],
|
||||||
|
[1, []],
|
||||||
|
[1, [""]],
|
||||||
|
[2, 3],
|
||||||
|
[2, 3.0000000000001],
|
||||||
|
[12, [[]]],
|
||||||
|
[12, [[[]]]],
|
||||||
|
[12, [[[""]]]],
|
||||||
|
[12, [[["foo"]]]],
|
||||||
|
[12, [[[[[3]]]]]],
|
||||||
|
[12, [[[[[[3]]]]]]],
|
||||||
|
[12, [[[[[[3],[[[[[4.2]]]]]]]]]]],
|
||||||
|
[new Date(-1)],
|
||||||
|
[new Date(1)],
|
||||||
|
[""],
|
||||||
|
["", [[]]],
|
||||||
|
["", [[[]]]],
|
||||||
|
["abc"],
|
||||||
|
["abc", "def"],
|
||||||
|
["abc\x00"],
|
||||||
|
["abc\x00", "\x00\x01"],
|
||||||
|
["abc\x00", "\x00def"],
|
||||||
|
["abc\x00\x00def"],
|
||||||
|
["x", [[]]],
|
||||||
|
["x", [[[]]]],
|
||||||
|
[[]],
|
||||||
|
[[],"foo"],
|
||||||
|
[[],[]],
|
||||||
|
[[[]]],
|
||||||
|
[[[]], []],
|
||||||
|
[[[]], [[]]],
|
||||||
|
[[[]], [[1]]],
|
||||||
|
[[[]], [[[]]]],
|
||||||
|
[[[1]]],
|
||||||
|
[[[[]], []]],
|
||||||
|
];
|
||||||
|
const testString =
|
||||||
|
"abcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()-_+=,<.>/?\\|";
|
||||||
|
|
||||||
|
clearAllDatabases(continueToNextStepSync);
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
|
info("Installing profile");
|
||||||
|
|
||||||
|
installPackagedProfile(testName + "_profile");
|
||||||
|
|
||||||
|
info("Opening database with no version");
|
||||||
|
|
||||||
|
let request = indexedDB.open(testName);
|
||||||
|
request.onerror = errorHandler;
|
||||||
|
request.onupgradeneeded = unexpectedSuccessHandler;
|
||||||
|
request.onsuccess = grabEventAndContinueHandler;
|
||||||
|
let event = yield undefined;
|
||||||
|
|
||||||
|
let db = event.target.result;
|
||||||
|
|
||||||
|
is(db.version, 1, "Correct db version");
|
||||||
|
|
||||||
|
let transaction = db.transaction(testName);
|
||||||
|
transaction.oncomplete = grabEventAndContinueHandler;
|
||||||
|
|
||||||
|
let objectStore = transaction.objectStore(testName);
|
||||||
|
let index = objectStore.index("uniqueIndex");
|
||||||
|
|
||||||
|
info("Starting 'uniqueIndex' cursor");
|
||||||
|
|
||||||
|
let keyIndex = 0;
|
||||||
|
index.openCursor().onsuccess = event => {
|
||||||
|
let cursor = event.target.result;
|
||||||
|
if (cursor) {
|
||||||
|
info("Comparing " + JSON.stringify(cursor.primaryKey) + " to " +
|
||||||
|
JSON.stringify(testKeys[cursor.key]) +
|
||||||
|
" [" + cursor.key + "]");
|
||||||
|
is(indexedDB.cmp(cursor.primaryKey, testKeys[cursor.key]), 0,
|
||||||
|
"Keys compare equally via 'indexedDB.cmp'");
|
||||||
|
is(compareKeys(cursor.primaryKey, testKeys[cursor.key]), true,
|
||||||
|
"Keys compare equally via 'compareKeys'");
|
||||||
|
|
||||||
|
let indexProperty = cursor.value.index;
|
||||||
|
is(Array.isArray(indexProperty), true, "index property is Array");
|
||||||
|
is(indexProperty[0], cursor.key, "index property first item correct");
|
||||||
|
is(indexProperty[1], cursor.key + 1, "index property second item correct");
|
||||||
|
|
||||||
|
is(cursor.key, keyIndex, "Cursor key property is correct");
|
||||||
|
|
||||||
|
is(cursor.value.testString, testString, "Test string compared equally");
|
||||||
|
|
||||||
|
keyIndex++;
|
||||||
|
cursor.continue();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
|
is(keyIndex, testKeys.length, "Saw all keys");
|
||||||
|
|
||||||
|
transaction = db.transaction(testName, "readwrite");
|
||||||
|
transaction.oncomplete = grabEventAndContinueHandler;
|
||||||
|
|
||||||
|
objectStore = transaction.objectStore(testName);
|
||||||
|
index = objectStore.index("index");
|
||||||
|
|
||||||
|
info("Getting all 'index' keys");
|
||||||
|
|
||||||
|
index.getAllKeys().onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
is(event.target.result.length, testKeys.length * 2, "Got all keys");
|
||||||
|
|
||||||
|
info("Starting objectStore cursor");
|
||||||
|
|
||||||
|
objectStore.openCursor().onsuccess = event => {
|
||||||
|
let cursor = event.target.result;
|
||||||
|
if (cursor) {
|
||||||
|
let value = cursor.value;
|
||||||
|
is(value.testString, testString, "Test string compared equally");
|
||||||
|
|
||||||
|
delete value.index;
|
||||||
|
cursor.update(value);
|
||||||
|
|
||||||
|
cursor.continue();
|
||||||
|
} else {
|
||||||
|
continueToNextStepSync();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
|
info("Getting all 'index' keys");
|
||||||
|
|
||||||
|
index.getAllKeys().onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
is(event.target.result.length, 0, "Removed all keys");
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
info("Opening database with new version");
|
||||||
|
|
||||||
|
request = indexedDB.open(testName, 2);
|
||||||
|
request.onerror = errorHandler;
|
||||||
|
request.onupgradeneeded = grabEventAndContinueHandler;
|
||||||
|
request.onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
info("Deleting indexes");
|
||||||
|
|
||||||
|
objectStore = event.target.transaction.objectStore(testName);
|
||||||
|
objectStore.deleteIndex("index");
|
||||||
|
objectStore.deleteIndex("uniqueIndex");
|
||||||
|
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
db = event.target.result;
|
||||||
|
|
||||||
|
transaction = db.transaction(testName, "readwrite");
|
||||||
|
transaction.oncomplete = grabEventAndContinueHandler;
|
||||||
|
|
||||||
|
info("Starting objectStore cursor");
|
||||||
|
|
||||||
|
objectStore = transaction.objectStore(testName);
|
||||||
|
objectStore.openCursor().onsuccess = event => {
|
||||||
|
let cursor = event.target.result;
|
||||||
|
if (cursor) {
|
||||||
|
let value = cursor.value;
|
||||||
|
is(value.testString, testString, "Test string compared equally");
|
||||||
|
|
||||||
|
value.index = value.keyPath;
|
||||||
|
cursor.update(value);
|
||||||
|
|
||||||
|
cursor.continue();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
info("Opening database with new version");
|
||||||
|
|
||||||
|
request = indexedDB.open(testName, 3);
|
||||||
|
request.onerror = errorHandler;
|
||||||
|
request.onupgradeneeded = grabEventAndContinueHandler;
|
||||||
|
request.onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
info("Creating indexes");
|
||||||
|
|
||||||
|
objectStore = event.target.transaction.objectStore(testName);
|
||||||
|
objectStore.createIndex("index", "index");
|
||||||
|
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
db = event.target.result;
|
||||||
|
|
||||||
|
transaction = db.transaction(testName);
|
||||||
|
transaction.oncomplete = grabEventAndContinueHandler;
|
||||||
|
|
||||||
|
objectStore = transaction.objectStore(testName);
|
||||||
|
index = objectStore.index("index");
|
||||||
|
|
||||||
|
info("Starting 'index' cursor");
|
||||||
|
|
||||||
|
keyIndex = 0;
|
||||||
|
index.openCursor().onsuccess = event => {
|
||||||
|
let cursor = event.target.result;
|
||||||
|
if (cursor) {
|
||||||
|
is(indexedDB.cmp(cursor.primaryKey, testKeys[keyIndex]), 0,
|
||||||
|
"Keys compare equally via 'indexedDB.cmp'");
|
||||||
|
is(compareKeys(cursor.primaryKey, testKeys[keyIndex]), true,
|
||||||
|
"Keys compare equally via 'compareKeys'");
|
||||||
|
is(indexedDB.cmp(cursor.key, testKeys[keyIndex]), 0,
|
||||||
|
"Keys compare equally via 'indexedDB.cmp'");
|
||||||
|
is(compareKeys(cursor.key, testKeys[keyIndex]), true,
|
||||||
|
"Keys compare equally via 'compareKeys'");
|
||||||
|
|
||||||
|
let indexProperty = cursor.value.index;
|
||||||
|
is(indexedDB.cmp(indexProperty, testKeys[keyIndex]), 0,
|
||||||
|
"Keys compare equally via 'indexedDB.cmp'");
|
||||||
|
is(compareKeys(indexProperty, testKeys[keyIndex]), true,
|
||||||
|
"Keys compare equally via 'compareKeys'");
|
||||||
|
|
||||||
|
is(cursor.value.testString, testString, "Test string compared equally");
|
||||||
|
|
||||||
|
keyIndex++;
|
||||||
|
cursor.continue();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
|
is(keyIndex, testKeys.length, "Added all keys again");
|
||||||
|
|
||||||
|
finishTest();
|
||||||
|
yield undefined;
|
||||||
|
}
|
|
@ -18,6 +18,7 @@ support-files =
|
||||||
GlobalObjectsSandbox.js
|
GlobalObjectsSandbox.js
|
||||||
metadataRestore_profile.zip
|
metadataRestore_profile.zip
|
||||||
schema18upgrade_profile.zip
|
schema18upgrade_profile.zip
|
||||||
|
schema21upgrade_profile.zip
|
||||||
xpcshell-shared.ini
|
xpcshell-shared.ini
|
||||||
|
|
||||||
[include:xpcshell-shared.ini]
|
[include:xpcshell-shared.ini]
|
||||||
|
@ -36,6 +37,7 @@ skip-if = true
|
||||||
[test_mutableFileUpgrade.js]
|
[test_mutableFileUpgrade.js]
|
||||||
[test_readwriteflush_disabled.js]
|
[test_readwriteflush_disabled.js]
|
||||||
[test_schema18upgrade.js]
|
[test_schema18upgrade.js]
|
||||||
|
[test_schema21upgrade.js]
|
||||||
[test_temporary_storage.js]
|
[test_temporary_storage.js]
|
||||||
# bug 951017: intermittent failure on Android x86 emulator
|
# bug 951017: intermittent failure on Android x86 emulator
|
||||||
skip-if = os == "android" && processor == "x86"
|
skip-if = os == "android" && processor == "x86"
|
||||||
|
|
|
@ -2114,7 +2114,7 @@ public abstract class GeckoApp
|
||||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
rec.close();
|
rec.close(GeckoApp.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,9 @@ public class ProfileInformationCache implements ProfileInformationProvider {
|
||||||
* 1: Add versioning (Bug 878670).
|
* 1: Add versioning (Bug 878670).
|
||||||
* 2: Bump to regenerate add-on set after landing Bug 900694 (Bug 901622).
|
* 2: Bump to regenerate add-on set after landing Bug 900694 (Bug 901622).
|
||||||
* 3: Add distribution, osLocale, appLocale.
|
* 3: Add distribution, osLocale, appLocale.
|
||||||
|
* 4: Add experiments as add-ons.
|
||||||
*/
|
*/
|
||||||
public static final int FORMAT_VERSION = 3;
|
public static final int FORMAT_VERSION = 4;
|
||||||
|
|
||||||
protected boolean initialized = false;
|
protected boolean initialized = false;
|
||||||
protected boolean needsWrite = false;
|
protected boolean needsWrite = false;
|
||||||
|
|
|
@ -8,6 +8,7 @@ package org.mozilla.gecko.health;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.lang.String;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -38,9 +39,15 @@ import org.mozilla.gecko.distribution.Distribution.DistributionDescriptor;
|
||||||
import org.mozilla.gecko.util.GeckoEventListener;
|
import org.mozilla.gecko.util.GeckoEventListener;
|
||||||
import org.mozilla.gecko.util.ThreadUtils;
|
import org.mozilla.gecko.util.ThreadUtils;
|
||||||
|
|
||||||
|
import com.keepsafe.switchboard.SwitchBoard;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentProviderClient;
|
import android.content.ContentProviderClient;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +66,7 @@ import android.util.Log;
|
||||||
*
|
*
|
||||||
* Shut it down when you're done being a browser: {@link #close()}.
|
* Shut it down when you're done being a browser: {@link #close()}.
|
||||||
*/
|
*/
|
||||||
public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener {
|
public class BrowserHealthRecorder extends BroadcastReceiver implements HealthRecorder, GeckoEventListener {
|
||||||
private static final String LOG_TAG = "GeckoHealthRec";
|
private static final String LOG_TAG = "GeckoHealthRec";
|
||||||
private static final String PREF_ACCEPT_LANG = "intl.accept_languages";
|
private static final String PREF_ACCEPT_LANG = "intl.accept_languages";
|
||||||
private static final String PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
|
private static final String PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
|
||||||
|
@ -177,7 +184,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||||
* provider-specific uninitialization.
|
* provider-specific uninitialization.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized void close() {
|
public synchronized void close(final Context context) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
Log.w(LOG_TAG, "Ignoring attempt to double-close closed BrowserHealthRecorder.");
|
Log.w(LOG_TAG, "Ignoring attempt to double-close closed BrowserHealthRecorder.");
|
||||||
|
@ -191,6 +198,9 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||||
|
|
||||||
this.state = State.CLOSED;
|
this.state = State.CLOSED;
|
||||||
this.unregisterEventListeners();
|
this.unregisterEventListeners();
|
||||||
|
if (AppConstants.MOZ_SWITCHBOARD) {
|
||||||
|
LocalBroadcastManager.getInstance(context).unregisterReceiver(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Add any necessary provider uninitialization here.
|
// Add any necessary provider uninitialization here.
|
||||||
this.storage = null;
|
this.storage = null;
|
||||||
|
@ -523,6 +533,12 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||||
this.profileCache.updateLocales(osLocale, appLocale);
|
this.profileCache.updateLocales(osLocale, appLocale);
|
||||||
this.profileCache.completeInitialization();
|
this.profileCache.completeInitialization();
|
||||||
|
|
||||||
|
// Listen for experiment changes.
|
||||||
|
if (AppConstants.MOZ_SWITCHBOARD) {
|
||||||
|
IntentFilter intentFilter = new IntentFilter(SwitchBoard.ACTION_CONFIG_FETCHED);
|
||||||
|
LocalBroadcastManager.getInstance(context).registerReceiver(this, intentFilter);
|
||||||
|
}
|
||||||
|
|
||||||
Log.d(LOG_TAG, "Successfully restored state. Initializing storage.");
|
Log.d(LOG_TAG, "Successfully restored state. Initializing storage.");
|
||||||
initializeStorage();
|
initializeStorage();
|
||||||
return;
|
return;
|
||||||
|
@ -626,6 +642,23 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||||
try {
|
try {
|
||||||
JSONObject json = message.getJSONObject("json");
|
JSONObject json = message.getJSONObject("json");
|
||||||
JSONObject addons = json.getJSONObject("addons");
|
JSONObject addons = json.getJSONObject("addons");
|
||||||
|
|
||||||
|
// Treat active experiments as add-ons
|
||||||
|
if (AppConstants.MOZ_SWITCHBOARD) {
|
||||||
|
List<String> experiments = SwitchBoard.getActiveExperiments(GeckoAppShell.getContext());
|
||||||
|
for (String experiment : experiments) {
|
||||||
|
// Create a fake add-on name
|
||||||
|
String fakeName = experiment + "@experiments.mozilla.org";
|
||||||
|
try {
|
||||||
|
// Create a dummy JSON object for the experiment.
|
||||||
|
JSONObject fakeAddon = new JSONObject();
|
||||||
|
fakeAddon.put("type", "experiment");
|
||||||
|
addons.put(fakeName, fakeAddon);
|
||||||
|
} catch (JSONException je) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.i(LOG_TAG, "Persisting " + addons.length() + " add-ons.");
|
Log.i(LOG_TAG, "Persisting " + addons.length() + " add-ons.");
|
||||||
profileCache.setJSONForAddons(addons);
|
profileCache.setJSONForAddons(addons);
|
||||||
|
|
||||||
|
@ -694,6 +727,71 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
switch (action) {
|
||||||
|
case SwitchBoard.ACTION_CONFIG_FETCHED:
|
||||||
|
Log.d(LOG_TAG, "Handle the new experiments.");
|
||||||
|
// Get the list of active experiments.
|
||||||
|
List<String> experiments = SwitchBoard.getActiveExperiments(context);
|
||||||
|
|
||||||
|
// We need to figure out which ones are new and which ones were removed. Convert
|
||||||
|
// the active experiments to the fake add-on names for easier lookup.
|
||||||
|
ArrayList<String> addToProfile = new ArrayList<String>();
|
||||||
|
for (String experiment : experiments) {
|
||||||
|
addToProfile.add(experiment + "@experiments.mozilla.org");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a list of add-ons(experiments) we need to remove.
|
||||||
|
ArrayList<String> removeFromProfile = new ArrayList<String>();
|
||||||
|
|
||||||
|
// Loop over the current profile set of add-ons, and figure out
|
||||||
|
// which add-ons (experiments) are new and which need to be removed.
|
||||||
|
JSONObject addons = this.profileCache.getAddonsJSON();
|
||||||
|
Iterator<?> keys = addons.keys();
|
||||||
|
while (keys.hasNext()) {
|
||||||
|
String addon = (String) keys.next();
|
||||||
|
if (addon.endsWith("@experiments.mozilla.org")) {
|
||||||
|
if (addToProfile.contains(addon)) {
|
||||||
|
// This experiment is already in the profile. We don't need to add it again.
|
||||||
|
addToProfile.remove(addon);
|
||||||
|
} else {
|
||||||
|
// The active set of experiments does not include this fake add-on.
|
||||||
|
removeFromProfile.add(addon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we don't have any changes, exit early.
|
||||||
|
if (addToProfile.isEmpty() && removeFromProfile.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the newly active experiments into the profile.
|
||||||
|
for (String fakeName : addToProfile) {
|
||||||
|
try {
|
||||||
|
// Create a dummy JSON object for the experiment.
|
||||||
|
JSONObject fakeAddon = new JSONObject();
|
||||||
|
fakeAddon.put("type", "experiment");
|
||||||
|
this.onAddonChanged(fakeName, fakeAddon);
|
||||||
|
Log.d(LOG_TAG, "Add this experiment: " + fakeName);
|
||||||
|
} catch (JSONException je) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove experiments that are no longer active from the profile.
|
||||||
|
for (String fakeName : removeFromProfile) {
|
||||||
|
this.onAddonUninstalling(fakeName);
|
||||||
|
Log.d(LOG_TAG, "Remove this experiment: " + fakeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Something changed, so update the environment.
|
||||||
|
this.onEnvironmentChanged();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Searches.
|
* Searches.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package org.mozilla.gecko.health;
|
package org.mozilla.gecko.health;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -33,7 +34,7 @@ public interface HealthRecorder {
|
||||||
public void onEnvironmentChanged();
|
public void onEnvironmentChanged();
|
||||||
public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason);
|
public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason);
|
||||||
|
|
||||||
public void close();
|
public void close(final Context context);
|
||||||
|
|
||||||
public void processDelayed();
|
public void processDelayed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package org.mozilla.gecko.health;
|
package org.mozilla.gecko.health;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -45,7 +46,7 @@ public class StubbedHealthRecorder implements HealthRecorder {
|
||||||
public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) { }
|
public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() { }
|
public void close(final Context context) { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processDelayed() { }
|
public void processDelayed() { }
|
||||||
|
|
|
@ -22,6 +22,9 @@ import java.io.InputStreamReader;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.ProtocolException;
|
import java.net.ProtocolException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -31,11 +34,12 @@ import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SwitchBoard is the core class of the KeepSafe Switchboard mobile A/B testing framework.
|
* SwitchBoard is the core class of the KeepSafe Switchboard mobile A/B testing framework.
|
||||||
* This class provides a bunch of static methods that can be used in your app to run A/B tests.
|
* This class provides a bunch of static methods that can be used in your app to run A/B tests.
|
||||||
|
@ -66,7 +70,8 @@ public class SwitchBoard {
|
||||||
/** Production server for getting the actual config file. http://staging.domain/path_to/SwitchboardDriver.php */
|
/** Production server for getting the actual config file. http://staging.domain/path_to/SwitchboardDriver.php */
|
||||||
private static String DYNAMIC_CONFIG_SERVER_DEFAULT_URL;
|
private static String DYNAMIC_CONFIG_SERVER_DEFAULT_URL;
|
||||||
|
|
||||||
|
public static final String ACTION_CONFIG_FETCHED = ".SwitchBoard.CONFIG_FETCHED";
|
||||||
|
|
||||||
private static final String kUpdateServerUrl = "updateServerUrl";
|
private static final String kUpdateServerUrl = "updateServerUrl";
|
||||||
private static final String kConfigServerUrl = "configServerUrl";
|
private static final String kConfigServerUrl = "configServerUrl";
|
||||||
|
|
||||||
|
@ -229,6 +234,10 @@ public class SwitchBoard {
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//notify listeners that the config fetch has completed
|
||||||
|
Intent i = new Intent(ACTION_CONFIG_FETCHED);
|
||||||
|
LocalBroadcastManager.getInstance(c).sendBroadcast(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isInBucket(Context c, int low, int high) {
|
public static boolean isInBucket(Context c, int low, int high) {
|
||||||
|
@ -288,6 +297,37 @@ public class SwitchBoard {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns a list of all active experiments.
|
||||||
|
*/
|
||||||
|
public static List<String> getActiveExperiments(Context c) {
|
||||||
|
ArrayList<String> returnList = new ArrayList<String>();
|
||||||
|
|
||||||
|
// lookup experiment in config
|
||||||
|
String config = Preferences.getDynamicConfigJson(c);
|
||||||
|
|
||||||
|
// if it does not exist
|
||||||
|
if (config == null) {
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject experiments = new JSONObject(config);
|
||||||
|
Iterator<?> iter = experiments.keys();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
String key = (String)iter.next();
|
||||||
|
JSONObject experiment = experiments.getJSONObject(key);
|
||||||
|
if (experiment.getBoolean(IS_EXPERIMENT_ACTIVE)) {
|
||||||
|
returnList.add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
// Something went wrong!
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a certain experiment exists.
|
* Checks if a certain experiment exists.
|
||||||
* @param c ApplicationContext
|
* @param c ApplicationContext
|
||||||
|
|
Загрузка…
Ссылка в новой задаче