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

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

Issue 1695563002: Media Galleries Partial Deprecation: Remove scan functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add idl apitest 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
(Empty)
1 // Copyright 2014 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 var mediaGalleries = chrome.mediaGalleries;
6
7 function MediaScanTest() {
8 var scanProgress = 'start';
9 var initialGalleryCount = 0;
10
11 function OnScanResultsAdded(galleries) {
12 chrome.test.assertEq(initialGalleryCount + 1, galleries.length);
13 chrome.test.succeed();
14 }
15
16 function OnScanProgress(details) {
17 chrome.test.assertEq(scanProgress, details.type);
18 if (scanProgress == 'start') {
19 scanProgress = 'finish';
20 } else {
21 scanProgress = 'done';
22 chrome.test.runWithUserGesture(function() {
23 mediaGalleries.addScanResults(OnScanResultsAdded);
24 });
25 }
26 }
27
28 function OnInitialMediaGalleries(galleries) {
29 initialGalleryCount = galleries.length;
30 mediaGalleries.onScanProgress.addListener(OnScanProgress);
31 mediaGalleries.startMediaScan();
32 }
33
34 mediaGalleries.getMediaFileSystems(OnInitialMediaGalleries);
35 }
36
37 CreateDummyWindowToPreventSleep();
38
39 chrome.test.runTests([
40 MediaScanTest,
41 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698