| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/message_center/views/message_popup_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "ui/display/display.h" |
| 17 #include "ui/events/event.h" | 18 #include "ui/events/event.h" |
| 18 #include "ui/events/event_constants.h" | 19 #include "ui/events/event_constants.h" |
| 19 #include "ui/events/event_utils.h" | 20 #include "ui/events/event_utils.h" |
| 20 #include "ui/gfx/display.h" | |
| 21 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/message_center/fake_message_center.h" | 22 #include "ui/message_center/fake_message_center.h" |
| 23 #include "ui/message_center/views/desktop_popup_alignment_delegate.h" | 23 #include "ui/message_center/views/desktop_popup_alignment_delegate.h" |
| 24 #include "ui/message_center/views/toast_contents_view.h" | 24 #include "ui/message_center/views/toast_contents_view.h" |
| 25 #include "ui/views/test/views_test_base.h" | 25 #include "ui/views/test/views_test_base.h" |
| 26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 27 #include "ui/views/widget/widget_delegate.h" | 27 #include "ui/views/widget/widget_delegate.h" |
| 28 | 28 |
| 29 namespace message_center { | 29 namespace message_center { |
| 30 namespace test { | 30 namespace test { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 views::Widget* widget = collection_->GetWidgetForTest(id); | 68 views::Widget* widget = collection_->GetWidgetForTest(id); |
| 69 return widget && widget->IsVisible(); | 69 return widget && widget->IsVisible(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 views::Widget* GetWidget(const std::string& id) { | 72 views::Widget* GetWidget(const std::string& id) { |
| 73 return collection_->GetWidgetForTest(id); | 73 return collection_->GetWidgetForTest(id); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SetDisplayInfo(const gfx::Rect& work_area, | 76 void SetDisplayInfo(const gfx::Rect& work_area, |
| 77 const gfx::Rect& display_bounds) { | 77 const gfx::Rect& display_bounds) { |
| 78 gfx::Display dummy_display; | 78 display::Display dummy_display; |
| 79 dummy_display.set_bounds(display_bounds); | 79 dummy_display.set_bounds(display_bounds); |
| 80 dummy_display.set_work_area(work_area); | 80 dummy_display.set_work_area(work_area); |
| 81 alignment_delegate_->RecomputeAlignment(dummy_display); | 81 alignment_delegate_->RecomputeAlignment(dummy_display); |
| 82 PrepareForWait(); | 82 PrepareForWait(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 gfx::Rect GetWorkArea() { | 85 gfx::Rect GetWorkArea() { |
| 86 return alignment_delegate_->work_area_; | 86 return alignment_delegate_->work_area_; |
| 87 } | 87 } |
| 88 | 88 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 // Confirms that there is no toast. | 515 // Confirms that there is no toast. |
| 516 EXPECT_EQ(0u, GetToastCounts()); | 516 EXPECT_EQ(0u, GetToastCounts()); |
| 517 // But the notification still exists. | 517 // But the notification still exists. |
| 518 EXPECT_EQ(1u, MessageCenter::Get()->NotificationCount()); | 518 EXPECT_EQ(1u, MessageCenter::Get()->NotificationCount()); |
| 519 } | 519 } |
| 520 | 520 |
| 521 #endif // defined(OS_CHROMEOS) | 521 #endif // defined(OS_CHROMEOS) |
| 522 | 522 |
| 523 } // namespace test | 523 } // namespace test |
| 524 } // namespace message_center | 524 } // namespace message_center |
| OLD | NEW |