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

Unified Diff: chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc

Issue 266363006: Adds API tests for listRemovableStorageDevices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleans up a few minor issues. Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8eff19db81a1e9c446cb9c4037d478aca7f92422
--- /dev/null
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/common/extensions/api/image_writer_private.h"
+
+namespace extensions {
+
+using api::image_writer_private::RemovableStorageDevice;
+
+class ImageWriterPrivateApiTest : public ExtensionApiTest {
+ public:
+ virtual void SetUp() OVERRIDE {
+ scoped_refptr<StorageDeviceList> device_list(new StorageDeviceList);
+
+ RemovableStorageDevice* expected1 = new RemovableStorageDevice();
+ expected1->vendor = "Vendor 1";
+ expected1->model = "Model 1";
+ expected1->capacity = 1 << 20;
+ expected1->storage_unit_id = "/test/id/1";
+
+ RemovableStorageDevice* expected2 = new RemovableStorageDevice();
+ expected2->vendor = "Vendor 2";
+ expected2->model = "Model 2";
+ expected2->capacity = 1 << 22;
+ expected2->storage_unit_id = "/test/id/2";
+
+ linked_ptr<RemovableStorageDevice> device1(expected1);
+ device_list->data.push_back(device1);
+ linked_ptr<RemovableStorageDevice> device2(expected2);
+ device_list->data.push_back(device2);
+
+ RemovableStorageProvider::SetDeviceListForTesting(device_list);
+ }
+
+ virtual void TearDown() OVERRIDE {
+ RemovableStorageProvider::ClearDeviceListForTesting();
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(ImageWriterPrivateApiTest, TestListDevices) {
+ ASSERT_TRUE(RunExtensionTest("image_writer_private/list_devices"));
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698