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