OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_p
rovider.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/common/extensions/api/image_writer_private.h" |
| 8 |
| 9 namespace extensions { |
| 10 |
| 11 using api::image_writer_private::RemovableStorageDevice; |
| 12 |
| 13 class ImageWriterPrivateApiTest : public ExtensionApiTest { |
| 14 public: |
| 15 virtual void SetUpOnMainThread() OVERRIDE { |
| 16 scoped_refptr<StorageDeviceList> device_list(new StorageDeviceList); |
| 17 |
| 18 RemovableStorageDevice* expected1 = new RemovableStorageDevice(); |
| 19 expected1->vendor = "Vendor 1"; |
| 20 expected1->model = "Model 1"; |
| 21 expected1->capacity = 1 << 20; |
| 22 expected1->storage_unit_id = "/test/id/1"; |
| 23 |
| 24 RemovableStorageDevice* expected2 = new RemovableStorageDevice(); |
| 25 expected2->vendor = "Vendor 2"; |
| 26 expected2->model = "Model 2"; |
| 27 expected2->capacity = 1 << 22; |
| 28 expected2->storage_unit_id = "/test/id/2"; |
| 29 |
| 30 linked_ptr<RemovableStorageDevice> device1(expected1); |
| 31 device_list->data.push_back(device1); |
| 32 linked_ptr<RemovableStorageDevice> device2(expected2); |
| 33 device_list->data.push_back(device2); |
| 34 |
| 35 RemovableStorageProvider::SetDeviceListForTesting(device_list); |
| 36 } |
| 37 |
| 38 virtual void CleanUpOnMainThread() OVERRIDE { |
| 39 RemovableStorageProvider::ClearDeviceListForTesting(); |
| 40 } |
| 41 }; |
| 42 |
| 43 IN_PROC_BROWSER_TEST_F(ImageWriterPrivateApiTest, TestListDevices) { |
| 44 ASSERT_TRUE(RunExtensionTest("image_writer_private/list_devices")) |
| 45 << message_; |
| 46 } |
| 47 |
| 48 } // namespace extensions |
OLD | NEW |