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/chromeos/status/clock_menu_button.h" | 5 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 ClockMenuButton* GetClockMenuButton() { | 28 ClockMenuButton* GetClockMenuButton() { |
29 BrowserView* view = static_cast<BrowserView*>(browser()->window()); | 29 BrowserView* view = static_cast<BrowserView*>(browser()->window()); |
30 return static_cast<StatusAreaView*>(view-> | 30 return static_cast<StatusAreaView*>(view-> |
31 GetViewByID(VIEW_ID_STATUS_AREA))->clock_view(); | 31 GetViewByID(VIEW_ID_STATUS_AREA))->clock_view(); |
32 } | 32 } |
33 }; | 33 }; |
34 | 34 |
35 IN_PROC_BROWSER_TEST_F(ClockMenuButtonTest, TimezoneTest) { | 35 IN_PROC_BROWSER_TEST_F(ClockMenuButtonTest, TimezoneTest) { |
36 ClockMenuButton* clock = GetClockMenuButton(); | 36 ClockMenuButton* clock = GetClockMenuButton(); |
37 ASSERT_TRUE(clock != NULL); | 37 ASSERT_TRUE(clock != NULL); |
| 38 |
38 // Update timezone and make sure clock text changes. | 39 // Update timezone and make sure clock text changes. |
| 40 scoped_ptr<icu::TimeZone> timezone_first(icu::TimeZone::createTimeZone( |
| 41 icu::UnicodeString::fromUTF8("Asia/Hong_Kong"))); |
| 42 CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone_first.get()); |
39 std::wstring text_before = clock->text(); | 43 std::wstring text_before = clock->text(); |
40 scoped_ptr<icu::TimeZone> timezone(icu::TimeZone::createTimeZone( | 44 scoped_ptr<icu::TimeZone> timezone_second(icu::TimeZone::createTimeZone( |
41 icu::UnicodeString::fromUTF8("Asia/Hong_Kong"))); | 45 icu::UnicodeString::fromUTF8("Pacific/Samoa"))); |
42 CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone.get()); | 46 CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone_second.get()); |
43 std::wstring text_after = clock->text(); | 47 std::wstring text_after = clock->text(); |
44 EXPECT_NE(text_before, text_after); | 48 EXPECT_NE(text_before, text_after); |
| 49 |
45 } | 50 } |
46 | 51 |
47 } // namespace chromeos | 52 } // namespace chromeos |
OLD | NEW |