| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/files/file_util.h" | 5 #include "base/files/file_util.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 10 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void TearDown() override { | 92 void TearDown() override { |
| 93 // Ensure all callbacks have been destroyed and cleanup occurs. | 93 // Ensure all callbacks have been destroyed and cleanup occurs. |
| 94 operation_->Cancel(); | 94 operation_->Cancel(); |
| 95 | 95 |
| 96 ImageWriterUnitTestBase::TearDown(); | 96 ImageWriterUnitTestBase::TearDown(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 base::FilePath image_path_; | 99 base::FilePath image_path_; |
| 100 base::FilePath zip_file_; | 100 base::FilePath zip_file_; |
| 101 | 101 |
| 102 scoped_ptr<TestingProfile> profile_; | 102 std::unique_ptr<TestingProfile> profile_; |
| 103 | 103 |
| 104 MockOperationManager manager_; | 104 MockOperationManager manager_; |
| 105 scoped_refptr<OperationForTest> operation_; | 105 scoped_refptr<OperationForTest> operation_; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace | 108 } // namespace |
| 109 | 109 |
| 110 // Unizpping a non-zip should do nothing. | 110 // Unizpping a non-zip should do nothing. |
| 111 TEST_F(ImageWriterOperationTest, UnzipNonZipFile) { | 111 TEST_F(ImageWriterOperationTest, UnzipNonZipFile) { |
| 112 EXPECT_CALL(manager_, OnProgress(kDummyExtensionId, _, _)).Times(0); | 112 EXPECT_CALL(manager_, OnProgress(kDummyExtensionId, _, _)).Times(0); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 #endif | 261 #endif |
| 262 | 262 |
| 263 // Tests that on creation the operation_ has the expected state. | 263 // Tests that on creation the operation_ has the expected state. |
| 264 TEST_F(ImageWriterOperationTest, Creation) { | 264 TEST_F(ImageWriterOperationTest, Creation) { |
| 265 EXPECT_EQ(0, operation_->GetProgress()); | 265 EXPECT_EQ(0, operation_->GetProgress()); |
| 266 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, operation_->GetStage()); | 266 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, operation_->GetStage()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace image_writer | 269 } // namespace image_writer |
| 270 } // namespace extensions | 270 } // namespace extensions |
| OLD | NEW |