OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_
operation.h" | 6 #include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_
operation.h" |
7 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 7 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
8 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" |
| 9 #include "chrome/test/base/testing_profile.h" |
9 | 10 |
10 namespace extensions { | 11 namespace extensions { |
11 namespace image_writer { | 12 namespace image_writer { |
12 namespace { | 13 namespace { |
13 | 14 |
14 using testing::_; | 15 using testing::_; |
15 using testing::AnyNumber; | 16 using testing::AnyNumber; |
16 using testing::AtLeast; | 17 using testing::AtLeast; |
17 | 18 |
18 class ImageWriterDestroyPartitionsOperationTest | 19 class ImageWriterDestroyPartitionsOperationTest |
19 : public ImageWriterUnitTestBase {}; | 20 : public ImageWriterUnitTestBase {}; |
20 | 21 |
21 TEST_F(ImageWriterDestroyPartitionsOperationTest, EndToEnd) { | 22 TEST_F(ImageWriterDestroyPartitionsOperationTest, EndToEnd) { |
22 MockOperationManager manager; | 23 TestingProfile profile; |
| 24 MockOperationManager manager(&profile); |
23 scoped_refptr<FakeImageWriterClient> client = FakeImageWriterClient::Create(); | 25 scoped_refptr<FakeImageWriterClient> client = FakeImageWriterClient::Create(); |
24 | 26 |
25 scoped_refptr<DestroyPartitionsOperation> operation( | 27 scoped_refptr<DestroyPartitionsOperation> operation( |
26 new DestroyPartitionsOperation(manager.AsWeakPtr(), | 28 new DestroyPartitionsOperation(manager.AsWeakPtr(), |
27 kDummyExtensionId, | 29 kDummyExtensionId, |
28 test_device_path_.AsUTF8Unsafe())); | 30 test_device_path_.AsUTF8Unsafe())); |
29 | 31 |
30 #if !defined(OS_CHROMEOS) | 32 #if !defined(OS_CHROMEOS) |
31 operation->SetUtilityClientForTesting(client); | 33 operation->SetUtilityClientForTesting(client); |
32 #endif | 34 #endif |
(...skipping 24 matching lines...) Expand all Loading... |
57 client->Progress(100); | 59 client->Progress(100); |
58 client->Success(); | 60 client->Success(); |
59 | 61 |
60 base::RunLoop().RunUntilIdle(); | 62 base::RunLoop().RunUntilIdle(); |
61 #endif | 63 #endif |
62 } | 64 } |
63 | 65 |
64 } // namespace | 66 } // namespace |
65 } // namespace image_writer | 67 } // namespace image_writer |
66 } // namespace extensions | 68 } // namespace extensions |
OLD | NEW |