Commit 0544b8e9 authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Update file_table_unittest & file_list_selection_model_unittest to be generated.

This CL updates file_table_unittest & file_list_selection_model_unittest to be
autogenerated from dependencies.

Required fixing VolumeManager, where a method was only defined in
FilteredVolumeManager and not in the interface. Populate the base class with
a method that always logs an error to keep the closure compiler happy.

Bug: 860355
Change-Id: I90192479d7faf4368a140460400357dae0f2da4c
Reviewed-on: https://chromium-review.googlesource.com/c/1295429Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601843}
parent 1a04703f
...@@ -68,8 +68,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, DirectoryTreeTest) { ...@@ -68,8 +68,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, DirectoryTreeTest) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileTableTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileTableTest) {
RunTest(base::FilePath( RunGeneratedTest("/foreground/js/ui/file_table_unittest.html");
FILE_PATH_LITERAL("foreground/js/ui/file_table_unittest.html")));
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MediaScannerTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MediaScannerTest) {
...@@ -205,8 +204,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileTapHandler) { ...@@ -205,8 +204,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileTapHandler) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileListSelectionModelTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileListSelectionModelTest) {
RunTest(base::FilePath(FILE_PATH_LITERAL( RunGeneratedTest("/foreground/js/ui/file_list_selection_model_unittest.html");
"foreground/js/ui/file_list_selection_model_unittest.html")));
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FilesAppEntryTypes) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FilesAppEntryTypes) {
......
...@@ -326,10 +326,7 @@ FilteredVolumeManager.prototype.getCurrentProfileVolumeInfo = ...@@ -326,10 +326,7 @@ FilteredVolumeManager.prototype.getCurrentProfileVolumeInfo =
this.volumeManager_.getCurrentProfileVolumeInfo(volumeType)); this.volumeManager_.getCurrentProfileVolumeInfo(volumeType));
}; };
/** /** @override */
* Obtains the default display root entry.
* @param {function(Entry)} callback Callback passed the default display root.
*/
FilteredVolumeManager.prototype.getDefaultDisplayRoot = FilteredVolumeManager.prototype.getDefaultDisplayRoot =
function(callback) { function(callback) {
this.ensureInitialized(function() { this.ensureInitialized(function() {
......
...@@ -113,6 +113,13 @@ VolumeManager.prototype.findByDevicePath = function(devicePath) {}; ...@@ -113,6 +113,13 @@ VolumeManager.prototype.findByDevicePath = function(devicePath) {};
*/ */
VolumeManager.prototype.whenVolumeInfoReady = function(volumeId) {}; VolumeManager.prototype.whenVolumeInfoReady = function(volumeId) {};
/**
* Obtains the default display root entry.
* @param {function(DirectoryEntry)|function(FilesAppDirEntry)} callback
* Callback passed the default display root.
*/
VolumeManager.prototype.getDefaultDisplayRoot = function(callback) {};
/** /**
* Event object which is dispached with 'externally-unmounted' event. * Event object which is dispached with 'externally-unmounted' event.
* @constructor * @constructor
......
...@@ -60,6 +60,11 @@ MockVolumeManager.prototype.createVolumeInfo = ...@@ -60,6 +60,11 @@ MockVolumeManager.prototype.createVolumeInfo =
MockVolumeManager.prototype.getVolumeInfo = MockVolumeManager.prototype.getVolumeInfo =
VolumeManagerImpl.prototype.getVolumeInfo; VolumeManagerImpl.prototype.getVolumeInfo;
/** @override */
MockVolumeManager.prototype.getDefaultDisplayRoot =
VolumeManagerImpl.prototype.getDefaultDisplayRoot;
/** /**
* Obtains location information from an entry. * Obtains location information from an entry.
* Current implementation can handle only fake entries. * Current implementation can handle only fake entries.
......
...@@ -423,6 +423,12 @@ VolumeManagerImpl.prototype.whenVolumeInfoReady = function(volumeId) { ...@@ -423,6 +423,12 @@ VolumeManagerImpl.prototype.whenVolumeInfoReady = function(volumeId) {
}); });
}; };
/** @override */
VolumeManagerImpl.prototype.getDefaultDisplayRoot = function(callback) {
console.error('Unexpectedly called VolumeManagerImpl.getDefaultDisplayRoot.');
callback(null);
};
/** /**
* @param {string} key Key produced by |makeRequestKey_|. * @param {string} key Key produced by |makeRequestKey_|.
* @param {function(VolumeInfo)} successCallback To be called when the request * @param {function(VolumeInfo)} successCallback To be called when the request
......
...@@ -199,6 +199,13 @@ js_library("file_list_selection_model") { ...@@ -199,6 +199,13 @@ js_library("file_list_selection_model") {
] ]
} }
js_unittest("file_list_selection_model_unittest") {
deps = [
":file_list_selection_model",
"//ui/webui/resources/js:webui_resource_test",
]
}
js_library("file_manager_dialog_base") { js_library("file_manager_dialog_base") {
deps = [ deps = [
"//ui/webui/resources/js:cr", "//ui/webui/resources/js:cr",
...@@ -260,6 +267,17 @@ js_library("file_table") { ...@@ -260,6 +267,17 @@ js_library("file_table") {
"//ui/webui/resources/js:cr", "//ui/webui/resources/js:cr",
"//ui/webui/resources/js/cr/ui:table", "//ui/webui/resources/js/cr/ui:table",
] ]
externs_list = [
"../../../../externs/background/import_history.js",
"../../../../externs/background/import_history_enum.js",
]
}
js_unittest("file_table_unittest") {
deps = [
":file_table",
"//ui/webui/resources/js:webui_resource_test",
]
} }
js_library("file_table_list") { js_library("file_table_list") {
...@@ -392,5 +410,7 @@ js_library("suggest_apps_dialog") { ...@@ -392,5 +410,7 @@ js_library("suggest_apps_dialog") {
js_unit_tests("unit_tests") { js_unit_tests("unit_tests") {
deps = [ deps = [
":actions_submenu_unittest", ":actions_submenu_unittest",
":file_list_selection_model_unittest",
":file_table_unittest",
] ]
} }
<!DOCTYPE html>
<!-- Copyright 2017 The Chromium Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
-->
<html>
<body>
<script src="../../../../../../ui/webui/resources/js/cr.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/event_target.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/list_selection_model.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/list_single_selection_model.js"></script>
<script src="file_list_selection_model.js"></script>
<script src="file_list_selection_model_unittest.js"></script>
</body>
</html>
...@@ -20,9 +20,9 @@ FileTableColumnModel.prototype.__proto__ = ...@@ -20,9 +20,9 @@ FileTableColumnModel.prototype.__proto__ =
cr.ui.table.TableColumnModel.prototype; cr.ui.table.TableColumnModel.prototype;
/** /**
* Minimum width of column. * Minimum width of column. Note that is not marked private as it is used in the
* unit tests.
* @const {number} * @const {number}
* @private
*/ */
FileTableColumnModel.MIN_WIDTH_ = 10; FileTableColumnModel.MIN_WIDTH_ = 10;
......
<!DOCTYPE html>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
-->
<html>
<body>
<script src="../../../../../../ui/webui/resources/js/cr.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/event_target.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/splitter.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/table/table_column.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/table/table_column_model.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/table/table_header.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/table/table_splitter.js"></script>
<script src="../../../../../../ui/webui/resources/js/cr/ui/table.js"></script>
<script src="file_table.js"></script>
<script src="file_table_unittest.js"></script>
</body>
</html>
...@@ -221,6 +221,7 @@ function testSetWidthAndKeepTotal() { ...@@ -221,6 +221,7 @@ function testSetWidthAndKeepTotal() {
}); });
var minWidth = FileTableColumnModel.MIN_WIDTH_; var minWidth = FileTableColumnModel.MIN_WIDTH_;
// Total width = 500. // Total width = 500.
expectedWidths = [100, 100, 500 - 100 * 2 - minWidth * 2, minWidth, minWidth]; const expectedWidths =
[100, 100, 500 - 100 * 2 - minWidth * 2, minWidth, minWidth];
assertArrayEquals(expectedWidths, getColumnWidths(model)); assertArrayEquals(expectedWidths, getColumnWidths(model));
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment