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

Side by Side Diff: ui/file_manager/file_manager/foreground/js/task_controller_unittest.js

Issue 2513493002: Files App: Update the context menu when installed app is changed. (Closed)
Patch Set: Fixed test. Created 4 years 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
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/task_controller.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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 window.metrics = { 5 window.metrics = {
6 recordEnum: function() {} 6 recordEnum: function() {}
7 }; 7 };
8 8
9 function MockMetadataModel(properties) { 9 function MockMetadataModel(properties) {
10 this.properties_ = properties; 10 this.properties_ = properties;
(...skipping 16 matching lines...) Expand all
27 cr.ui.decorate('command', cr.ui.Command); 27 cr.ui.decorate('command', cr.ui.Command);
28 } 28 }
29 29
30 function testExecuteEntryTask(callback) { 30 function testExecuteEntryTask(callback) {
31 window.chrome.fileManagerPrivate = { 31 window.chrome.fileManagerPrivate = {
32 getFileTasks: function(entries, callback) { 32 getFileTasks: function(entries, callback) {
33 setTimeout(callback.bind(null, [ 33 setTimeout(callback.bind(null, [
34 {taskId:'handler-extension-id|file|open', isDefault: false}, 34 {taskId:'handler-extension-id|file|open', isDefault: false},
35 {taskId:'handler-extension-id|file|play', isDefault: true} 35 {taskId:'handler-extension-id|file|play', isDefault: true}
36 ]), 0); 36 ]), 0);
37 } 37 },
38 onAppsUpdated: {
39 addListener: function() {},
40 },
38 }; 41 };
39 42
40 var fileSystem = new MockFileSystem('volumeId'); 43 var fileSystem = new MockFileSystem('volumeId');
41 fileSystem.entries['/test.png'] = 44 fileSystem.entries['/test.png'] =
42 new MockFileEntry(fileSystem, '/test.png', {}); 45 new MockFileEntry(fileSystem, '/test.png', {});
43 var controller = new TaskController( 46 var controller = new TaskController(
44 DialogType.FULL_PAGE, 47 DialogType.FULL_PAGE,
45 { 48 {
46 getDriveConnectionState: function() { 49 getDriveConnectionState: function() {
47 return VolumeManagerCommon.DriveConnectionType.ONLINE; 50 return VolumeManagerCommon.DriveConnectionType.ONLINE;
(...skipping 15 matching lines...) Expand all
63 new cr.EventTarget(), 66 new cr.EventTarget(),
64 null); 67 null);
65 68
66 controller.executeEntryTask(fileSystem.entries['/test.png']); 69 controller.executeEntryTask(fileSystem.entries['/test.png']);
67 reportPromise(new Promise(function(fulfill) { 70 reportPromise(new Promise(function(fulfill) {
68 chrome.fileManagerPrivate.executeTask = fulfill; 71 chrome.fileManagerPrivate.executeTask = fulfill;
69 }).then(function(info) { 72 }).then(function(info) {
70 assertEquals("handler-extension-id|file|play", info); 73 assertEquals("handler-extension-id|file|play", info);
71 }), callback); 74 }), callback);
72 } 75 }
OLDNEW
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/task_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698