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

Unified Diff: chrome/common/extensions/image_writer/image_writer_util_mac_unittest.cc

Issue 294163008: Adds USB writing for OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@list-devices
Patch Set: Creates a location for code shared between browser and utility process. Created 6 years, 6 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/common/extensions/image_writer/image_writer_util_mac_unittest.cc
diff --git a/chrome/common/extensions/image_writer/image_writer_util_mac_unittest.cc b/chrome/common/extensions/image_writer/image_writer_util_mac_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8b9f23f3ce4828a16fc4d6aa5a27230fdac0de2f
--- /dev/null
+++ b/chrome/common/extensions/image_writer/image_writer_util_mac_unittest.cc
@@ -0,0 +1,35 @@
+// 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/common/extensions/image_writer/image_writer_test_util_mac.h"
+#include "chrome/common/extensions/image_writer/image_writer_util_mac.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace extensions {
+namespace image_writer {
+
+namespace {
+
+class ImageWriterTestUtilsTest : public testing::Test {};
+
+} // namespace
+
+// Tests IsRemovableDevice.
+TEST_F(ImageWriterTestUtilsTest, DiskIsValidTarget) {
Robert Sesek 2014/06/10 19:47:46 You can just use TEST(ImageWriterTestUtilsTest, Di
Drew Haven 2014/06/12 02:24:26 Done.
+ base::ScopedCFTypeRef<CFDictionaryRef> fixed_disk = CreateDiskDictionary(
+ "disk0", "Fixed Vendor", "Fixed Model", (int64)1 << 40, DriveType::FIXED);
+ base::ScopedCFTypeRef<CFDictionaryRef> cd_drive =
+ CreateDiskDictionary("disk1", "CD Vendor", "CD Model", 0, DriveType::CD);
+ base::ScopedCFTypeRef<CFDictionaryRef> usb_stick = CreateDiskDictionary(
+ "disk2", "USB Vendor", "USB Model", (int64)1 << 32, DriveType::USB);
+ base::ScopedCFTypeRef<CFDictionaryRef> sd_card = CreateDiskDictionary(
+ "disk3", "SD Vendor", "SD Model", (int64)1 << 33, DriveType::SD);
+ ASSERT_FALSE(IsRemovableDevice(fixed_disk));
+ ASSERT_FALSE(IsRemovableDevice(cd_drive));
+ ASSERT_TRUE(IsRemovableDevice(usb_stick));
+ ASSERT_TRUE(IsRemovableDevice(sd_card));
+}
+
+} // image_writer
+} // extensions

Powered by Google App Engine
This is Rietveld 408576698