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

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

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback. 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
Index: chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc b/chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc
index ca4c59be626eb5874f9256c78a02995dd7277433..4a5ccf70b5869b44760c52d15a1556c2cbf09e83 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc
@@ -68,6 +68,12 @@ class ImageWriterOperationManagerTest
start_error_ = error;
}
+ void CancelCallback(bool success, const std::string& error) {
+ cancelled_ = true;
+ cancel_success_ = true;
+ cancel_error_ = error;
+ }
+
protected:
ImageWriterOperationManagerTest()
: started_(false),
@@ -87,6 +93,10 @@ class ImageWriterOperationManagerTest
bool start_success_;
std::string start_error_;
+ bool cancelled_;
+ bool cancel_success_;
+ std::string cancel_error_;
+
TestingProfile test_profile_;
FakeExtensionSystem* extension_system_;
FakeEventRouter* event_router_;
@@ -112,6 +122,15 @@ TEST_F(ImageWriterOperationManagerTest, WriteFromFile) {
EXPECT_TRUE(start_success_);
EXPECT_EQ("", start_error_);
+ manager.CancelWrite(
+ kDummyExtensionId,
+ base::Bind(&ImageWriterOperationManagerTest::CancelCallback,
+ base::Unretained(this)));
+
+ EXPECT_TRUE(cancelled_);
+ EXPECT_TRUE(cancel_success_);
+ EXPECT_EQ("", cancel_error_);
+
base::RunLoop().RunUntilIdle();
}
@@ -128,6 +147,15 @@ TEST_F(ImageWriterOperationManagerTest, DestroyPartitions) {
EXPECT_TRUE(start_success_);
EXPECT_EQ("", start_error_);
+ manager.CancelWrite(
+ kDummyExtensionId,
+ base::Bind(&ImageWriterOperationManagerTest::CancelCallback,
+ base::Unretained(this)));
+
+ EXPECT_TRUE(cancelled_);
+ EXPECT_TRUE(cancel_success_);
+ EXPECT_EQ("", cancel_error_);
+
base::RunLoop().RunUntilIdle();
}

Powered by Google App Engine
This is Rietveld 408576698