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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 6 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
7 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" | 7 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" |
8 #include "chrome/browser/extensions/api/image_writer_private/write_from_file_ope
ration.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/write_from_file_ope
ration.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 namespace image_writer { | 12 namespace image_writer { |
13 | 13 |
14 using testing::_; | 14 using testing::_; |
15 using testing::Lt; | 15 using testing::Lt; |
16 using testing::AnyNumber; | 16 using testing::AnyNumber; |
17 using testing::AtLeast; | 17 using testing::AtLeast; |
18 | 18 |
19 class ImageWriterFromFileTest : public ImageWriterUnitTestBase { | 19 class ImageWriterFromFileTest : public ImageWriterUnitTestBase { |
20 protected: | 20 protected: |
21 ImageWriterFromFileTest() | 21 ImageWriterFromFileTest() |
22 : profile_(new TestingProfile), manager_(profile_.get()) {} | 22 : profile_(new TestingProfile), manager_(profile_.get()) {} |
23 scoped_ptr<TestingProfile> profile_; | 23 std::unique_ptr<TestingProfile> profile_; |
24 MockOperationManager manager_; | 24 MockOperationManager manager_; |
25 }; | 25 }; |
26 | 26 |
27 TEST_F(ImageWriterFromFileTest, InvalidFile) { | 27 TEST_F(ImageWriterFromFileTest, InvalidFile) { |
28 scoped_refptr<WriteFromFileOperation> op = | 28 scoped_refptr<WriteFromFileOperation> op = |
29 new WriteFromFileOperation(manager_.AsWeakPtr(), | 29 new WriteFromFileOperation(manager_.AsWeakPtr(), |
30 kDummyExtensionId, | 30 kDummyExtensionId, |
31 test_utils_.GetImagePath(), | 31 test_utils_.GetImagePath(), |
32 test_utils_.GetDevicePath().AsUTF8Unsafe()); | 32 test_utils_.GetDevicePath().AsUTF8Unsafe()); |
33 | 33 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 test_utils_.GetUtilityClient()->Progress(0); | 94 test_utils_.GetUtilityClient()->Progress(0); |
95 test_utils_.GetUtilityClient()->Progress(50); | 95 test_utils_.GetUtilityClient()->Progress(50); |
96 test_utils_.GetUtilityClient()->Progress(100); | 96 test_utils_.GetUtilityClient()->Progress(100); |
97 test_utils_.GetUtilityClient()->Success(); | 97 test_utils_.GetUtilityClient()->Success(); |
98 base::RunLoop().RunUntilIdle(); | 98 base::RunLoop().RunUntilIdle(); |
99 #endif | 99 #endif |
100 } | 100 } |
101 | 101 |
102 } // namespace image_writer | 102 } // namespace image_writer |
103 } // namespace extensions | 103 } // namespace extensions |
OLD | NEW |