Chromium Code Reviews| Index: chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc |
| diff --git a/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc |
| index 223d731e6fddee31cce3b21145d897732ba6f240..c3c85cc5621d205dd7ad58f8118cf9f59744f127 100644 |
| --- a/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc |
| +++ b/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc |
| @@ -40,5 +40,42 @@ TEST_F(ImageWriterFromFileTest, InvalidFile) { |
| base::RunLoop().RunUntilIdle(); |
| } |
| +TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) { |
| + MockOperationManager manager; |
| + |
| + scoped_refptr<WriteFromFileOperation> op = new WriteFromFileOperation( |
| + manager.AsWeakPtr(), |
| + kDummyExtensionId, |
| + test_image_path_, |
| + test_device_path_.AsUTF8Unsafe()); |
| + |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
|
tbarzic
2014/02/07 22:06:42
suggestion for formatting:
EXPECT_CALL(
manage
Drew Haven
2014/02/11 00:50:15
I just discovered "git cl format"! It does this au
|
| + image_writer_api::STAGE_WRITE, |
| + _)).Times(AnyNumber()); |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
| + image_writer_api::STAGE_WRITE, |
| + 0)).Times(AtLeast(1)); |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
| + image_writer_api::STAGE_WRITE, |
| + 100)).Times(AtLeast(1)); |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
| + image_writer_api::STAGE_VERIFYWRITE, |
| + _)).Times(AnyNumber()); |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
| + image_writer_api::STAGE_VERIFYWRITE, |
| + 0)).Times(AtLeast(1)); |
| + EXPECT_CALL(manager, OnProgress(kDummyExtensionId, |
| + image_writer_api::STAGE_VERIFYWRITE, |
| + 100)).Times(AtLeast(1)); |
| + EXPECT_CALL(manager, OnComplete(kDummyExtensionId)).Times(1); |
| + EXPECT_CALL(manager, OnError(kDummyExtensionId, _, _, _)).Times(0); |
| + |
| + op->Start(); |
| + |
| + base::RunLoop().RunUntilIdle(); |
| + |
| + EXPECT_TRUE(base::ContentsEqual(test_image_path_, test_device_path_)); |
| +} |
| + |
| } // namespace image_writer |
| } // namespace extensions |