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 chrome.experimental.app.onLaunched.addListener(function() { | |
6 var experimentalMediaGalleries = chrome.experimental.mediaGalleries; | |
7 var mediaGalleries = chrome.mediaGalleries; | |
8 var mediaFileSystemsListCallback = function(results) { | |
9 // There should be a "Pictures" directory on all desktop platforms. | |
10 var expectedFileSystems = 1; | |
11 // But not on Android and ChromeOS. | |
12 if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) | |
13 expectedFileSystems = 0; | |
14 chrome.test.assertEq(expectedFileSystems, results.length); | |
15 // TODO(vandebo) Test that we can read from the file system object. | |
16 }; | |
17 var nullCallback = function(result) { | |
18 chrome.test.assertEq(null, result); | |
19 }; | |
20 | |
21 function runTests(tests) { | |
22 chrome.test.getConfig(function(config) { | |
23 operatingSystem = config.osName; | |
24 chrome.test.runTests(tests); | |
25 }); | |
26 } | |
27 | |
28 chrome.test.runTests([ | |
29 function getGalleries() { | |
30 mediaGalleries.getMediaFileSystems( | |
31 chrome.test.callbackPass(mediaFileSystemsListCallback)); | |
32 }, | |
33 | |
34 function extractEmbeddedThumbnails() { | |
35 var result = experimentalMediaGalleries.extractEmbeddedThumbnails({}); | |
36 chrome.test.assertEq(null, result); | |
37 chrome.test.succeed(); | |
38 }, | |
39 | |
40 function assembleMediaFile() { | |
41 experimentalMediaGalleries.assembleMediaFile( | |
42 new Blob, {}, | |
43 chrome.test.callbackPass(nullCallback)); | |
44 }, | |
45 ]); | |
46 }); | |
OLD | NEW |