OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 profile_.reset(NULL); | 36 profile_.reset(NULL); |
37 } | 37 } |
38 | 38 |
39 BrowserThread ui_thread_; | 39 BrowserThread ui_thread_; |
40 }; | 40 }; |
41 | 41 |
42 TEST_F(WebApplicationTest, GetShortcutInfoForTab) { | 42 TEST_F(WebApplicationTest, GetShortcutInfoForTab) { |
43 const string16 title = ASCIIToUTF16("TEST_TITLE"); | 43 const string16 title = ASCIIToUTF16("TEST_TITLE"); |
44 const string16 description = ASCIIToUTF16("TEST_DESCRIPTION"); | 44 const string16 description = ASCIIToUTF16("TEST_DESCRIPTION"); |
45 const GURL url("http://www.foo.com/bar"); | 45 const GURL url("http://www.foo.com/bar"); |
46 webkit_glue::WebApplicationInfo web_app_info; | 46 WebApplicationInfo web_app_info; |
47 web_app_info.title = title; | 47 web_app_info.title = title; |
48 web_app_info.description = description; | 48 web_app_info.description = description; |
49 web_app_info.app_url = url; | 49 web_app_info.app_url = url; |
50 | 50 |
51 rvh()->TestOnMessageReceived( | 51 rvh()->TestOnMessageReceived( |
52 ViewHostMsg_DidGetApplicationInfo(0, 0, web_app_info)); | 52 ViewHostMsg_DidGetApplicationInfo(0, 0, web_app_info)); |
53 ShellIntegration::ShortcutInfo info; | 53 ShellIntegration::ShortcutInfo info; |
54 web_app::GetShortcutInfoForTab(contents(), &info); | 54 web_app::GetShortcutInfoForTab(contents(), &info); |
55 | 55 |
56 EXPECT_EQ(title, info.title); | 56 EXPECT_EQ(title, info.title); |
57 EXPECT_EQ(description, info.description); | 57 EXPECT_EQ(description, info.description); |
58 EXPECT_EQ(url, info.url); | 58 EXPECT_EQ(url, info.url); |
59 } | 59 } |
60 | 60 |
61 TEST_F(WebApplicationTest, GetDataDir) { | 61 TEST_F(WebApplicationTest, GetDataDir) { |
62 FilePath test_path(FILE_PATH_LITERAL("/path/to/test")); | 62 FilePath test_path(FILE_PATH_LITERAL("/path/to/test")); |
63 FilePath result = web_app::GetDataDir(test_path); | 63 FilePath result = web_app::GetDataDir(test_path); |
64 test_path = test_path.AppendASCII("Web Applications"); | 64 test_path = test_path.AppendASCII("Web Applications"); |
65 EXPECT_EQ(test_path.value(), result.value()); | 65 EXPECT_EQ(test_path.value(), result.value()); |
66 } | 66 } |
OLD | NEW |