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

Unified Diff: chrome/browser/web_applications/web_app_unittest.cc

Issue 9423048: Add user data dir field to Mac platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 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/web_applications/web_app_unittest.cc
diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc
index 73f8a884a4a99094b1043e22c03dca2dc24d1502..58587519607b2fc8de61d6a651a9d7425cdd4d02 100644
--- a/chrome/browser/web_applications/web_app_unittest.cc
+++ b/chrome/browser/web_applications/web_app_unittest.cc
@@ -44,9 +44,20 @@ TEST_F(WebApplicationTest, GetShortcutInfoForTab) {
EXPECT_EQ(url, info.url);
}
-TEST_F(WebApplicationTest, GetDataDir) {
- FilePath test_path(FILE_PATH_LITERAL("/path/to/test"));
- FilePath result = web_app::GetDataDir(test_path);
- test_path = test_path.AppendASCII("Web Applications");
- EXPECT_EQ(test_path.value(), result.value());
+TEST_F(WebApplicationTest, AppDirWithID) {
Mihai Parparita -not on Chrome 2012/02/22 23:24:15 Nit: This should be called AppDirWithId.
sail 2012/02/22 23:38:48 Done.
+ FilePath profile_path(FILE_PATH_LITERAL("profile"));
+ FilePath result(web_app::GetWebAppDataDirectory(profile_path, "123", GURL()));
+ FilePath expected = profile_path.AppendASCII("Web Applications")
+ .AppendASCII("_crx_123");
+ EXPECT_EQ(expected, result);
+}
+
+TEST_F(WebApplicationTest, AppDirWithURL) {
Mihai Parparita -not on Chrome 2012/02/22 23:24:15 Ditto about AppDirWithUrl.
sail 2012/02/22 23:38:48 Done.
+ FilePath profile_path(FILE_PATH_LITERAL("profile"));
+ FilePath result(web_app::GetWebAppDataDirectory(
+ profile_path, "", GURL("http://example.com")));
+ FilePath expected = profile_path.AppendASCII("Web Applications")
+ .AppendASCII("example.com")
+ .AppendASCII("http_80");
+ EXPECT_EQ(expected, result);
}

Powered by Google App Engine
This is Rietveld 408576698