| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
| 13 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 14 #include "ui/gfx/screen.h" | 14 #include "ui/gfx/screen.h" |
| 15 #include "ui/message_center/message_center_style.h" | 15 #include "ui/message_center/message_center_style.h" |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 | 18 |
| 19 class AshPopupAlignmentDelegateTest : public test::AshTestBase { | 19 class AshPopupAlignmentDelegateTest : public test::AshTestBase { |
| 20 public: | 20 public: |
| 21 AshPopupAlignmentDelegateTest() {} | 21 AshPopupAlignmentDelegateTest() {} |
| 22 virtual ~AshPopupAlignmentDelegateTest() {} | 22 ~AshPopupAlignmentDelegateTest() override {} |
| 23 | 23 |
| 24 virtual void SetUp() { | 24 void SetUp() override { |
| 25 test::AshTestBase::SetUp(); | 25 test::AshTestBase::SetUp(); |
| 26 alignment_delegate_.reset(new AshPopupAlignmentDelegate()); | 26 alignment_delegate_.reset(new AshPopupAlignmentDelegate()); |
| 27 alignment_delegate_->StartObserving( | 27 alignment_delegate_->StartObserving( |
| 28 Shell::GetScreen(), Shell::GetScreen()->GetPrimaryDisplay()); | 28 Shell::GetScreen(), Shell::GetScreen()->GetPrimaryDisplay()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual void TearDown() { | 31 void TearDown() override { |
| 32 alignment_delegate_.reset(); | 32 alignment_delegate_.reset(); |
| 33 test::AshTestBase::TearDown(); | 33 test::AshTestBase::TearDown(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 enum Position { | 37 enum Position { |
| 38 TOP_LEFT, | 38 TOP_LEFT, |
| 39 TOP_RIGHT, | 39 TOP_RIGHT, |
| 40 BOTTOM_LEFT, | 40 BOTTOM_LEFT, |
| 41 BOTTOM_RIGHT, | 41 BOTTOM_RIGHT, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 const int kTrayHeight = 100; | 189 const int kTrayHeight = 100; |
| 190 alignment_delegate()->SetSystemTrayHeight(kTrayHeight); | 190 alignment_delegate()->SetSystemTrayHeight(kTrayHeight); |
| 191 | 191 |
| 192 EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size)); | 192 EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size)); |
| 193 EXPECT_EQ(baseline - kTrayHeight - message_center::kMarginBetweenItems, | 193 EXPECT_EQ(baseline - kTrayHeight - message_center::kMarginBetweenItems, |
| 194 alignment_delegate()->GetBaseLine()); | 194 alignment_delegate()->GetBaseLine()); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace ash | 197 } // namespace ash |
| OLD | NEW |