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/file_path.h" | 7 #include "base/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/ui/tab_contents/test_tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
11 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 11 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
12 #include "chrome/common/extensions/extension_messages.h" | 12 #include "chrome/common/extensions/extension_messages.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
15 #include "content/test/test_renderer_host.h" | 15 #include "content/test/test_renderer_host.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 using content::RenderViewHostTester; | 19 using content::RenderViewHostTester; |
20 | 20 |
21 class WebApplicationTest : public TabContentsWrapperTestHarness { | 21 class WebApplicationTest : public TabContentsWrapperTestHarness { |
22 public: | 22 public: |
23 WebApplicationTest() : ui_thread_(BrowserThread::UI, &message_loop_) { | 23 WebApplicationTest() : ui_thread_(BrowserThread::UI, &message_loop_) { |
24 } | 24 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 TEST_F(WebApplicationTest, AppDirWithUrl) { | 58 TEST_F(WebApplicationTest, AppDirWithUrl) { |
59 FilePath profile_path(FILE_PATH_LITERAL("profile")); | 59 FilePath profile_path(FILE_PATH_LITERAL("profile")); |
60 FilePath result(web_app::GetWebAppDataDirectory( | 60 FilePath result(web_app::GetWebAppDataDirectory( |
61 profile_path, "", GURL("http://example.com"))); | 61 profile_path, "", GURL("http://example.com"))); |
62 FilePath expected = profile_path.AppendASCII("Web Applications") | 62 FilePath expected = profile_path.AppendASCII("Web Applications") |
63 .AppendASCII("example.com") | 63 .AppendASCII("example.com") |
64 .AppendASCII("http_80"); | 64 .AppendASCII("http_80"); |
65 EXPECT_EQ(expected, result); | 65 EXPECT_EQ(expected, result); |
66 } | 66 } |
OLD | NEW |