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

Side by Side Diff: chrome/test/data/extensions/platform_apps/get_display_path/test.js

Issue 12223086: Update app runtime custom bindings to handle no WebIntents launch data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More stuff removed Created 7 years, 10 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.app.runtime.onLaunched.addListener(function (launchData) { 5 chrome.app.runtime.onLaunched.addListener(function (launchData) {
6 // Test that there is a launchData.intent, it is set up proerly, and that the 6 // Test that there is launchData, it is set up properly, and that the
7 // FileEntry in launchData.intent.data can be read. 7 // FileEntry in launchData.items[0].entry can have its display path gotten.
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testGetDisplayPath() { 9 function testGetDisplayPath() {
10 chrome.test.assertFalse(!launchData, "No launchData"); 10 chrome.test.assertFalse(!launchData, "No launchData");
11 chrome.test.assertFalse(!launchData.intent, "No launchData.intent"); 11 chrome.test.assertFalse(!launchData.items[0], "No launchData.items[0]");
12 chrome.test.assertEq(launchData.intent.action, 12 chrome.test.assertFalse(!launchData.items[0].entry,
13 "http://webintents.org/view"); 13 "No launchData.items[0].entry");
14 chrome.test.assertEq(launchData.intent.type, 14 var entry = launchData.items[0].entry;
15 "chrome-extension://fileentry");
16 chrome.test.assertFalse(!launchData.intent.data,
17 "No launchData.intent.data");
18 var entry = launchData.intent.data;
19 chrome.fileSystem.getDisplayPath(entry, 15 chrome.fileSystem.getDisplayPath(entry,
20 chrome.test.callbackPass(function(path) { 16 chrome.test.callbackPass(function(path) {
21 chrome.test.assertFalse(path.indexOf('test.txt') == -1); 17 chrome.test.assertFalse(path.indexOf('test.txt') == -1);
22 })); 18 }));
23 } 19 }
24 ]); 20 ]);
25 }); 21 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698