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 "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 5 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
6 #include "chrome/browser/extensions/api/image_writer_private/operation.h" | 6 #include "chrome/browser/extensions/api/image_writer_private/operation.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 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 namespace image_writer { | 10 namespace image_writer { |
| 11 namespace { |
11 | 12 |
12 class ImageWriterOperationTest : public ImageWriterUnitTestBase { | 13 class ImageWriterOperationTest : public ImageWriterUnitTestBase { |
13 }; | 14 }; |
14 | 15 |
15 class DummyOperation : public Operation { | 16 class DummyOperation : public Operation { |
16 public: | 17 public: |
17 DummyOperation(base::WeakPtr<OperationManager> manager, | 18 DummyOperation(base::WeakPtr<OperationManager> manager, |
18 const ExtensionId& extension_id, | 19 const ExtensionId& extension_id, |
19 const std::string& storage_unit_id) | 20 const std::string& storage_unit_id) |
20 : Operation(manager, extension_id, storage_unit_id) {}; | 21 : Operation(manager, extension_id, storage_unit_id) {}; |
21 virtual void Start() OVERRIDE {}; | 22 virtual void Start() OVERRIDE {}; |
22 private: | 23 private: |
23 virtual ~DummyOperation() {}; | 24 virtual ~DummyOperation() {}; |
24 }; | 25 }; |
25 | 26 |
26 TEST_F(ImageWriterOperationTest, Create) { | 27 TEST_F(ImageWriterOperationTest, Create) { |
27 MockOperationManager manager; | 28 MockOperationManager manager; |
28 scoped_refptr<Operation> op(new DummyOperation(manager.AsWeakPtr(), | 29 scoped_refptr<Operation> op( |
29 kDummyExtensionId, | 30 new DummyOperation(manager.AsWeakPtr(), |
30 test_device_.AsUTF8Unsafe())); | 31 kDummyExtensionId, |
| 32 test_device_path_.AsUTF8Unsafe())); |
31 | 33 |
32 EXPECT_EQ(0, op->GetProgress()); | 34 EXPECT_EQ(0, op->GetProgress()); |
33 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, op->GetStage()); | 35 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, op->GetStage()); |
34 } | 36 } |
35 | 37 |
| 38 } // namespace |
36 } // namespace image_writer | 39 } // namespace image_writer |
37 } // namespace extensions | 40 } // namespace extensions |
OLD | NEW |