1 // Copyright (c) 2013 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.
5 var mediaGalleries
= chrome
.mediaGalleries
;
9 var expectedFileSystems
;
12 var mediaFileSystemsListCallback = function(results
) {
16 chrome
.test
.getConfig(function(config
) {
17 customArg
= JSON
.parse(config
.customArg
);
18 expectedFileSystems
= customArg
[0];
19 testGalleryName
= customArg
[1];
21 chrome
.test
.runTests([
22 function mediaGalleriesAccessAttached() {
23 mediaGalleries
.getMediaFileSystems(
24 chrome
.test
.callbackPass(mediaFileSystemsListCallback
));
26 function testGalleries() {
27 chrome
.test
.assertEq(expectedFileSystems
, galleries
.length
);
29 for (var i
= 0; i
< galleries
.length
; i
++) {
30 var metadata
= mediaGalleries
.getMediaFileSystemMetadata(galleries
[i
]);
31 if (metadata
.name
== testGalleryName
) {
32 chrome
.test
.succeed();
35 testResults
.push(metadata
.name
);
38 chrome
.test
.fail(testResults
+ ' vs ' + testGalleryName
);