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

Side by Side Diff: chrome/test/data/extensions/api_test/rtc_private/events/background.js

Issue 10919086: Wired chrome.rtcPrivate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed linux_aura build issues Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 var action_counter = 0;
6
7 chrome.rtcPrivate.onLaunch.addListener(function(launchData) {
8 if(!launchData) {
9 console.log('HANDLER: got default action');
10 action_counter++;
11 return;
12 }
13
14 var action = launchData.intent.action;
15 if (action == 'chat' || action == 'video' || action == 'voice') {
16 console.log('HANDLER: Received ' + action +
17 ', data = ' + launchData.intent.data);
18 var data = launchData.intent.data;
19 var type = launchData.intent.type;
20 if (type != 'application/vnd.chromium.contact' ||
21 data.name != 'Test Contact' ||
22 data.phone.length != 2 ||
23 data.phone[0] != '(555) 111-2222' ||
24 data.phone[1] != '(555) 333-4444' ||
25 data.email.length != 2 ||
26 data.email[0] != 'test_1@something.com' ||
27 data.email[1] != 'test_2@something.com') {
28 chrome.test.fail('HANDLER: Invalid data!');
29 return;
30 }
31 action_counter++;
32 if (action_counter == 4)
33 chrome.test.sendMessage('received_all');
34 } else {
35 console.log('HANDLER: unknown action - ' + action);
36 chrome.test.fail('HANDLER: No content changed!');
37 return;
38 }
39 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698