Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / cast_streaming / stop_no_start.js
blob9ff2010fcfbf15606d179c2d4adfa048caa0941c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var rtpStream = chrome.cast.streaming.rtpStream;
6 var tabCapture = chrome.tabCapture;
7 var udpTransport = chrome.cast.streaming.udpTransport;
8 var createSession = chrome.cast.streaming.session.create;
9 var pass = chrome.test.callbackPass;
11 chrome.test.runTests([
12   function stopNoStart() {
13     console.log("[TEST] stopNoStart");
14     tabCapture.capture({audio: true, video: true},
15                        pass(function(stream) {
16       console.log("Got MediaStream.");
17       chrome.test.assertTrue(!!stream);
18       createSession(stream.getAudioTracks()[0],
19                     stream.getVideoTracks()[0],
20                     pass(function(stream, audioId, videoId, udpId) {
21         chrome.test.assertTrue(audioId > 0);
22         chrome.test.assertTrue(videoId > 0);
23         chrome.test.assertTrue(udpId > 0);
24         rtpStream.stop(audioId);
25         rtpStream.stop(videoId);
26         rtpStream.destroy(audioId);
27         rtpStream.destroy(videoId);
28         udpTransport.destroy(udpId);
29         chrome.test.succeed();
30       }.bind(null, stream)));
31     }));
32   },
33 ]);