OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 var mediaGalleries = chrome.mediaGalleries; |
| 6 |
| 7 var mediaFileSystemsDirectoryEntryCallback = function(entries) { |
| 8 chrome.test.fail("Shouldn't have been able to get a directory listing."); |
| 9 }; |
| 10 |
| 11 var mediaFileSystemsListCallback = function(results) { |
| 12 // There should be a "Pictures" directory on all desktop platforms. |
| 13 var expectedFileSystems = 1; |
| 14 // But not on Android and ChromeOS. |
| 15 if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) |
| 16 expectedFileSystems = 0; |
| 17 chrome.test.assertEq(expectedFileSystems, results.length); |
| 18 if (expectedFileSystems) { |
| 19 var dir_reader = results[0].root.createReader(); |
| 20 dir_reader.readEntries(mediaFileSystemsDirectoryEntryCallback, |
| 21 chrome.test.callbackPass()); |
| 22 } |
| 23 }; |
| 24 |
| 25 chrome.test.runTests([ |
| 26 function getGalleries() { |
| 27 mediaGalleries.getMediaFileSystems( |
| 28 chrome.test.callbackPass(mediaFileSystemsListCallback)); |
| 29 }, |
| 30 ]); |
OLD | NEW |