Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/extensions/convert_web_app_unittest.cc

Issue 2111103002: Make callers of FromUTC(Local)Exploded in chrome/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lei Zhang's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698