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

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

Issue 10822002: Media Galleries API: hookup the AllGalleries permission and add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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/test.js ('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
(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 });
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/read_access/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698