Chromium Code Reviews| 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') { |
|
Dmitry Titov
2012/09/05 21:47:47
The test sends emails and phone numbers, but the b
zel
2012/09/05 22:06:21
Done.
|
| + 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}); |
| + }); |