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 0d6ba8476e1d055bef5b62ff50c04b22cd9dd6bd..48bf3a33c37033d93b27bc5218842b5fd856a38e 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 |
@@ -67,6 +67,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), |
@@ -86,6 +92,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_; |
@@ -111,6 +121,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(); |
} |
@@ -127,6 +146,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(); |
} |