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 mediaFileSystemsDirectoryErrorCallback = function(err) { | |
12 // When this callback completes, success will be signalled. | |
13 }; | |
14 | |
15 var mediaFileSystemsListCallback = function(results) { | |
16 // There should be a "Pictures" directory on all desktop platforms. | |
17 var expectedFileSystems = 1; | |
18 // But not on Android and ChromeOS. | |
19 if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) | |
20 expectedFileSystems = 0; | |
21 chrome.test.assertEq(expectedFileSystems, results.length); | |
22 if (expectedFileSystems) { | |
23 var dir_reader = results[0].root.createReader(); | |
24 dir_reader.readEntries( | |
25 mediaFileSystemsDirectoryEntryCallback, | |
26 chrome.test.callbackPass(mediaFileSystemsDirectoryErrorCallback)); | |
Matt Perry
2012/07/26 19:46:47
I think you can omit the argument rather than pass
vandebo (ex-Chrome)
2012/07/26 23:25:19
Done.
| |
27 } | |
28 }; | |
29 | |
30 chrome.test.runTests([ | |
31 function getGalleries() { | |
32 mediaGalleries.getMediaFileSystems( | |
33 chrome.test.callbackPass(mediaFileSystemsListCallback)); | |
34 }, | |
35 ]); | |
OLD | NEW |