Chromium Code Reviews| Index: chrome/test/data/file_manager/unit_tests/device_handler_unittest.js |
| diff --git a/chrome/test/data/file_manager/unit_tests/device_handler_unittest.js b/chrome/test/data/file_manager/unit_tests/device_handler_unittest.js |
| index be06f80aebb0cc0ecc1fdbf940f9d53adf113e79..c232938817c85149e80e38b01f1fc6aed933f997 100644 |
| --- a/chrome/test/data/file_manager/unit_tests/device_handler_unittest.js |
| +++ b/chrome/test/data/file_manager/unit_tests/device_handler_unittest.js |
| @@ -101,11 +101,10 @@ function callTimeoutCallbacks() { |
| function registerTypicalDevice() { |
| chrome.fileBrowserPrivate.onDeviceChanged.dispatch({ |
| - type: 'added', |
| + type: 'scan_started', |
| devicePath: '/device/path' |
| }); |
| - assertFalse('device:/device/path' in chrome.notifications.items); |
| - callTimeoutCallbacks(); |
| + assertTrue('device:/device/path' in chrome.notifications.items); |
| assertEquals('Scanning...', |
| chrome.notifications.items['device:/device/path'].message); |
| } |
| @@ -119,7 +118,8 @@ function testGoodDevice() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(0, Object.keys(chrome.notifications.items).length); |
| } |
| @@ -134,7 +134,8 @@ function testGoodDeviceWithBadParent() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertFalse(!!chrome.notifications.items['device:/device/path']); |
| assertEquals( |
| @@ -148,7 +149,8 @@ function testGoodDeviceWithBadParent() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(0, Object.keys(chrome.notifications.items).length); |
| @@ -159,7 +161,8 @@ function testGoodDeviceWithBadParent() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| // Should do nothing this time. |
| assertEquals(0, Object.keys(chrome.notifications.items).length); |
| @@ -175,7 +178,8 @@ function testUnsupportedDevice() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertFalse(!!chrome.notifications.items['device:/device/path']); |
| assertEquals( |
| @@ -193,7 +197,8 @@ function testUnsupportedWithUnknownParent() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals( |
| 'DEVICE_UNKNOWN: label', |
| @@ -206,7 +211,8 @@ function testUnsupportedWithUnknownParent() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -224,7 +230,8 @@ function testMountPartialSuccess() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(0, Object.keys(chrome.notifications.items).length); |
| @@ -235,7 +242,8 @@ function testMountPartialSuccess() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -253,7 +261,8 @@ function testUnknown() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -272,7 +281,8 @@ function testNonASCIILabel() { |
| devicePath: '/device/path', |
| // "RA (U+30E9) BE (U+30D9) RU (U+30EB)" in Katakana letters. |
| deviceLabel: '\u30E9\u30D9\u30EB' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -291,7 +301,8 @@ function testMulitpleFail() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -306,7 +317,8 @@ function testMulitpleFail() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -321,7 +333,8 @@ function testMulitpleFail() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -337,7 +350,8 @@ function testMulitpleFail() { |
| deviceType: 'usb', |
| devicePath: '/device/path', |
| deviceLabel: 'label' |
| - } |
| + }, |
| + shouldNotify: true |
|
mtomasz
2014/08/26 02:49:43
nit: Do we have any unit test with shouldNotify =
hirono
2014/08/26 03:48:26
Done.
|
| }); |
| assertEquals(1, Object.keys(chrome.notifications.items).length); |
| assertEquals( |
| @@ -349,7 +363,7 @@ function testScanCanceled() { |
| registerTypicalDevice(); |
| chrome.fileBrowserPrivate.onDeviceChanged.dispatch({ |
| - type: 'scan_canceled', |
| + type: 'scan_cancelled', |
| devicePath: '/device/path' |
| }); |
| assertEquals(0, Object.keys(chrome.notifications.items).length); |