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
3 // found in the LICENSE file.
5 chrome
.app
.runtime
.onLaunched
.addListener(function (launchData
) {
6 // Test that the isKioskSession field is |false| and the items field is
7 // populated correctly in the launch data and that the FileEntry in
8 // launchData.items[0].entry can have its display path gotten.
10 function testGetDisplayPath() {
11 chrome
.test
.assertFalse(!launchData
, "No launchData");
12 chrome
.test
.assertFalse(launchData
.isKioskSession
,
13 "launchData.isKioskSession incorrect");
14 chrome
.test
.assertFalse(!launchData
.items
[0], "No launchData.items[0]");
15 chrome
.test
.assertFalse(!launchData
.items
[0].entry
,
16 "No launchData.items[0].entry");
17 var entry
= launchData
.items
[0].entry
;
18 chrome
.fileSystem
.getDisplayPath(entry
,
19 chrome
.test
.callbackPass(function(path
) {
20 chrome
.test
.assertFalse(path
.indexOf('test.txt') == -1);