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

Unified Diff: chrome/browser/chromeos/status/clock_menu_button_browsertest.cc

Issue 8600001: Fixes bug where clock button wasn't updating in response to a timezone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and allow NULL Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/status_area_view_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/clock_menu_button_browsertest.cc
diff --git a/chrome/browser/chromeos/status/clock_menu_button_browsertest.cc b/chrome/browser/chromeos/status/clock_menu_button_browsertest.cc
index d17c3483507f29e15803e6bf30d5b70b6a6395f1..cdcb53f183e79ed0eb660637058bff1c825e53c1 100644
--- a/chrome/browser/chromeos/status/clock_menu_button_browsertest.cc
+++ b/chrome/browser/chromeos/status/clock_menu_button_browsertest.cc
@@ -17,6 +17,10 @@
#include "unicode/calendar.h"
#include "unicode/timezone.h"
+#if defined(USE_AURA)
+#include "chrome/browser/ui/views/aura/chrome_shell_delegate.h"
+#endif
+
namespace chromeos {
class ClockMenuButtonTest : public InProcessBrowserTest {
@@ -27,15 +31,20 @@ class ClockMenuButtonTest : public InProcessBrowserTest {
// to use stub, so reset it here.
CrosLibrary::Get()->GetTestApi()->ResetUseStubImpl();
}
- ClockMenuButton* GetClockMenuButton() {
- BrowserView* view = static_cast<BrowserView*>(browser()->window());
- return static_cast<ClockMenuButton*>(view->GetViewByID(
+ const ClockMenuButton* GetClockMenuButton() {
+ const views::View* parent = NULL;
+#if defined(USE_AURA)
+ parent = ChromeShellDelegate::instance()->GetStatusArea();
+#else
+ parent = static_cast<const BrowserView*>(browser()->window());
+#endif
+ return static_cast<const ClockMenuButton*>(parent->GetViewByID(
VIEW_ID_STATUS_BUTTON_CLOCK));
}
};
IN_PROC_BROWSER_TEST_F(ClockMenuButtonTest, TimezoneTest) {
- ClockMenuButton* clock = GetClockMenuButton();
+ const ClockMenuButton* clock = GetClockMenuButton();
ASSERT_TRUE(clock != NULL);
// Update timezone and make sure clock text changes.
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/status_area_view_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698