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

Unified Diff: ash/display/resolution_notification_controller_unittest.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/resolution_notification_controller.cc ('k') | ash/display/root_window_transformers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/resolution_notification_controller_unittest.cc
diff --git a/ash/display/resolution_notification_controller_unittest.cc b/ash/display/resolution_notification_controller_unittest.cc
index b02f3fea880d3b5cbb3407a9f87ebc709ba1fc77..5bf87a80b6623de871077f734698295851f66615 100644
--- a/ash/display/resolution_notification_controller_unittest.cc
+++ b/ash/display/resolution_notification_controller_unittest.cc
@@ -47,9 +47,7 @@ base::string16 ExpectedFallbackNotificationMessage(
class ResolutionNotificationControllerTest : public ash::test::AshTestBase {
public:
- ResolutionNotificationControllerTest()
- : accept_count_(0) {
- }
+ ResolutionNotificationControllerTest() : accept_count_(0) {}
~ResolutionNotificationControllerTest() override {}
@@ -66,18 +64,14 @@ class ResolutionNotificationControllerTest : public ash::test::AshTestBase {
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
const DisplayInfo& info = display_manager->GetDisplayInfo(display.id());
- DisplayMode old_mode(info.size_in_pixel(),
- 60 /* refresh_rate */,
- false /* interlaced */,
- false /* native */);
+ DisplayMode old_mode(info.size_in_pixel(), 60 /* refresh_rate */,
+ false /* interlaced */, false /* native */);
DisplayMode new_mode = old_mode;
new_mode.size = new_resolution;
if (display_manager->SetDisplayMode(display.id(), new_mode)) {
controller()->PrepareNotification(
- display.id(),
- old_mode,
- new_mode,
+ display.id(), old_mode, new_mode,
base::Bind(&ResolutionNotificationControllerTest::OnAccepted,
base::Unretained(this)));
}
@@ -101,15 +95,16 @@ class ResolutionNotificationControllerTest : public ash::test::AshTestBase {
void SetDisplayResolutionAndNotify(const display::Display& display,
const gfx::Size& new_resolution) {
- SetDisplayResolutionAndNotifyWithResolution(
- display, new_resolution, new_resolution);
+ SetDisplayResolutionAndNotifyWithResolution(display, new_resolution,
+ new_resolution);
}
static base::string16 GetNotificationMessage() {
const message_center::NotificationList::Notifications& notifications =
message_center::MessageCenter::Get()->GetVisibleNotifications();
for (message_center::NotificationList::Notifications::const_iterator iter =
- notifications.begin(); iter != notifications.end(); ++iter) {
+ notifications.begin();
+ iter != notifications.end(); ++iter) {
if ((*iter)->id() == ResolutionNotificationController::kNotificationId)
return (*iter)->title();
}
@@ -137,17 +132,13 @@ class ResolutionNotificationControllerTest : public ash::test::AshTestBase {
ResolutionNotificationController::kNotificationId);
}
- static void TickTimer() {
- controller()->OnTimerTick();
- }
+ static void TickTimer() { controller()->OnTimerTick(); }
static ResolutionNotificationController* controller() {
return Shell::GetInstance()->resolution_notification_controller();
}
- int accept_count() const {
- return accept_count_;
- }
+ int accept_count() const { return accept_count_; }
private:
void OnAccepted() {
@@ -173,8 +164,8 @@ TEST_F(ResolutionNotificationControllerTest, Basic) {
EXPECT_FALSE(IsNotificationVisible());
// Changes the resolution and apply the result.
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(200, 200));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(200, 200));
EXPECT_TRUE(IsNotificationVisible());
EXPECT_FALSE(controller()->DoesNotificationTimeout());
EXPECT_EQ(ExpectedNotificationMessage(id2, gfx::Size(200, 200)),
@@ -206,8 +197,8 @@ TEST_F(ResolutionNotificationControllerTest, ClickMeansAccept) {
EXPECT_FALSE(IsNotificationVisible());
// Changes the resolution and apply the result.
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(200, 200));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(200, 200));
EXPECT_TRUE(IsNotificationVisible());
EXPECT_FALSE(controller()->DoesNotificationTimeout());
DisplayMode mode;
@@ -277,8 +268,8 @@ TEST_F(ResolutionNotificationControllerTest, Close) {
EXPECT_FALSE(IsNotificationVisible());
// Changes the resolution and apply the result.
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(200, 200));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(200, 200));
EXPECT_TRUE(IsNotificationVisible());
EXPECT_FALSE(controller()->DoesNotificationTimeout());
DisplayMode mode;
@@ -304,8 +295,8 @@ TEST_F(ResolutionNotificationControllerTest, Timeout) {
SetDisplayResolutionAndNotify(display, gfx::Size(200, 200));
for (int i = 0; i < ResolutionNotificationController::kTimeoutInSec; ++i) {
- EXPECT_TRUE(IsNotificationVisible()) << "notification is closed after "
- << i << "-th timer tick";
+ EXPECT_TRUE(IsNotificationVisible()) << "notification is closed after " << i
+ << "-th timer tick";
TickTimer();
RunAllPendingInMessageLoop();
}
@@ -324,13 +315,14 @@ TEST_F(ResolutionNotificationControllerTest, DisplayDisconnected) {
if (!SupportsMultipleDisplays())
return;
- UpdateDisplay("300x300#300x300%56|200x200%57,"
- "200x200#250x250%58|200x200%59|100x100%60");
+ UpdateDisplay(
+ "300x300#300x300%56|200x200%57,"
+ "200x200#250x250%58|200x200%59|100x100%60");
int64_t id2 = ash::ScreenUtil::GetSecondaryDisplay().id();
ash::DisplayManager* display_manager =
ash::Shell::GetInstance()->display_manager();
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(100, 100));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(100, 100));
ASSERT_TRUE(IsNotificationVisible());
// Disconnects the secondary display and verifies it doesn't cause crashes.
@@ -349,14 +341,15 @@ TEST_F(ResolutionNotificationControllerTest, MultipleResolutionChange) {
if (!SupportsMultipleDisplays())
return;
- UpdateDisplay("300x300#300x300%56|200x200%57,"
- "250x250#250x250%58|200x200%59");
+ UpdateDisplay(
+ "300x300#300x300%56|200x200%57,"
+ "250x250#250x250%58|200x200%59");
int64_t id2 = ash::ScreenUtil::GetSecondaryDisplay().id();
ash::DisplayManager* display_manager =
ash::Shell::GetInstance()->display_manager();
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(200, 200));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(200, 200));
EXPECT_TRUE(IsNotificationVisible());
EXPECT_FALSE(controller()->DoesNotificationTimeout());
DisplayMode mode;
@@ -366,8 +359,8 @@ TEST_F(ResolutionNotificationControllerTest, MultipleResolutionChange) {
// Invokes SetDisplayResolutionAndNotify during the previous notification is
// visible.
- SetDisplayResolutionAndNotify(
- ScreenUtil::GetSecondaryDisplay(), gfx::Size(250, 250));
+ SetDisplayResolutionAndNotify(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(250, 250));
EXPECT_TRUE(display_manager->GetSelectedModeForDisplayId(id2, &mode));
EXPECT_EQ("250x250", mode.size.ToString());
EXPECT_EQ(58.0f, mode.refresh_rate);
@@ -388,8 +381,9 @@ TEST_F(ResolutionNotificationControllerTest, Fallback) {
if (!SupportsMultipleDisplays())
return;
- UpdateDisplay("300x300#300x300%56|200x200%57,"
- "250x250#250x250%58|220x220%59|200x200%60");
+ UpdateDisplay(
+ "300x300#300x300%56|200x200%57,"
+ "250x250#250x250%58|220x220%59|200x200%60");
int64_t id2 = ash::ScreenUtil::GetSecondaryDisplay().id();
ash::DisplayManager* display_manager =
ash::Shell::GetInstance()->display_manager();
@@ -397,16 +391,14 @@ TEST_F(ResolutionNotificationControllerTest, Fallback) {
EXPECT_FALSE(IsNotificationVisible());
// Changes the resolution and apply the result.
- SetDisplayResolutionAndNotifyWithResolution(
- ScreenUtil::GetSecondaryDisplay(),
- gfx::Size(220, 220),
- gfx::Size(200, 200));
+ SetDisplayResolutionAndNotifyWithResolution(ScreenUtil::GetSecondaryDisplay(),
+ gfx::Size(220, 220),
+ gfx::Size(200, 200));
EXPECT_TRUE(IsNotificationVisible());
EXPECT_FALSE(controller()->DoesNotificationTimeout());
- EXPECT_EQ(
- ExpectedFallbackNotificationMessage(
- id2, gfx::Size(220, 220), gfx::Size(200, 200)),
- GetNotificationMessage());
+ EXPECT_EQ(ExpectedFallbackNotificationMessage(id2, gfx::Size(220, 220),
+ gfx::Size(200, 200)),
+ GetNotificationMessage());
DisplayMode mode;
EXPECT_TRUE(display_manager->GetSelectedModeForDisplayId(id2, &mode));
EXPECT_EQ("200x200", mode.size.ToString());
« no previous file with comments | « ash/display/resolution_notification_controller.cc ('k') | ash/display/root_window_transformers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698