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

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: fix build 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
« no previous file with comments | « chrome/browser/web_applications/web_app_mac_unittest.mm ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f41ac0d5da7cacd08d335f0e6407f7ddaa9f6ed3 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) {
+ 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) {
+ 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);
}
« no previous file with comments | « chrome/browser/web_applications/web_app_mac_unittest.mm ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698