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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/web_applications/web_app.h" | 11 #include "chrome/browser/web_applications/web_app.h" |
12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
14 #include "content/public/test/test_renderer_host.h" | 14 #include "content/public/test/test_renderer_host.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 #if defined(TOOLKIT_VIEWS) | 17 #if defined(TOOLKIT_VIEWS) |
18 #include "chrome/browser/extensions/tab_helper.h" | 18 #include "chrome/browser/extensions/tab_helper.h" |
19 #include "chrome/browser/favicon/favicon_helper.h" | 19 #include "chrome/browser/favicon/favicon_utils.h" |
20 #endif | 20 #endif |
21 | 21 |
22 using content::RenderViewHostTester; | 22 using content::RenderViewHostTester; |
23 | 23 |
24 class WebApplicationTest : public ChromeRenderViewHostTestHarness { | 24 class WebApplicationTest : public ChromeRenderViewHostTestHarness { |
25 protected: | 25 protected: |
26 void SetUp() override { | 26 void SetUp() override { |
27 ChromeRenderViewHostTestHarness::SetUp(); | 27 ChromeRenderViewHostTestHarness::SetUp(); |
28 #if defined(TOOLKIT_VIEWS) | 28 #if defined(TOOLKIT_VIEWS) |
29 extensions::TabHelper::CreateForWebContents(web_contents()); | 29 extensions::TabHelper::CreateForWebContents(web_contents()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 TEST_F(WebApplicationTest, AppDirWithUrl) { | 66 TEST_F(WebApplicationTest, AppDirWithUrl) { |
67 base::FilePath profile_path(FILE_PATH_LITERAL("profile")); | 67 base::FilePath profile_path(FILE_PATH_LITERAL("profile")); |
68 base::FilePath result(web_app::GetWebAppDataDirectory( | 68 base::FilePath result(web_app::GetWebAppDataDirectory( |
69 profile_path, std::string(), GURL("http://example.com"))); | 69 profile_path, std::string(), GURL("http://example.com"))); |
70 base::FilePath expected = profile_path.AppendASCII("Web Applications") | 70 base::FilePath expected = profile_path.AppendASCII("Web Applications") |
71 .AppendASCII("example.com").AppendASCII("http_80"); | 71 .AppendASCII("example.com").AppendASCII("http_80"); |
72 EXPECT_EQ(expected, result); | 72 EXPECT_EQ(expected, result); |
73 } | 73 } |
74 #endif // ENABLE_EXTENSIONS | 74 #endif // ENABLE_EXTENSIONS |
OLD | NEW |