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

Side by Side Diff: extensions/test/data/api_test/display_source/api/background.js

Issue 1471243002: chrome.displaySource custom bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing nits Created 5 years 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
« no previous file with comments | « extensions/renderer/resources/extensions_renderer_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 testGetAvailableSinks = function() { 5 var testGetAvailableSinks = function() {
6 var callback = function(sinks) { 6 var callback = function(sinks) {
7 chrome.test.assertEq(1, sinks.length); 7 chrome.test.assertEq(1, sinks.length);
8 var sink = sinks[0]; 8 var sink = sinks[0];
9 chrome.test.assertEq(1, sink.id); 9 chrome.test.assertEq(1, sink.id);
10 chrome.test.assertEq("Disconnected", sink.state); 10 chrome.test.assertEq("Disconnected", sink.state);
(...skipping 16 matching lines...) Expand all
27 }; 27 };
28 28
29 var testRequestAuthentication = function() { 29 var testRequestAuthentication = function() {
30 var callback = function(auth_info) { 30 var callback = function(auth_info) {
31 chrome.test.assertEq("PBC", auth_info.method); 31 chrome.test.assertEq("PBC", auth_info.method);
32 chrome.test.succeed("RequestAuthentication succeded"); 32 chrome.test.succeed("RequestAuthentication succeded");
33 }; 33 };
34 chrome.displaySource.requestAuthentication(1, callback); 34 chrome.displaySource.requestAuthentication(1, callback);
35 }; 35 };
36 36
37 var testStartSessionErrorReport = function() {
38 var callback = function() {
39 chrome.test.assertLastError('Invalid stream arguments');
40 chrome.test.succeed();
41 };
42 var session_info = { sinkId: 1, authenticationInfo: { method: "PBC" } };
43 chrome.displaySource.startSession(session_info, callback);
44 };
45
46 var testTerminateSessionErrorReport = function() {
47 var callback = function() {
48 chrome.test.assertLastError('Session not found');
49 chrome.test.succeed();
50 };
51 chrome.displaySource.terminateSession(1, callback);
52 };
53
37 chrome.test.runTests([testGetAvailableSinks, 54 chrome.test.runTests([testGetAvailableSinks,
38 testOnSinksUpdated, 55 testOnSinksUpdated,
39 testRequestAuthentication]); 56 testRequestAuthentication,
57 testStartSessionErrorReport,
58 testTerminateSessionErrorReport]);
OLDNEW
« no previous file with comments | « extensions/renderer/resources/extensions_renderer_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698