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

Side by Side Diff: ui/file_manager/gallery/js/gallery_data_model_unittest.js

Issue 944163004: Files.app: Add new metadata model to Gallery.app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 5
6 var model; 6 var model;
7 var fileSystem; 7 var fileSystem;
8 var item; 8 var item;
9 9
10 function setUp() { 10 function setUp() {
11 var metadataCache = new MockMetadataCache(); 11 var metadataCache = new MockMetadataCache();
12 model = new GalleryDataModel(metadataCache, /* Mock EntryListWatcher */{}); 12 model = new GalleryDataModel(
13 metadataCache,
14 /* Mock FileSystemMetadata */{},
15 /* Mock EntryListWatcher */{});
13 fileSystem = new MockFileSystem('volumeId'); 16 fileSystem = new MockFileSystem('volumeId');
14 item = new Gallery.Item( 17 item = new Gallery.Item(
15 new MockEntry(fileSystem, '/test.jpg'), 18 new MockEntry(fileSystem, '/test.jpg'),
16 null, 19 null,
17 {media: {mimeType: 'image/jpeg'}}, 20 {media: {mimeType: 'image/jpeg'}},
18 metadataCache, 21 metadataCache,
19 /* original */ true); 22 /* original */ true);
20 } 23 }
21 24
22 function testSaveItemOverwrite(callback) { 25 function testSaveItemOverwrite(callback) {
(...skipping 26 matching lines...) Expand all
49 // Gallery item track new file. 52 // Gallery item track new file.
50 this.entry_ = new MockEntry(fileSystem, '/test (1).jpg'); 53 this.entry_ = new MockEntry(fileSystem, '/test (1).jpg');
51 callback(true); 54 callback(true);
52 }; 55 };
53 model.push(item); 56 model.push(item);
54 reportPromise( 57 reportPromise(
55 model.saveItem({}, item, document.createElement('canvas'), false). 58 model.saveItem({}, item, document.createElement('canvas'), false).
56 then(function() { assertEquals(2, model.length); }), 59 then(function() { assertEquals(2, model.length); }),
57 callback); 60 callback);
58 } 61 }
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/js/gallery_data_model.js ('k') | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698