OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/frame/browser_view.h" | 5 #include "chrome/browser/chromeos/frame/browser_view.h" |
6 #include "chrome/browser/chromeos/status/status_area_view.h" | 6 #include "chrome/browser/chromeos/status/status_area_view.h" |
7 #include "chrome/browser/chromeos/view_ids.h" | 7 #include "chrome/browser/chromeos/view_ids.h" |
8 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "views/view.h" |
| 11 |
| 12 #if defined(USE_AURA) |
| 13 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
| 14 #endif |
10 | 15 |
11 namespace chromeos { | 16 namespace chromeos { |
12 | 17 |
13 class StatusAreaViewTest : public InProcessBrowserTest { | 18 class StatusAreaViewTest : public InProcessBrowserTest { |
14 protected: | 19 protected: |
15 StatusAreaViewTest() : InProcessBrowserTest() {} | 20 StatusAreaViewTest() : InProcessBrowserTest() {} |
16 StatusAreaView* GetStatusAreaView() { | 21 const StatusAreaView* GetStatusAreaView() { |
17 BrowserView* view = static_cast<BrowserView*>(browser()->window()); | 22 const views::View* view = |
18 return static_cast<StatusAreaView*>(view->GetViewByID(VIEW_ID_STATUS_AREA)); | 23 #if defined(USE_AURA) |
| 24 ChromeShellDelegate::instance()->GetStatusAreaForTest(); |
| 25 #else |
| 26 static_cast<BrowserView*>(browser()->window()); |
| 27 #endif |
| 28 return static_cast<const StatusAreaView*>( |
| 29 view->GetViewByID(VIEW_ID_STATUS_AREA)); |
19 } | 30 } |
20 }; | 31 }; |
21 | 32 |
22 IN_PROC_BROWSER_TEST_F(StatusAreaViewTest, VisibleTest) { | 33 IN_PROC_BROWSER_TEST_F(StatusAreaViewTest, VisibleTest) { |
23 StatusAreaView* status = GetStatusAreaView(); | 34 const StatusAreaView* status = GetStatusAreaView(); |
24 EXPECT_TRUE(status->IsVisibleInRootView()); | 35 EXPECT_TRUE(status->IsVisibleInRootView()); |
25 EXPECT_FALSE(status->size().IsEmpty()); | 36 EXPECT_FALSE(status->size().IsEmpty()); |
26 } | 37 } |
27 | 38 |
28 } // namespace chromeos | 39 } // namespace chromeos |
OLD | NEW |