Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1114)

Side by Side Diff: chrome/test/data/extensions/api_test/cast_streaming/bad_logging.js

Issue 189583004: Cast: Implement log compression and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var rtpStream = chrome.cast.streaming.rtpStream; 5 var rtpStream = chrome.cast.streaming.rtpStream;
6 var tabCapture = chrome.tabCapture; 6 var tabCapture = chrome.tabCapture;
7 var udpTransport = chrome.cast.streaming.udpTransport; 7 var udpTransport = chrome.cast.streaming.udpTransport;
8 var createSession = chrome.cast.streaming.session.create; 8 var createSession = chrome.cast.streaming.session.create;
9 var pass = chrome.test.callbackPass; 9 var pass = chrome.test.callbackPass;
10 10
11 chrome.test.runTests([ 11 chrome.test.runTests([
12 function emptyLogWithLoggingDisabled() { 12 function emptyLogWithLoggingDisabled() {
13 13
14 console.log("[TEST] emptyLogWithLoggingDisabled"); 14 console.log("[TEST] emptyLogWithLoggingDisabled");
15 tabCapture.capture({audio: true, video: true}, 15 tabCapture.capture({audio: true, video: true},
16 pass(function(stream) { 16 pass(function(stream) {
17 console.log("Got MediaStream."); 17 console.log("Got MediaStream.");
18 chrome.test.assertTrue(!!stream); 18 chrome.test.assertTrue(!!stream);
19 createSession(stream.getAudioTracks()[0], 19 createSession(stream.getAudioTracks()[0],
20 stream.getVideoTracks()[0], 20 stream.getVideoTracks()[0],
21 pass(function(stream, audioId, videoId, udpId) { 21 pass(function(stream, audioId, videoId, udpId) {
22 console.log("Starting."); 22 console.log("Starting.");
23 var stateMachine = new TestStateMachine(stream, 23 var stateMachine = new TestStateMachine(stream,
24 audioId, 24 audioId,
25 videoId, 25 videoId,
26 udpId); 26 udpId);
27 var audioParams = rtpStream.getSupportedParams(audioId)[0]; 27 var audioParams = rtpStream.getSupportedParams(audioId)[0];
28 var videoParams = rtpStream.getSupportedParams(videoId)[0]; 28 var videoParams = rtpStream.getSupportedParams(videoId)[0];
29 var expectEmptyLogs = function(rawEvents) { 29 var expectEmptyLogs = function(rawEvents) {
30 chrome.test.assertEq("", rawEvents); 30 chrome.test.assertEq(0, rawEvents.byteLength);
31 } 31 }
32 chrome.test.assertEq(audioParams.payload.codecName, "OPUS"); 32 chrome.test.assertEq(audioParams.payload.codecName, "OPUS");
33 chrome.test.assertEq(videoParams.payload.codecName, "VP8"); 33 chrome.test.assertEq(videoParams.payload.codecName, "VP8");
34 udpTransport.setDestination(udpId, 34 udpTransport.setDestination(udpId,
35 {address: "127.0.0.1", port: 2344}); 35 {address: "127.0.0.1", port: 2344});
36 rtpStream.onStarted.addListener( 36 rtpStream.onStarted.addListener(
37 stateMachine.onStarted.bind(stateMachine)); 37 stateMachine.onStarted.bind(stateMachine));
38 stateMachine.onAllStarted = 38 stateMachine.onAllStarted =
39 pass(function(audioId, videoId) { 39 pass(function(audioId, videoId) {
40 console.log("Getting logs without enabling logging."); 40 console.log("Getting logs without enabling logging.");
(...skipping 17 matching lines...) Expand all
58 chrome.test.assertEq(audioParams.payload.codecName, "OPUS"); 58 chrome.test.assertEq(audioParams.payload.codecName, "OPUS");
59 chrome.test.assertEq(videoParams.payload.codecName, "VP8"); 59 chrome.test.assertEq(videoParams.payload.codecName, "VP8");
60 chrome.test.succeed(); 60 chrome.test.succeed();
61 }.bind(null, stream, audioId, videoId, udpId)); 61 }.bind(null, stream, audioId, videoId, udpId));
62 rtpStream.start(audioId, audioParams); 62 rtpStream.start(audioId, audioParams);
63 rtpStream.start(videoId, videoParams); 63 rtpStream.start(videoId, videoParams);
64 }.bind(null, stream))); 64 }.bind(null, stream)));
65 })); 65 }));
66 }, 66 },
67 ]); 67 ]);
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_session_delegate.cc ('k') | chrome/test/data/extensions/api_test/cast_streaming/basics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698