Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Side by Side Diff: chrome/test/data/extensions/api_test/media_galleries/read_access/test.js

Issue 10823193: Move MediaGalleries.getMediaFileSystems back to experimental for M22 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/read_access/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var mediaGalleries = chrome.mediaGalleries; 5 var mediaGalleries = chrome.experimental.mediaGalleries;
6 6
7 var mediaFileSystemsDirectoryErrorCallback = function(err) { 7 var mediaFileSystemsDirectoryErrorCallback = function(err) {
8 chrome.test.fail("Couldn't read from directory: " + err); 8 chrome.test.fail("Couldn't read from directory: " + err);
9 }; 9 };
10 10
11 var mediaFileSystemsListCallback = function(results) { 11 var mediaFileSystemsListCallback = function(results) {
12 // There should be a "Pictures" directory on all desktop platforms. 12 // There should be a "Pictures" directory on all desktop platforms.
13 var expectedFileSystems = 1; 13 var expectedFileSystems = 1;
14 // But not on Android and ChromeOS. 14 // But not on Android and ChromeOS.
15 if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) 15 if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent))
16 expectedFileSystems = 0; 16 expectedFileSystems = 0;
17 chrome.test.assertEq(expectedFileSystems, results.length); 17 chrome.test.assertEq(expectedFileSystems, results.length);
18 if (expectedFileSystems) { 18 if (expectedFileSystems) {
19 var dir_reader = results[0].root.createReader(); 19 var dir_reader = results[0].root.createReader();
20 dir_reader.readEntries(chrome.test.callbackPass(), 20 dir_reader.readEntries(chrome.test.callbackPass(),
21 mediaFileSystemsDirectoryErrorCallback); 21 mediaFileSystemsDirectoryErrorCallback);
22 } 22 }
23 }; 23 };
24 24
25 chrome.test.runTests([ 25 chrome.test.runTests([
26 function getGalleries() { 26 function getGalleries() {
27 mediaGalleries.getMediaFileSystems( 27 mediaGalleries.getMediaFileSystems(
28 chrome.test.callbackPass(mediaFileSystemsListCallback)); 28 chrome.test.callbackPass(mediaFileSystemsListCallback));
29 }, 29 },
30 ]); 30 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/read_access/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698