Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / RTCPeerConnection-events.html
blob994f40b72a361a7b85008fd2210af60679a0cd96
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Tests that RTCPeerConnection event callbacks are async so that for example close can be called safely. The order of the messages is very important.");
10 var stream = null;
11 var pc = null;
13 function error() {
14 testFailed('Stream generation failed.');
15 finishJSTest();
18 function getUserMedia(dictionary, callback) {
19 try {
20 navigator.webkitGetUserMedia(dictionary, callback, error);
21 } catch (e) {
22 testFailed('webkitGetUserMedia threw exception :' + e);
23 finishJSTest();
27 function onStateChange(event) {
28 testPassed('onStateChange was called.');
29 shouldBe("pc.signalingState", "'closed'");
30 finishJSTest();
33 function onNegotiationNeeded(event) {
34 testPassed('onNegotiationNeeded was called.');
35 pc.onsignalingstatechange = onStateChange;
36 pc.close();
37 testPassed('onNegotiationNeeded done.')
40 function gotStream(s) {
41 testPassed('gotStream was called.');
42 stream = s;
44 pc = new webkitRTCPeerConnection(null, null);
45 pc.onnegotiationneeded = onNegotiationNeeded;
47 pc.addStream(stream);
48 testPassed('gotStream done.');
51 getUserMedia({audio:true, video:true}, gotStream);
53 window.jsTestIsAsync = true;
54 window.successfullyParsed = true;
57 </script>
58 </body>
59 </html>