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 "ui/aura_shell/shell.h" |
| 14 #include "views/widget/widget.h" |
| 15 #endif |
10 | 16 |
11 namespace chromeos { | 17 namespace chromeos { |
12 | 18 |
13 class StatusAreaViewTest : public InProcessBrowserTest { | 19 class StatusAreaViewTest : public InProcessBrowserTest { |
14 protected: | 20 protected: |
15 StatusAreaViewTest() : InProcessBrowserTest() {} | 21 StatusAreaViewTest() : InProcessBrowserTest() {} |
16 StatusAreaView* GetStatusAreaView() { | 22 StatusAreaView* GetStatusAreaView() { |
17 BrowserView* view = static_cast<BrowserView*>(browser()->window()); | 23 views::View *view = |
| 24 #if defined(USE_AURA) |
| 25 aura_shell::Shell::GetInstance()->GetStatusAreaWidget()-> |
| 26 GetContentsView(); |
| 27 #else |
| 28 static_cast<BrowserView*>(browser()->window()); |
| 29 #endif |
18 return static_cast<StatusAreaView*>(view->GetViewByID(VIEW_ID_STATUS_AREA)); | 30 return static_cast<StatusAreaView*>(view->GetViewByID(VIEW_ID_STATUS_AREA)); |
19 } | 31 } |
20 }; | 32 }; |
21 | 33 |
22 IN_PROC_BROWSER_TEST_F(StatusAreaViewTest, VisibleTest) { | 34 IN_PROC_BROWSER_TEST_F(StatusAreaViewTest, VisibleTest) { |
23 StatusAreaView* status = GetStatusAreaView(); | 35 StatusAreaView* status = GetStatusAreaView(); |
24 EXPECT_TRUE(status->IsVisibleInRootView()); | 36 EXPECT_TRUE(status->IsVisibleInRootView()); |
25 EXPECT_FALSE(status->size().IsEmpty()); | 37 EXPECT_FALSE(status->size().IsEmpty()); |
26 } | 38 } |
27 | 39 |
28 } // namespace chromeos | 40 } // namespace chromeos |
OLD | NEW |