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/extensions/convert_web_app.h" | 5 #include "chrome/browser/extensions/convert_web_app.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "base/version.h" | 17 #include "base/version.h" |
18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
20 #include "chrome/common/extensions/extension_icon_set.h" | 20 #include "chrome/common/extensions/extension_icon_set.h" |
21 #include "chrome/common/extensions/extension_resource.h" | 21 #include "chrome/common/extensions/extension_resource.h" |
22 #include "chrome/common/extensions/url_pattern.h" | 22 #include "chrome/common/extensions/url_pattern.h" |
23 #include "chrome/common/web_apps.h" | 23 #include "chrome/common/web_apps.h" |
24 #include "gfx/codec/png_codec.h" | |
25 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 #include "ui/gfx/codec/png_codec.h" |
27 #include "webkit/glue/image_decoder.h" | 27 #include "webkit/glue/image_decoder.h" |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // Returns an icon info corresponding to a canned icon. | 31 // Returns an icon info corresponding to a canned icon. |
32 WebApplicationInfo::IconInfo GetIconInfo(const GURL& url, int size) { | 32 WebApplicationInfo::IconInfo GetIconInfo(const GURL& url, int size) { |
33 WebApplicationInfo::IconInfo result; | 33 WebApplicationInfo::IconInfo result; |
34 | 34 |
35 FilePath icon_file; | 35 FilePath icon_file; |
36 if (!PathService::Get(chrome::DIR_TEST_DATA, &icon_file)) { | 36 if (!PathService::Get(chrome::DIR_TEST_DATA, &icon_file)) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 EXPECT_EQ("1978.12.11.0", extension->version()->GetString()); | 165 EXPECT_EQ("1978.12.11.0", extension->version()->GetString()); |
166 EXPECT_EQ(UTF16ToUTF8(web_app.title), extension->name()); | 166 EXPECT_EQ(UTF16ToUTF8(web_app.title), extension->name()); |
167 EXPECT_EQ("", extension->description()); | 167 EXPECT_EQ("", extension->description()); |
168 EXPECT_EQ(web_app.app_url, extension->GetFullLaunchURL()); | 168 EXPECT_EQ(web_app.app_url, extension->GetFullLaunchURL()); |
169 EXPECT_EQ(0u, extension->icons().map().size()); | 169 EXPECT_EQ(0u, extension->icons().map().size()); |
170 EXPECT_EQ(0u, extension->api_permissions().size()); | 170 EXPECT_EQ(0u, extension->api_permissions().size()); |
171 ASSERT_EQ(1u, extension->web_extent().patterns().size()); | 171 ASSERT_EQ(1u, extension->web_extent().patterns().size()); |
172 EXPECT_EQ("*://aaronboodman.com/*", | 172 EXPECT_EQ("*://aaronboodman.com/*", |
173 extension->web_extent().patterns()[0].GetAsString()); | 173 extension->web_extent().patterns()[0].GetAsString()); |
174 } | 174 } |
OLD | NEW |