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

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

Issue 1791623002: Revert of Media Galleries Partial Deprecation: Remove image metadata & libexif. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Manual revert/rebase. Created 4 years, 9 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
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.mediaGalleries;
6 var expectedGalleryEntryLength; 6 var expectedGalleryEntryLength;
7 7
8 function TestFirstFilesystem(verifyFilesystem) { 8 function TestFirstFilesystem(verifyFilesystem) {
9 function getMediaFileSystemsList() { 9 function getMediaFileSystemsList() {
10 mediaGalleries.getMediaFileSystems(getMediaFileSystemsCallback); 10 mediaGalleries.getMediaFileSystems(getMediaFileSystemsCallback);
(...skipping 24 matching lines...) Expand all
35 35
36 function ReadFileToBytesTest() { 36 function ReadFileToBytesTest() {
37 function verifyFilesystem(filesystem) { 37 function verifyFilesystem(filesystem) {
38 verifyJPEG(filesystem.root, "test.jpg", expectedGalleryEntryLength, 38 verifyJPEG(filesystem.root, "test.jpg", expectedGalleryEntryLength,
39 chrome.test.succeed); 39 chrome.test.succeed);
40 } 40 }
41 41
42 TestFirstFilesystem(verifyFilesystem); 42 TestFirstFilesystem(verifyFilesystem);
43 } 43 }
44 44
45 function GetMetadataTest() {
46 function verifyFilesystem(filesystem) {
47 filesystem.root.getFile("test.jpg", {create: false}, verifyFileEntry,
48 chrome.test.fail);
49 }
50
51 function verifyFileEntry(fileEntry) {
52 fileEntry.file(verifyFile, chrome.test.fail)
53 }
54
55 function verifyFile(file) {
56 mediaGalleries.getMetadata(file, {}, verifyMetadata);
57 }
58
59 function verifyMetadata(metadata) {
60 chrome.test.assertEq("image/jpeg", metadata.mimeType);
61 chrome.test.succeed();
62 }
63
64 TestFirstFilesystem(verifyFilesystem);
65 }
66
45 function GetMediaFileSystemMetadataTest() { 67 function GetMediaFileSystemMetadataTest() {
46 function verifyFilesystem(filesystem) { 68 function verifyFilesystem(filesystem) {
47 var metadata = mediaGalleries.getMediaFileSystemMetadata(filesystem); 69 var metadata = mediaGalleries.getMediaFileSystemMetadata(filesystem);
48 checkMetadata(metadata); 70 checkMetadata(metadata);
49 chrome.test.succeed(); 71 chrome.test.succeed();
50 } 72 }
51 73
52 TestFirstFilesystem(verifyFilesystem); 74 TestFirstFilesystem(verifyFilesystem);
53 } 75 }
54 76
55 CreateDummyWindowToPreventSleep(); 77 CreateDummyWindowToPreventSleep();
56 78
57 chrome.test.getConfig(function(config) { 79 chrome.test.getConfig(function(config) {
58 customArg = JSON.parse(config.customArg); 80 customArg = JSON.parse(config.customArg);
59 expectedGalleryEntryLength = customArg[0]; 81 expectedGalleryEntryLength = customArg[0];
60 82
61 chrome.test.runTests([ 83 chrome.test.runTests([
62 ReadDirectoryTest, 84 ReadDirectoryTest,
63 ReadFileToBytesTest, 85 ReadFileToBytesTest,
86 GetMetadataTest,
64 GetMediaFileSystemMetadataTest, 87 GetMediaFileSystemMetadataTest,
65 ]); 88 ]);
66 }) 89 })
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/media_metadata/test.js ('k') | chrome/tools/build/chromeos/FILES.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698