Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation_unittest.cc

Issue 109793006: Adds ImageWriterPrivate.destroyPartitions operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11
12 class ImageWriterOperationTest : public ImageWriterUnitTestBase { 12 class ImageWriterOperationTest : public ImageWriterUnitTestBase {
13 }; 13 };
14 14
15 class DummyOperation : public Operation { 15 class DummyOperation : public Operation {
16 public: 16 public:
17 DummyOperation(base::WeakPtr<OperationManager> manager, 17 DummyOperation(base::WeakPtr<OperationManager> manager,
18 const ExtensionId& extension_id, 18 const ExtensionId& extension_id,
19 const std::string& storage_unit_id) 19 const std::string& storage_unit_id)
20 : Operation(manager, extension_id, storage_unit_id) {}; 20 : Operation(manager, extension_id, storage_unit_id) {};
21 virtual void Start() OVERRIDE {}; 21 virtual void Start() OVERRIDE {};
22 private: 22 private:
23 virtual ~DummyOperation() {}; 23 virtual ~DummyOperation() {};
24 }; 24 };
25 25
26 TEST_F(ImageWriterOperationTest, Create) { 26 TEST_F(ImageWriterOperationTest, Create) {
27 MockOperationManager manager; 27 MockOperationManager manager;
28 scoped_refptr<Operation> op(new DummyOperation(manager.AsWeakPtr(), 28 scoped_refptr<Operation> op(
29 kDummyExtensionId, 29 new DummyOperation(manager.AsWeakPtr(),
30 test_device_.AsUTF8Unsafe())); 30 kDummyExtensionId,
31 test_device_path_.AsUTF8Unsafe()));
31 32
32 EXPECT_EQ(0, op->GetProgress()); 33 EXPECT_EQ(0, op->GetProgress());
33 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, op->GetStage()); 34 EXPECT_EQ(image_writer_api::STAGE_UNKNOWN, op->GetStage());
34 } 35 }
35 36
36 } // namespace image_writer 37 } // namespace image_writer
37 } // namespace extensions 38 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698