Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(820)

Unified Diff: ui/file_manager/file_manager/common/js/importer_common_unittest.js

Issue 886483004: Include a machine id in log files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review comments. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/common/js/importer_common_unittest.js
diff --git a/ui/file_manager/file_manager/common/js/importer_common_unittest.js b/ui/file_manager/file_manager/common/js/importer_common_unittest.js
index d61067d28997de8d947342ec896464a07e11e1bb..33a8f80268a5c1bc2f42bfce70f7b6a69abafae5 100644
--- a/ui/file_manager/file_manager/common/js/importer_common_unittest.js
+++ b/ui/file_manager/file_manager/common/js/importer_common_unittest.js
@@ -23,13 +23,14 @@ var sdFileEntry;
/** @type {!MockFileEntry} */
var driveFileEntry;
+// Sadly, boilerplate setup necessary to include test support classes.
+loadTimeData.data = {
+ DRIVE_DIRECTORY_LABEL: 'My Drive',
+ DOWNLOADS_DIRECTORY_LABEL: 'Downloads'
+};
+
// Set up the test components.
function setUp() {
- // Sadly, boilerplate setup necessary to include test support classes.
- loadTimeData.data = {
- DRIVE_DIRECTORY_LABEL: 'My Drive',
- DOWNLOADS_DIRECTORY_LABEL: 'Downloads'
- };
var cameraFileSystem = new MockFileSystem(
'camera-fs', 'filesystem:camera-123');
var sdFileSystem = new MockFileSystem(
@@ -103,6 +104,35 @@ function testResolver_Reject(callback) {
});
}
+function testGetMachineId(callback) {
+ var storage = new MockChromeStorageAPI();
+
+ var promise = importer.getMachineId().then(
+ function(firstMachineId) {
+ assertTrue(100000 <= firstMachineId <= 9999999);
+ importer.getMachineId().then(
+ function(secondMachineId) {
+ assertEquals(firstMachineId, secondMachineId);
+ });
+ });
+ reportPromise(promise, callback);
+}
+
+function testHistoryFilename(callback) {
+ var storage = new MockChromeStorageAPI();
+
+ var promise = importer.getHistoryFilename().then(
+ function(firstName) {
+ assertTrue(!!firstName && firstName.length > 10);
+ importer.getHistoryFilename().then(
+ function(secondName) {
+ assertEquals(firstName, secondName);
+ });
+ });
+
+ reportPromise(promise, callback);
+}
+
/** @param {string} path */
function assertIsMediaDir(path) {
var dir = createDirectoryEntry(sdVolume, path);
« no previous file with comments | « ui/file_manager/file_manager/common/js/importer_common.js ('k') | ui/file_manager/file_manager/common/js/unittest_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698