| 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/extensions/convert_web_app.h" | 5 #include "chrome/browser/extensions/convert_web_app.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 base::Time GetTestTime(int year, int month, int day, int hour, int minute, | 73 base::Time GetTestTime(int year, int month, int day, int hour, int minute, |
| 74 int second, int millisecond) { | 74 int second, int millisecond) { |
| 75 base::Time::Exploded exploded = {0}; | 75 base::Time::Exploded exploded = {0}; |
| 76 exploded.year = year; | 76 exploded.year = year; |
| 77 exploded.month = month; | 77 exploded.month = month; |
| 78 exploded.day_of_month = day; | 78 exploded.day_of_month = day; |
| 79 exploded.hour = hour; | 79 exploded.hour = hour; |
| 80 exploded.minute = minute; | 80 exploded.minute = minute; |
| 81 exploded.second = second; | 81 exploded.second = second; |
| 82 exploded.millisecond = millisecond; | 82 exploded.millisecond = millisecond; |
| 83 return base::Time::FromUTCExploded(exploded); | 83 base::Time out_time; |
| 84 EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &out_time)); |
| 85 return out_time; |
| 84 } | 86 } |
| 85 | 87 |
| 86 } // namespace | 88 } // namespace |
| 87 | 89 |
| 88 TEST(ExtensionFromWebApp, GenerateVersion) { | 90 TEST(ExtensionFromWebApp, GenerateVersion) { |
| 89 EXPECT_EQ("2010.1.1.0", | 91 EXPECT_EQ("2010.1.1.0", |
| 90 ConvertTimeToExtensionVersion( | 92 ConvertTimeToExtensionVersion( |
| 91 GetTestTime(2010, 1, 1, 0, 0, 0, 0))); | 93 GetTestTime(2010, 1, 1, 0, 0, 0, 0))); |
| 92 EXPECT_EQ("2010.12.31.22111", | 94 EXPECT_EQ("2010.12.31.22111", |
| 93 ConvertTimeToExtensionVersion( | 95 ConvertTimeToExtensionVersion( |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 EXPECT_EQ(base::UTF16ToUTF8(web_app.title), extension->name()); | 181 EXPECT_EQ(base::UTF16ToUTF8(web_app.title), extension->name()); |
| 180 EXPECT_EQ("", extension->description()); | 182 EXPECT_EQ("", extension->description()); |
| 181 EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension.get())); | 183 EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension.get())); |
| 182 EXPECT_EQ(0u, IconsInfo::GetIcons(extension.get()).map().size()); | 184 EXPECT_EQ(0u, IconsInfo::GetIcons(extension.get()).map().size()); |
| 183 EXPECT_EQ(0u, | 185 EXPECT_EQ(0u, |
| 184 extension->permissions_data()->active_permissions().apis().size()); | 186 extension->permissions_data()->active_permissions().apis().size()); |
| 185 ASSERT_EQ(0u, extension->web_extent().patterns().size()); | 187 ASSERT_EQ(0u, extension->web_extent().patterns().size()); |
| 186 } | 188 } |
| 187 | 189 |
| 188 } // namespace extensions | 190 } // namespace extensions |
| OLD | NEW |