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

Unified Diff: chrome/browser/local_discovery/storage/path_util_unittest.cc

Issue 141703022: Support for file listing in privet local filesystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/local_discovery/storage/path_util_unittest.cc
diff --git a/chrome/browser/local_discovery/storage/path_util_unittest.cc b/chrome/browser/local_discovery/storage/path_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cc1cf7239355c46abcffe756f5016b1fe2fb17b1
--- /dev/null
+++ b/chrome/browser/local_discovery/storage/path_util_unittest.cc
@@ -0,0 +1,26 @@
+// 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/local_discovery/storage/path_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace local_discovery {
+
+TEST(PathUtilTest, ParsePrivetPath) {
+ ParsedPrivetPath path(base::FilePath(FILE_PATH_LITERAL(
+ "/privet/MyId._privet._tcp.local/Some name/some/path")));
+
+ EXPECT_EQ("MyId._privet._tcp.local", path.service_name);
+ EXPECT_EQ("/some/path", path.path);
+}
+
+TEST(PathUtilTest, ParseEmptyPath) {
+ ParsedPrivetPath path(base::FilePath(FILE_PATH_LITERAL(
+ "/privet/MyId._privet._tcp.local/Some name/")));
+
+ EXPECT_EQ("MyId._privet._tcp.local", path.service_name);
+ EXPECT_EQ("/", path.path);
+}
+
+} // namespace local_discovery

Powered by Google App Engine
This is Rietveld 408576698