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

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

Issue 334393002: Revert of Enable gallery watches on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc ('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 galleries; 5 var galleries;
6 var invalidGalleryId = '11000'; 6 var invalidGalleryId = '11000';
7 7
8 // chrome.mediaGalleries.getMediaFileSystems callback. 8 // chrome.mediaGalleries.getMediaFileSystems callback.
9 var mediaFileSystemsListCallback = function (results) { 9 var mediaFileSystemsListCallback = function (results) {
10 galleries = results; 10 galleries = results;
(...skipping 15 matching lines...) Expand all
26 26
27 // chrome.mediaGalleries.getAllGalleryWatch callback. 27 // chrome.mediaGalleries.getAllGalleryWatch callback.
28 var getAllGalleryWatchCallback = function (results) { 28 var getAllGalleryWatchCallback = function (results) {
29 if (!results) { 29 if (!results) {
30 chrome.test.sendMessage('get_all_gallery_watch_failed'); 30 chrome.test.sendMessage('get_all_gallery_watch_failed');
31 return; 31 return;
32 } 32 }
33 if (results.length == 0) { 33 if (results.length == 0) {
34 chrome.test.sendMessage('gallery_watchers_does_not_exists'); 34 chrome.test.sendMessage('gallery_watchers_does_not_exists');
35 } else { 35 } else {
36 for (var i = 0; i < results.lendth; ++i) { 36 var gallery_ids_str = "";
37 var info = chrome.mediaGalleries.getMediaFileSystemMetadata(galleries[i]); 37 for (var i = 0; i < results.length; ++i) {
38 if (results[i] !== info.galleryId) { 38 if (gallery_ids_str != "")
39 chrome.test.sendMessage('gallery_watcher_mismatch'); 39 gallery_ids_str += ", ";
40 return; 40 gallery_ids_str += results[i];
41 }
42 } 41 }
43 chrome.test.sendMessage('gallery_watcher_checks'); 42 chrome.test.sendMessage(
43 'watchers_for_galleries_{' + gallery_ids_str + '}_found');
44 } 44 }
45 }; 45 };
46 46
47 // Helpers to add and remove event listeners. 47 // Helpers to add and remove event listeners.
48 function addGalleryChangedListener() { 48 function addGalleryChangedListener() {
49 chrome.mediaGalleriesPrivate.onGalleryChanged.addListener( 49 chrome.mediaGalleriesPrivate.onGalleryChanged.addListener(
50 onGalleryChangedCallback); 50 onGalleryChangedCallback);
51 chrome.test.sendMessage('add_gallery_changed_listener_ok'); 51 chrome.test.sendMessage('add_gallery_changed_listener_ok');
52 }; 52 };
53 53
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 function getAllWatchedGalleryIds() { 88 function getAllWatchedGalleryIds() {
89 chrome.mediaGalleriesPrivate.getAllGalleryWatch(getAllGalleryWatchCallback); 89 chrome.mediaGalleriesPrivate.getAllGalleryWatch(getAllGalleryWatchCallback);
90 chrome.test.sendMessage('get_all_gallery_watch_ok'); 90 chrome.test.sendMessage('get_all_gallery_watch_ok');
91 }; 91 };
92 92
93 function removeAllGalleryWatch() { 93 function removeAllGalleryWatch() {
94 chrome.mediaGalleriesPrivate.removeAllGalleryWatch(); 94 chrome.mediaGalleriesPrivate.removeAllGalleryWatch();
95 chrome.test.sendMessage('remove_all_gallery_watch_ok'); 95 chrome.test.sendMessage('remove_all_gallery_watch_ok');
96 }; 96 };
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698