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

Unified Diff: chrome/browser/extensions/extension_path_util_unittest.cc

Issue 439873002: Check for empty paths in path_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Testing comments Created 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/path_util.h » ('j') | chrome/browser/extensions/path_util.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_path_util_unittest.cc
diff --git a/chrome/browser/extensions/extension_path_util_unittest.cc b/chrome/browser/extensions/extension_path_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fa07a8017deaeb7033a9862b13e2d7bcd7c73748
--- /dev/null
+++ b/chrome/browser/extensions/extension_path_util_unittest.cc
@@ -0,0 +1,39 @@
+// 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/path_util.h"
+
+#include "base/file_util.h"
+#include "base/files/file_path.h"
+#include "chrome/test/base/testing_profile.h"
Devlin 2014/08/05 23:40:35 ??
gpdavis 2014/08/06 18:37:25 Oops-- I migrated the includes from another file,
+#include "testing/gtest/include/gtest/gtest.h"
+
+using base::FilePath;
+
+namespace extensions {
+
+// Basic unittests for path_util::PrettifyPath.
+// For legacy reasons, it's tested more in:
Devlin 2014/08/05 23:40:35 nit: remove the colon and the indentation.
gpdavis 2014/08/06 18:37:25 Done.
+// FileSystemApiTest.FileSystemApiGetDisplayPathPrettify
+class ExtensionPathUtilTest : public testing::Test {
Devlin 2014/08/05 23:40:35 This doesn't do anything. Just do TEST(ExtensionP
gpdavis 2014/08/06 18:37:26 Done.
+};
+
+namespace {
Devlin 2014/08/05 23:40:35 We don't need to put these tests in their own name
gpdavis 2014/08/06 18:37:26 Done.
+
+TEST_F(ExtensionPathUtilTest, EmptyPath) {
+ FilePath empty_path;
+ FilePath prettified = path_util::PrettifyPath(empty_path);
+
+ ASSERT_TRUE(prettified.empty());
+}
+
+TEST_F(ExtensionPathUtilTest, HomeDirectory) {
Devlin 2014/08/05 23:40:35 Rename this to be "BasicPrettifyPathTest" or somet
gpdavis 2014/08/06 18:37:26 Done.
+ FilePath home = base::GetHomeDir();
+ FilePath prettified = path_util::PrettifyPath(home.AppendASCII("foo"));
+ ASSERT_EQ(FilePath(FILE_PATH_LITERAL("~")).AppendASCII("foo"), prettified);
Devlin 2014/08/05 23:40:35 This is a little condensed for readability in a te
gpdavis 2014/08/06 18:37:25 Done.
+}
+
+} // namespace
+
+} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/path_util.h » ('j') | chrome/browser/extensions/path_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698