OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/system/status_area_widget.h" | 9 #include "ash/system/status_area_widget.h" |
10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "ui/views/controls/label.h" | 13 #include "ui/views/controls/label.h" |
14 #include "ui/views/layout/fill_layout.h" | 14 #include "ui/views/layout/fill_layout.h" |
15 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
16 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace test { | 19 namespace test { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 SystemTray* CreateSystemTray() { | 23 SystemTray* CreateSystemTray() { |
24 SystemTray* tray = new SystemTray; | 24 SystemTray* tray = new SystemTray; |
25 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget; | 25 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget; |
26 widget->AddTray(tray); | 26 widget->AddSystemTray(tray, NULL); |
27 tray->CreateItems(); | 27 tray->CreateItems(); |
28 widget->Show(); | 28 widget->Show(); |
29 return tray; | 29 return tray; |
30 } | 30 } |
31 | 31 |
32 // Trivial item implementation that tracks its views for testing. | 32 // Trivial item implementation that tracks its views for testing. |
33 class TestItem : public SystemTrayItem { | 33 class TestItem : public SystemTrayItem { |
34 public: | 34 public: |
35 TestItem() : tray_view_(NULL) {} | 35 TestItem() : tray_view_(NULL) {} |
36 | 36 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 tray->ShowDefaultView(BUBBLE_USE_EXISTING); | 229 tray->ShowDefaultView(BUBBLE_USE_EXISTING); |
230 RunAllPendingInMessageLoop(); | 230 RunAllPendingInMessageLoop(); |
231 | 231 |
232 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> | 232 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> |
233 GetWindowScreenBounds().ToString()); | 233 GetWindowScreenBounds().ToString()); |
234 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); | 234 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); |
235 } | 235 } |
236 | 236 |
237 } // namespace test | 237 } // namespace test |
238 } // namespace ash | 238 } // namespace ash |
OLD | NEW |