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

Side by Side Diff: ash/system/chromeos/tray_display_unittest.cc

Issue 2131823003: mash: Minor ash/common fixes for tray_display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/tray_display.h" 5 #include "ash/system/chromeos/tray_display.h"
6 6
7 #include "ash/common/system/chromeos/devicetype_utils.h" 7 #include "ash/common/system/chromeos/devicetype_utils.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/root_window_controller.h"
10 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
11 #include "ash/shell.h" 10 #include "ash/shell.h"
12 #include "ash/system/tray/system_tray.h" 11 #include "ash/system/tray/system_tray.h"
13 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
14 #include "ash/test/display_manager_test_api.h" 13 #include "ash/test/display_manager_test_api.h"
15 #include "ash/test/test_system_tray_delegate.h" 14 #include "ash/test/test_system_tray_delegate.h"
16 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
17 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
19 #include "grit/ash_strings.h" 18 #include "grit/ash_strings.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 CheckUpdate(); 118 CheckUpdate();
120 return tray_; 119 return tray_;
121 } 120 }
122 121
123 TrayDisplay* TrayDisplayTest::GetTrayDisplay() { 122 TrayDisplay* TrayDisplayTest::GetTrayDisplay() {
124 CheckUpdate(); 123 CheckUpdate();
125 return tray_display_; 124 return tray_display_;
126 } 125 }
127 126
128 void TrayDisplayTest::CheckUpdate() { 127 void TrayDisplayTest::CheckUpdate() {
129 SystemTray* current = 128 SystemTray* current = GetPrimarySystemTray();
130 Shell::GetPrimaryRootWindowController()->GetSystemTray();
131 if (tray_ != current) { 129 if (tray_ != current) {
132 tray_ = current; 130 tray_ = current;
133 tray_display_ = new TrayDisplay(tray_); 131 tray_display_ = new TrayDisplay(tray_);
134 tray_->AddTrayItem(tray_display_); 132 tray_->AddTrayItem(tray_display_);
135 } 133 }
136 } 134 }
137 135
138 void TrayDisplayTest::CloseNotification() { 136 void TrayDisplayTest::CloseNotification() {
139 message_center::MessageCenter::Get()->RemoveNotification( 137 message_center::MessageCenter::Get()->RemoveNotification(
140 TrayDisplay::kNotificationId, false); 138 TrayDisplay::kNotificationId, false);
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 display::Display::ROTATION_SOURCE_ACCELEROMETER); 608 display::Display::ROTATION_SOURCE_ACCELEROMETER);
611 EXPECT_FALSE(IsDisplayVisibleInTray()); 609 EXPECT_FALSE(IsDisplayVisibleInTray());
612 610
613 // If a non-rotation setting is changed, display regardless of the source of 611 // If a non-rotation setting is changed, display regardless of the source of
614 // rotation so that the full message is shown. 612 // rotation so that the full message is shown.
615 UpdateDisplay("400x400@1.5"); 613 UpdateDisplay("400x400@1.5");
616 EXPECT_TRUE(IsDisplayVisibleInTray()); 614 EXPECT_TRUE(IsDisplayVisibleInTray());
617 } 615 }
618 616
619 } // namespace ash 617 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698