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

Side by Side Diff: chrome/browser/chromeos/status/clock_menu_button_browsertest.cc

Issue 3204001: Fixed flakyness of ClockMenuButtonTest.TimezoneTest.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698