Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/webintent_handler/background.js |
| diff --git a/chrome/test/data/extensions/api_test/webintent_handler/background.js b/chrome/test/data/extensions/api_test/webintent_handler/background.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d30ceae3297421fd5937a48734e67f71192a874 |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/api_test/webintent_handler/background.js |
| @@ -0,0 +1,25 @@ |
| +// 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. |
| + |
| +/* |
| +This extension is a platform app that provides a Web Intent handler; it accepts |
| +incoming requests and replies immediately with a success message. |
| +*/ |
| + |
| +function launchedListener(args) { |
| + if (!(args && args['intent'])) { |
| + chrome.test.fail('Expected web intent on args: ' + args); |
| + return; |
| + } |
|
tbarzic
2012/09/11 02:01:40
can you test that the extension can read the file
|
| + var intent = args['intent']; |
| + chrome.test.assertEq('http://webintents.org/view', intent['action']); |
| + chrome.test.succeed(); |
| + |
| + // Note that we're not using chrome.extension.sendRequest here to call back |
| + // to the source app - the call is not available in v2 packaged apps. The |
| + // most we can do for now is succeed or fail the test (to be caught by a |
| + // ResultCatcher in external_filesystem_apitest.cc). |
| +} |
| + |
| +chrome.app.runtime.onLaunched.addListener(launchedListener); |