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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/rtc_private/events/background.js
diff --git a/chrome/test/data/extensions/api_test/rtc_private/events/background.js b/chrome/test/data/extensions/api_test/rtc_private/events/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..73bd8dab8d936f6c1d1e97771c2bba5795118c0b
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/rtc_private/events/background.js
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var action_counter = 0;
+
+chrome.rtcPrivate.onLaunch.addListener(function(launchData) {
+ if(!launchData) {
+ console.log('HANDLER: got default action');
+ action_counter++;
+ return;
+ }
+
+ var action = launchData.intent.action;
+ if (action == 'chat' || action == 'video' || action == 'voice') {
+ var data = launchData.intent.data;
+ var type = launchData.intent.type;
+ console.log('HANDLER: Received ' + action + ', data = ' + data);
+ action_counter++;
+ } else {
+ console.log('HANDLER: unknown action - ' + action);
+ chrome.test.fail('HANDLER: No content changed!');
+ return;
+ }
+});
+
+chrome.extension.onMessage.addListener(
+ function(request, sender, sendResponse) {
+ if (request.message == "getIntentsCount")
+ sendResponse({"count": action_counter});
+ });

Powered by Google App Engine
This is Rietveld 408576698