| OLD | NEW |
| 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 the isKioskSession field is |false| and the items field is | 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 | 7 // populated correctly in the launch data and that the FileSystemFileEntry in |
| 8 // launchData.items[0].entry can have its display path gotten. | 8 // launchData.items[0].entry can have its display path gotten. |
| 9 chrome.test.runTests([ | 9 chrome.test.runTests([ |
| 10 function testGetDisplayPath() { | 10 function testGetDisplayPath() { |
| 11 chrome.test.assertFalse(!launchData, "No launchData"); | 11 chrome.test.assertFalse(!launchData, "No launchData"); |
| 12 chrome.test.assertFalse(launchData.isKioskSession, | 12 chrome.test.assertFalse(launchData.isKioskSession, |
| 13 "launchData.isKioskSession incorrect"); | 13 "launchData.isKioskSession incorrect"); |
| 14 chrome.test.assertFalse(!launchData.items[0], "No launchData.items[0]"); | 14 chrome.test.assertFalse(!launchData.items[0], "No launchData.items[0]"); |
| 15 chrome.test.assertFalse(!launchData.items[0].entry, | 15 chrome.test.assertFalse(!launchData.items[0].entry, |
| 16 "No launchData.items[0].entry"); | 16 "No launchData.items[0].entry"); |
| 17 var entry = launchData.items[0].entry; | 17 var entry = launchData.items[0].entry; |
| 18 chrome.fileSystem.getDisplayPath(entry, | 18 chrome.fileSystem.getDisplayPath(entry, |
| 19 chrome.test.callbackPass(function(path) { | 19 chrome.test.callbackPass(function(path) { |
| 20 chrome.test.assertFalse(path.indexOf('test.txt') == -1); | 20 chrome.test.assertFalse(path.indexOf('test.txt') == -1); |
| 21 })); | 21 })); |
| 22 } | 22 } |
| 23 ]); | 23 ]); |
| 24 }); | 24 }); |
| OLD | NEW |