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

Unified Diff: chrome/browser/media_gallery/media_storage_util_unittest.cc

Issue 10869067: Deliver attach intent to packaged apps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Allowed file contents to actually be read Created 8 years, 4 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/media_gallery/media_storage_util_unittest.cc
diff --git a/chrome/browser/media_gallery/media_storage_util_unittest.cc b/chrome/browser/media_gallery/media_storage_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dd81e4f21130983568748d63b7db7297ac4d3e81
--- /dev/null
+++ b/chrome/browser/media_gallery/media_storage_util_unittest.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 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 <string>
+
+#include "chrome/browser/media_gallery/media_storage_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chrome {
+
+class MediaStorageUtilTest : public testing::Test {
+ public:
+ MediaStorageUtilTest() {}
+};
+
+TEST_F(MediaStorageUtilTest, DeviceId) {
James Hawkins 2012/08/29 22:46:51 nit: Document what this is testing.
thorogood 2012/08/30 01:36:28 Thanks, although someone else went and wrote this
+ std::string unique_id = "uniqueId_abcdef";
+ MediaStorageUtil::Type type = MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM;
+
+ std::string device_id = MediaStorageUtil::MakeDeviceId(type, unique_id);
+ ASSERT_TRUE(MediaStorageUtil::IsMediaDevice(device_id));
James Hawkins 2012/08/29 22:46:51 All of these should be EXPECT_TRUE.
thorogood 2012/08/30 01:36:28 I'm no longer touching this file.
+ ASSERT_TRUE(MediaStorageUtil::IsRemovableDevice(device_id));
+
+ ASSERT_TRUE(MediaStorageUtil::CrackDeviceId("mtp:fake", &type, &unique_id));
+ ASSERT_EQ(MediaStorageUtil::USB_MTP, type);
+ ASSERT_EQ("fake", unique_id);
+}
+
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698