Commit b970401f authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Clean-up import_history_unittest.js

To prepare for closure compilation of this unit_test file, clean-up to
make upcoming closure changes easier to understand.

  - update and fix obvious closure @type errors, etc
  - remove '|undefined' from variables new-ed in Setup()
  - define undefined variables, remove unused variables
  - importer.SyncFileEntryProvider is not defined in Files
    app, nor in the code-base or the web: remove it.

No change in test behavior, no new tests.

Bug: 905934
Change-Id: Idab68cc2257286e2278cdce361a84fc2176c51cc
Reviewed-on: https://chromium-review.googlesource.com/c/1345690
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609983}
parent 01b3033e
......@@ -5,37 +5,37 @@
/** @const {string} */
var FILE_LAST_MODIFIED = new Date("Dec 4 1968").toString();
/** @const {string} */
/** @const {number} */
var FILE_SIZE = 1234;
/** @const {string} */
var FILE_PATH = 'test/data';
/** @const {string} */
var DEVICE = importer.Destination.DEVICE;
/** @const {number} */
var TEMPORARY = window.TEMPORARY || 0;
/** @const {string} */
/** @const {!importer.Destination<string>} */
var GOOGLE_DRIVE = importer.Destination.GOOGLE_DRIVE;
/**
* Space Cloud: Your source for interstellar cloud storage.
* @const {string}
* @const {!importer.Destination<string>}
*/
var SPACE_CAMP = 'Space Camp';
var SPACE_CAMP = /** @type !importer.Destination<string> */ ('Space Camp');
/** @type {!MockFileSystem|undefined} */
/** @type {!MockFileSystem} */
var testFileSystem;
/** @type {!MockFileEntry|undefined} */
/** @type {!MockFileEntry} */
var testFileEntry;
/** @type {!importer.TestLogger} */
var testLogger;
/** @type {!importer.RecordStorage|undefined} */
/** @type {!importer.RecordStorage} */
var storage;
/** @type {!Promise<!importer.PersistentImportHistory>|undefined} */
/** @type {!Promise<!importer.ImportHistory>} */
var historyProvider;
/** @type {Promise} */
......@@ -47,12 +47,14 @@ function setUp() {
installTestLogger();
testFileSystem = new MockFileSystem('abc-123', 'filesystem:abc-123');
testFileEntry = new MockFileEntry(
testFileSystem,
FILE_PATH, {
testFileSystem, FILE_PATH,
/** @type Metadata */ ({
size: FILE_SIZE,
modificationTime: FILE_LAST_MODIFIED
});
}));
testFileSystem.entries[FILE_PATH] = testFileEntry;
storage = new TestRecordStorage();
......@@ -406,9 +408,8 @@ function createFileEntry(fileName) {
* @struct
*/
var TestRecordStorage = function() {
var timeStamp = importer.toSecondsFromEpoch(FILE_LAST_MODIFIED);
var timeStamp = importer.toSecondsFromEpoch(
FILE_LAST_MODIFIED);
// Pre-populate the store with some "previously written" data <wink>.
/** @private {!Array<!Array<string>>} */
this.records_ = [
......@@ -444,12 +445,10 @@ var TestRecordStorage = function() {
/**
* Test implementation of SyncFileEntryProvider.
*
* @param {!FileEntry} fileEntry
* @constructor
* @implements {importer.SyncFileEntryProvider}
* @final
* @struct
*
* @param {!FileEntry} fileEntry
*/
var TestSyncFileEntryProvider = function(fileEntry) {
/** @private {!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