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

Unified Diff: chrome/test/data/extensions/api_test/webintent_handler/background.js

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tiny 80 chars fix 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/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);

Powered by Google App Engine
This is Rietveld 408576698