OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 base::FilePath result( | 64 base::FilePath result( |
65 web_app::GetWebAppDataDirectory(profile_path, "123", GURL())); | 65 web_app::GetWebAppDataDirectory(profile_path, "123", GURL())); |
66 base::FilePath expected = profile_path.AppendASCII("Web Applications") | 66 base::FilePath expected = profile_path.AppendASCII("Web Applications") |
67 .AppendASCII("_crx_123"); | 67 .AppendASCII("_crx_123"); |
68 EXPECT_EQ(expected, result); | 68 EXPECT_EQ(expected, result); |
69 } | 69 } |
70 | 70 |
71 TEST_F(WebApplicationTest, AppDirWithUrl) { | 71 TEST_F(WebApplicationTest, AppDirWithUrl) { |
72 base::FilePath profile_path(FILE_PATH_LITERAL("profile")); | 72 base::FilePath profile_path(FILE_PATH_LITERAL("profile")); |
73 base::FilePath result(web_app::GetWebAppDataDirectory( | 73 base::FilePath result(web_app::GetWebAppDataDirectory( |
74 profile_path, "", GURL("http://example.com"))); | 74 profile_path, std::string(), GURL("http://example.com"))); |
75 base::FilePath expected = profile_path.AppendASCII("Web Applications") | 75 base::FilePath expected = profile_path.AppendASCII("Web Applications") |
76 .AppendASCII("example.com") | 76 .AppendASCII("example.com").AppendASCII("http_80"); |
77 .AppendASCII("http_80"); | |
78 EXPECT_EQ(expected, result); | 77 EXPECT_EQ(expected, result); |
79 } | 78 } |
OLD | NEW |