| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ui/message_center/views/notification_view_md.h" | 5 #include "ui/message_center/views/notification_view_md.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // * TestLineLimits | 274 // * TestLineLimits |
| 275 // * TestImageSizing | 275 // * TestImageSizing |
| 276 // * SettingsButtonTest | 276 // * SettingsButtonTest |
| 277 // * ViewOrderingTest | 277 // * ViewOrderingTest |
| 278 // * FormatContextMessageTest | 278 // * FormatContextMessageTest |
| 279 | 279 |
| 280 TEST_F(NotificationViewMDTest, CreateOrUpdateTest) { | 280 TEST_F(NotificationViewMDTest, CreateOrUpdateTest) { |
| 281 EXPECT_NE(nullptr, notification_view()->title_view_); | 281 EXPECT_NE(nullptr, notification_view()->title_view_); |
| 282 EXPECT_NE(nullptr, notification_view()->message_view_); | 282 EXPECT_NE(nullptr, notification_view()->message_view_); |
| 283 EXPECT_NE(nullptr, notification_view()->icon_view_); | 283 EXPECT_NE(nullptr, notification_view()->icon_view_); |
| 284 EXPECT_NE(nullptr, notification_view()->image_view_); | 284 EXPECT_NE(nullptr, notification_view()->image_container_view_); |
| 285 | 285 |
| 286 notification()->set_image(gfx::Image()); | 286 notification()->set_image(gfx::Image()); |
| 287 notification()->set_title(base::string16()); | 287 notification()->set_title(base::string16()); |
| 288 notification()->set_message(base::string16()); | 288 notification()->set_message(base::string16()); |
| 289 notification()->set_icon(gfx::Image()); | 289 notification()->set_icon(gfx::Image()); |
| 290 | 290 |
| 291 notification_view()->CreateOrUpdateViews(*notification()); | 291 notification_view()->CreateOrUpdateViews(*notification()); |
| 292 | 292 |
| 293 EXPECT_EQ(nullptr, notification_view()->title_view_); | 293 EXPECT_EQ(nullptr, notification_view()->title_view_); |
| 294 EXPECT_EQ(nullptr, notification_view()->message_view_); | 294 EXPECT_EQ(nullptr, notification_view()->message_view_); |
| 295 EXPECT_EQ(nullptr, notification_view()->image_view_); | 295 EXPECT_EQ(nullptr, notification_view()->image_container_view_); |
| 296 // We still expect an icon view for all layouts. | 296 // We still expect an icon view for all layouts. |
| 297 EXPECT_NE(nullptr, notification_view()->icon_view_); | 297 EXPECT_NE(nullptr, notification_view()->icon_view_); |
| 298 } | 298 } |
| 299 | 299 |
| 300 TEST_F(NotificationViewMDTest, TestIconSizing) { | 300 TEST_F(NotificationViewMDTest, TestIconSizing) { |
| 301 // TODO(tetsui): Remove duplicated integer literal in CreateOrUpdateIconView. | 301 // TODO(tetsui): Remove duplicated integer literal in CreateOrUpdateIconView. |
| 302 const int kNotificationIconSize = 30; | 302 const int kNotificationIconSize = 30; |
| 303 | 303 |
| 304 notification()->set_type(NOTIFICATION_TYPE_SIMPLE); | 304 notification()->set_type(NOTIFICATION_TYPE_SIMPLE); |
| 305 ProportionalImageView* view = notification_view()->icon_view_; | 305 ProportionalImageView* view = notification_view()->icon_view_; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 notification_view()->GetPreferredSize().height()); | 526 notification_view()->GetPreferredSize().height()); |
| 527 | 527 |
| 528 notification_view()->ToggleExpanded(); | 528 notification_view()->ToggleExpanded(); |
| 529 EXPECT_FALSE(notification_view()->expanded_); | 529 EXPECT_FALSE(notification_view()->expanded_); |
| 530 EXPECT_EQ(collapsed_height, notification_view()->message_view_->height()); | 530 EXPECT_EQ(collapsed_height, notification_view()->message_view_->height()); |
| 531 EXPECT_EQ(collapsed_preferred_height, | 531 EXPECT_EQ(collapsed_preferred_height, |
| 532 notification_view()->GetPreferredSize().height()); | 532 notification_view()->GetPreferredSize().height()); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace message_center | 535 } // namespace message_center |
| OLD | NEW |