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

Unified Diff: chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes test cleanup ordering for Chrome OS. Created 6 years, 10 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
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/write_from_file_operation.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1cab40b619728286d8bca543eb77e5a108e14e0b..995b5863b1b41ad3cd9f04c7800408715fb1ddb0 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,7 +40,7 @@ TEST_F(ImageWriterFromFileTest, InvalidFile) {
base::RunLoop().RunUntilIdle();
}
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// Runs the entire WriteFromFile operation.
TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) {
MockOperationManager manager;
@@ -49,6 +49,10 @@ TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) {
kDummyExtensionId,
test_image_path_,
test_device_path_.AsUTF8Unsafe());
+#if !defined(OS_CHROMEOS)
+ scoped_refptr<FakeImageWriterClient> client = FakeImageWriterClient::Create();
+ op->SetUtilityClientForTesting(client);
+#endif
EXPECT_CALL(manager,
OnProgress(kDummyExtensionId, image_writer_api::STAGE_WRITE, _))
@@ -59,6 +63,9 @@ TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) {
EXPECT_CALL(manager,
OnProgress(kDummyExtensionId, image_writer_api::STAGE_WRITE, 100))
.Times(AtLeast(1));
+
+#if !defined(OS_CHROMEOS)
+ // Chrome OS doesn't verify.
EXPECT_CALL(
manager,
OnProgress(kDummyExtensionId, image_writer_api::STAGE_VERIFYWRITE, _))
@@ -71,16 +78,27 @@ TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) {
manager,
OnProgress(kDummyExtensionId, image_writer_api::STAGE_VERIFYWRITE, 100))
.Times(AtLeast(1));
+#endif
+
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_));
-}
+#if !defined(OS_CHROMEOS)
+ client->Progress(0);
+ client->Progress(50);
+ client->Progress(100);
+ client->Success();
+ base::RunLoop().RunUntilIdle();
+ client->Progress(0);
+ client->Progress(50);
+ client->Progress(100);
+ client->Success();
+ base::RunLoop().RunUntilIdle();
#endif
+}
} // namespace image_writer
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/write_from_file_operation.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698