Commit a4eaff2a authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Gallery: Closure compile gallery_item_unittest.js

This is the last Gallery unittest not closure compiled.

Bug: 867700
Change-Id: I6e4c2b2cf23b80967e060d838dd3872b55306daf
Reviewed-on: https://chromium-review.googlesource.com/1184644Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585677}
parent 8ccbe3e4
......@@ -38,7 +38,7 @@ IN_PROC_BROWSER_TEST_F(GalleryJsTest, GalleryUtilTest) {
}
IN_PROC_BROWSER_TEST_F(GalleryJsTest, GalleryItemTest) {
RunTest(base::FilePath(FILE_PATH_LITERAL("gallery_item_unittest.html")));
RunGeneratedTest("/gallery_item_unittest.html");
}
IN_PROC_BROWSER_TEST_F(GalleryJsTest, GalleryDataModelTest) {
......
......@@ -126,6 +126,15 @@ js_library("gallery_item") {
externs_list = [ "../../externs/entry_location.js" ]
}
js_library("gallery_item_unittest") {
deps = [
":gallery_item",
":mock_gallery_item",
"../../file_manager/common/js:unittest_util",
"//ui/webui/resources/js:webui_resource_test",
]
}
js_library("gallery_util") {
deps = [
"../../file_manager/common/js:file_type",
......@@ -221,6 +230,7 @@ js_unit_tests("unit_tests") {
":dimmable_ui_controller_unittest",
":entry_list_watcher_unittest",
":gallery_data_model_unittest",
":gallery_item_unittest",
":gallery_util_unittest",
":ribbon_unittest",
":slide_mode_unittest",
......
<!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.
-->
<script>
// Define mock Gallery class to define GalleryItem class.
var Gallery = function() {};
</script>
<!-- Should be loaded before volume_manager.js -->
<script src="../../file_manager/common/js/volume_manager_common.js"></script>
<!-- Others -->
<script src="../../../webui/resources/js/assert.js"></script>
<script src="../../../webui/resources/js/cr.js"></script>
<script src="../../../webui/resources/js/cr/event_target.js"></script>
<script src="../../../webui/resources/js/cr/ui/array_data_model.js"></script>
<script src="../../../webui/resources/js/load_time_data.js"></script>
<script src="../../file_manager/common/js/file_type.js"></script>
<script src="../../file_manager/common/js/mock_entry.js"></script>
<script src="../../file_manager/common/js/unittest_util.js"></script>
<script src="../../file_manager/common/js/util.js"></script>
<script src="../../file_manager/foreground/js/metadata/thumbnail_model.js"></script>
<script src="../../file_manager/foreground/js/metadata/mock_metadata.js"></script>
<script src="gallery_item.js"></script>
<script src="gallery_util.js"></script>
<script src="gallery_item_unittest.js"></script>
......@@ -4,6 +4,7 @@
/**
* A namespace class for image encoding functions. All methods are static.
* @constructor
*/
function ImageEncoder() {}
......
......@@ -22,6 +22,21 @@ function MockGalleryItem(
opt_thumbnailMetadataItem || null, opt_original || false);
}
/**
* Helper to construct a MockGalleryItem with a given |path| and dummy metadata.
*
* @param {!string} path
* @param {!FileSystem} fileSystem
* @param {boolean} isReadOnly
* @return MockGalleryItem
*/
MockGalleryItem.makeWithPath = function(path, fileSystem, isReadOnly) {
return new MockGalleryItem(
new MockFileEntry(fileSystem, path),
/** @type {EntryLocation} */ ({isReadOnly: isReadOnly}), {size: 100},
null, true /* original */);
};
MockGalleryItem.prototype = {
__proto__: GalleryItem.prototype
};
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