Commit 6d3e5f48 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Closure compile import_history_unittest

Closure JS compiler type annotations for this unit test were added in
CL:1345690: enable them and auto-generate the unit test code.

 Remove import_history_unittest.html
  - make file_manager_jstest.cc auto-generate the unit test code

 BUILD file: enable Closure compiler
  - update js_library(import_history) deps for Closure compiler
  - add js_unittest(import_history_unittest) auto-generate rule

 import_history_unittest.js: remove unused Drive sync leftovers
  - Drive sync moved to its own unittest rule in the past so ...
  - chrome.fileManagerPrivate.onFileTransfersUpdated > /dev/null
  - chrome.syncFileSystem, TestSyncFileEntryProvider > /dev/null

Bug: 905934
Change-Id: I16b93e755c3a4a00378b426616cf030afc6a325f
Reviewed-on: https://chromium-review.googlesource.com/c/1346430Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610274}
parent ed2b4ba7
......@@ -54,8 +54,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ImporterCommonTest) {
}
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ImportHistoryTest) {
RunTest(base::FilePath(
FILE_PATH_LITERAL("background/js/import_history_unittest.html")));
RunGeneratedTest("/background/js/import_history_unittest.html");
}
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, VolumeManagerTest) {
......
......@@ -211,6 +211,15 @@ js_library("import_history") {
"../../common/js:importer_common",
"../../common/js:util",
]
externs_list = [ "../../../externs/background/import_history.js" ]
}
js_unittest("import_history_unittest") {
deps = [
":import_history",
"//ui/file_manager/file_manager/common/js:mock_entry",
"//ui/file_manager/file_manager/common/js:test_importer_common",
]
}
js_library("launcher") {
......@@ -350,6 +359,7 @@ js_library("volume_manager_util") {
js_unit_tests("unit_tests") {
deps = [
":crostini_unittest",
":import_history_unittest",
":volume_manager_unittest",
]
}
<!DOCTYPE html>
<!-- Copyright 2014 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="../../../base/js/volume_manager_types.js"></script>
<script src="../../common/js/importer_common.js"></script>
<script src="../../common/js/lru_cache.js"></script>
<script src="../../common/js/test_importer_common.js"></script>
<script src="../../common/js/mock_entry.js"></script>
<script src="../../../base/js/test_error_reporting.js"></script>
<script src="../../common/js/unittest_util.js"></script>
<script src="../../common/js/util.js"></script>
<script src="metadata_proxy.js"></script>
<script src="import_history.js"></script>
<script src="import_history_unittest.js"></script>
</body>
</html>
......@@ -339,20 +339,14 @@ function testCreateMetadataHashcode(callback) {
}
/**
* Installs stub APIs.
* Installs stub chrome APIs.
*/
function setupChromeApis() {
new MockChromeStorageAPI();
chrome = chrome || {};
chrome.fileManagerPrivate = {};
chrome.fileManagerPrivate.onFileTransfersUpdated = {
addListener: function() {}
};
chrome.syncFileSystem = {};
}
/**
* Installs stub APIs.
* Installs importer test logger.
*/
function installTestLogger() {
testLogger = new importer.TestLogger();
......@@ -441,24 +435,3 @@ var TestRecordStorage = function() {
return Promise.resolve();
};
};
/**
* Test implementation of SyncFileEntryProvider.
*
* @param {!FileEntry} fileEntry
* @constructor
* @final
* @struct
*/
var TestSyncFileEntryProvider = function(fileEntry) {
/** @private {!FileEntry} */
this.fileEntry_ = fileEntry;
/**
* @override
* @this {TestSyncFileEntryProvider}
*/
this.getSyncFileEntry = function() {
return Promise.resolve(this.fileEntry_);
};
};
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