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 @@ ...@@ -5,37 +5,37 @@
/** @const {string} */ /** @const {string} */
var FILE_LAST_MODIFIED = new Date("Dec 4 1968").toString(); var FILE_LAST_MODIFIED = new Date("Dec 4 1968").toString();
/** @const {string} */ /** @const {number} */
var FILE_SIZE = 1234; var FILE_SIZE = 1234;
/** @const {string} */ /** @const {string} */
var FILE_PATH = 'test/data'; var FILE_PATH = 'test/data';
/** @const {string} */ /** @const {number} */
var DEVICE = importer.Destination.DEVICE; var TEMPORARY = window.TEMPORARY || 0;
/** @const {string} */ /** @const {!importer.Destination<string>} */
var GOOGLE_DRIVE = importer.Destination.GOOGLE_DRIVE; var GOOGLE_DRIVE = importer.Destination.GOOGLE_DRIVE;
/** /**
* Space Cloud: Your source for interstellar cloud storage. * 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; var testFileSystem;
/** @type {!MockFileEntry|undefined} */ /** @type {!MockFileEntry} */
var testFileEntry; var testFileEntry;
/** @type {!importer.TestLogger} */ /** @type {!importer.TestLogger} */
var testLogger; var testLogger;
/** @type {!importer.RecordStorage|undefined} */ /** @type {!importer.RecordStorage} */
var storage; var storage;
/** @type {!Promise<!importer.PersistentImportHistory>|undefined} */ /** @type {!Promise<!importer.ImportHistory>} */
var historyProvider; var historyProvider;
/** @type {Promise} */ /** @type {Promise} */
...@@ -47,12 +47,14 @@ function setUp() { ...@@ -47,12 +47,14 @@ function setUp() {
installTestLogger(); installTestLogger();
testFileSystem = new MockFileSystem('abc-123', 'filesystem:abc-123'); testFileSystem = new MockFileSystem('abc-123', 'filesystem:abc-123');
testFileEntry = new MockFileEntry( testFileEntry = new MockFileEntry(
testFileSystem, testFileSystem, FILE_PATH,
FILE_PATH, { /** @type Metadata */ ({
size: FILE_SIZE, size: FILE_SIZE,
modificationTime: FILE_LAST_MODIFIED modificationTime: FILE_LAST_MODIFIED
}); }));
testFileSystem.entries[FILE_PATH] = testFileEntry; testFileSystem.entries[FILE_PATH] = testFileEntry;
storage = new TestRecordStorage(); storage = new TestRecordStorage();
...@@ -406,9 +408,8 @@ function createFileEntry(fileName) { ...@@ -406,9 +408,8 @@ function createFileEntry(fileName) {
* @struct * @struct
*/ */
var TestRecordStorage = function() { 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>. // Pre-populate the store with some "previously written" data <wink>.
/** @private {!Array<!Array<string>>} */ /** @private {!Array<!Array<string>>} */
this.records_ = [ this.records_ = [
...@@ -444,12 +445,10 @@ var TestRecordStorage = function() { ...@@ -444,12 +445,10 @@ var TestRecordStorage = function() {
/** /**
* Test implementation of SyncFileEntryProvider. * Test implementation of SyncFileEntryProvider.
* *
* @param {!FileEntry} fileEntry
* @constructor * @constructor
* @implements {importer.SyncFileEntryProvider}
* @final * @final
* @struct * @struct
*
* @param {!FileEntry} fileEntry
*/ */
var TestSyncFileEntryProvider = function(fileEntry) { var TestSyncFileEntryProvider = function(fileEntry) {
/** @private {!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