Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / media_galleries / access_attached / test.js
bloba6ce697674a123defe0f6fa19e5bc4fec3becf05
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;
7 var galleries;
8 var testResults = [];
9 var expectedFileSystems;
10 var testGalleryName;
12 var mediaFileSystemsListCallback = function(results) {
13 galleries = 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();
33 return;
34 } else {
35 testResults.push(metadata.name);
38 chrome.test.fail(testResults + ' vs ' + testGalleryName);
40 ]);