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

Side by Side Diff: ash/system/tray/system_tray_unittest.cc

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 21 matching lines...) Expand all
32 TestItem() : tray_view_(NULL) {} 32 TestItem() : tray_view_(NULL) {}
33 33
34 virtual views::View* CreateTrayView(user::LoginStatus status) { 34 virtual views::View* CreateTrayView(user::LoginStatus status) {
35 tray_view_ = new views::View; 35 tray_view_ = new views::View;
36 // Add a label so it has non-zero width. 36 // Add a label so it has non-zero width.
37 tray_view_->SetLayoutManager(new views::FillLayout); 37 tray_view_->SetLayoutManager(new views::FillLayout);
38 tray_view_->AddChildView(new views::Label(UTF8ToUTF16("Tray"))); 38 tray_view_->AddChildView(new views::Label(UTF8ToUTF16("Tray")));
39 return tray_view_; 39 return tray_view_;
40 } 40 }
41 41
42 virtual views::View* CreateDefaultView(user::LoginStatus status) { 42 virtual views::View* CreateDefaultView(user::LoginStatus status,
43 int bubble_width) {
43 default_view_ = new views::View; 44 default_view_ = new views::View;
44 default_view_->SetLayoutManager(new views::FillLayout); 45 default_view_->SetLayoutManager(new views::FillLayout);
45 default_view_->AddChildView(new views::Label(UTF8ToUTF16("Default"))); 46 default_view_->AddChildView(new views::Label(UTF8ToUTF16("Default")));
46 return default_view_; 47 return default_view_;
47 } 48 }
48 49
49 virtual views::View* CreateDetailedView(user::LoginStatus status) { 50 virtual views::View* CreateDetailedView(user::LoginStatus status) {
50 detailed_view_ = new views::View; 51 detailed_view_ = new views::View;
51 detailed_view_->SetLayoutManager(new views::FillLayout); 52 detailed_view_->SetLayoutManager(new views::FillLayout);
52 detailed_view_->AddChildView(new views::Label(UTF8ToUTF16("Detailed"))); 53 detailed_view_->AddChildView(new views::Label(UTF8ToUTF16("Detailed")));
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 tray->ShowDefaultView(BUBBLE_USE_EXISTING); 230 tray->ShowDefaultView(BUBBLE_USE_EXISTING);
230 RunAllPendingInMessageLoop(); 231 RunAllPendingInMessageLoop();
231 232
232 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> 233 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()->
233 GetWindowBoundsInScreen().ToString()); 234 GetWindowBoundsInScreen().ToString());
234 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); 235 EXPECT_EQ(widget, test_item->default_view()->GetWidget());
235 } 236 }
236 237
237 } // namespace test 238 } // namespace test
238 } // namespace ash 239 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698