Commit 8acca942 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Minor code / comment fixes for drive_sync_handler_unittest

 - update the comments to match what the actually code does
 - check progress center item state like other unittests do

No change in test behavior.

Bug: 907964
Tbr: slangley
No-try: true
Change-Id: I8f307b699d5005cbdefe346d838088610c9f88cf
Reviewed-on: https://chromium-review.googlesource.com/c/1352072Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611065}
parent 2c2156f5
...@@ -118,7 +118,7 @@ function testUniqueErrorIds() { ...@@ -118,7 +118,7 @@ function testUniqueErrorIds() {
fileUrl: '', fileUrl: '',
}); });
// Check that this created second item. // Check that this created a second item.
assertEquals(2, progressCenter.getItemCount()); assertEquals(2, progressCenter.getItemCount());
} }
...@@ -139,7 +139,7 @@ function testErrorDedupe() { ...@@ -139,7 +139,7 @@ function testErrorDedupe() {
fileUrl: '', fileUrl: '',
}); });
// Check that this created second item. // Check that this did not create a second item.
assertEquals(1, progressCenter.getItemCount()); assertEquals(1, progressCenter.getItemCount());
} }
...@@ -157,14 +157,16 @@ function testOffline() { ...@@ -157,14 +157,16 @@ function testOffline() {
// Check that this created one item. // Check that this created one item.
assertEquals(1, progressCenter.getItemCount()); assertEquals(1, progressCenter.getItemCount());
assertEquals( var item = progressCenter.items['drive-sync'];
ProgressItemState.PROGRESSING, progressCenter.items['drive-sync'].state); assertEquals(ProgressItemState.PROGRESSING, item.state);
assertTrue(driveSyncHandler.syncing); assertTrue(driveSyncHandler.syncing);
// Go offline.
chrome.fileManagerPrivate.onDriveConnectionStatusChanged.listener_(); chrome.fileManagerPrivate.onDriveConnectionStatusChanged.listener_();
// Check that this item was cancelled.
assertEquals(1, progressCenter.getItemCount()); assertEquals(1, progressCenter.getItemCount());
assertEquals( item = progressCenter.items['drive-sync'];
ProgressItemState.CANCELED, progressCenter.items['drive-sync'].state); assertEquals(ProgressItemState.CANCELED, item.state);
assertFalse(driveSyncHandler.syncing); assertFalse(driveSyncHandler.syncing);
} }
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