mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-29 18:40:41 +00:00
8cb2d1cd9e
- Bug 1069230 - Presentation API implementation. Part 1 - WebIDL Bindings. r=smaug (180d2e23a) - Bug 1142770 - part 1 - Use telephony service creator for telephony IPC service. r=hsinyi (447da4e64) - Bug 1142770 - part 2 - disable telephonyservice and voicemailservice. r=fabrice (5e0592769) - Bug 1069230 - Presentation API implementation. Part 2 - Presentation service and listeners. r=smaug (4be1d0628) - Bug 1069230 - Presentation API implementation. Part 3 - IPC. r=smaug (10db1c229) - Bug 1069230 - Presentation API implementation. Part 4 - Establish session (sender) & available changes. r=smaug (d7b358f74) - Bug 1069230 - Presentation API implementation. Part 5 - Establish session (receiver). r=smaug (e60709725) - Bug 1020179 - ContentPermissionPrompt change in b2g. r=fabrice (7aab4449e) - Bug 1020179 - Test case for visibilitychange. r=fabrice (d404f25e6) - Bug 1069230 - Presentation API implementation. Part 6 - mozChromeEvent for app launch. r=fabrice r=smaug (17081096c) - Bug 1069230 - Presentation API implementation. Part 7 - Presentation session. r=smaug (29227f2cf) - Bug 1069230 - Presentation API implementation. Part 8 - Data transport channel. r=jdm (2eb3a49ca) - Bug 1069230 - Presentation API implementation. Part 9 - Tests. r=kikuo (3cb72b71e) - Bug 1162700 - Split the AppInfo into initial setting of the values and the further initialization. r=smaug (d0b8d1470)
78 lines
1.7 KiB
HTML
78 lines
1.7 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test for B2G Presentation Session API at receiver side</title>
|
|
</head>
|
|
<body>
|
|
<div id="content"></div>
|
|
<script type="application/javascript;version=1.7">
|
|
|
|
"use strict";
|
|
|
|
function is(a, b, msg) {
|
|
window.parent.postMessage((a === b ? 'OK ' : 'KO ') + msg, '*');
|
|
}
|
|
|
|
function ok(a, msg) {
|
|
window.parent.postMessage((a ? 'OK ' : 'KO ') + msg, '*');
|
|
}
|
|
|
|
function info(msg) {
|
|
window.parent.postMessage('INFO ' + msg, '*');
|
|
}
|
|
|
|
function command(msg) {
|
|
window.parent.postMessage('COMMAND ' + JSON.stringify(msg), '*');
|
|
}
|
|
|
|
function finish() {
|
|
window.parent.postMessage('DONE', '*');
|
|
}
|
|
|
|
var session;
|
|
|
|
function testSessionAvailable() {
|
|
return new Promise(function(aResolve, aReject) {
|
|
ok(navigator.presentation, "navigator.presentation should be available.");
|
|
|
|
session = navigator.presentation.session;
|
|
ok(session.id, "Session ID should be set: " + session.id);
|
|
is(session.state, "disconnected", "Session state at receiver side should be disconnected by default.");
|
|
aResolve();
|
|
});
|
|
}
|
|
|
|
function testSessionReady() {
|
|
return new Promise(function(aResolve, aReject) {
|
|
session.onstatechange = function() {
|
|
session.onstatechange = null;
|
|
is(session.state, "connected", "Session state should become connected.");
|
|
aResolve();
|
|
};
|
|
|
|
command({ name: 'trigger-incoming-offer' });
|
|
});
|
|
}
|
|
|
|
function testCloseSession() {
|
|
return new Promise(function(aResolve, aReject) {
|
|
session.onstatechange = function() {
|
|
session.onstatechange = null;
|
|
is(session.state, "terminated", "Session should be terminated.");
|
|
aResolve();
|
|
};
|
|
|
|
session.close();
|
|
});
|
|
}
|
|
|
|
testSessionAvailable().
|
|
then(testSessionReady).
|
|
then(testCloseSession).
|
|
then(finish);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|