Chromium Code Reviews| 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 "chrome/browser/ui/views/global_error_bubble_view.h" | 5 #include "chrome/browser/ui/views/global_error_bubble_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/global_error/global_error.h" | 10 #include "chrome/browser/ui/global_error/global_error.h" |
| 11 #include "chrome/browser/ui/views/harmony/chrome_views_layout_delegate.h" | |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/gfx/codec/png_codec.h" | 14 #include "ui/gfx/codec/png_codec.h" |
| 14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
| 15 #include "ui/gfx/image/image_png_rep.h" | 16 #include "ui/gfx/image/image_png_rep.h" |
| 16 #include "ui/gfx/image/image_unittest_util.h" | 17 #include "ui/gfx/image/image_unittest_util.h" |
| 17 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 18 #include "ui/views/controls/button/label_button.h" | 19 #include "ui/views/controls/button/label_button.h" |
| 19 #include "ui/views/test/test_views_delegate.h" | 20 #include "ui/views/test/test_views_delegate.h" |
| 20 | 21 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 : mock_global_error_with_standard_bubble_( | 81 : mock_global_error_with_standard_bubble_( |
| 81 base::MakeUnique<StrictMock<MockGlobalErrorWithStandardBubble>>()), | 82 base::MakeUnique<StrictMock<MockGlobalErrorWithStandardBubble>>()), |
| 82 button_(&mock_button_listener_, base::string16()), | 83 button_(&mock_button_listener_, base::string16()), |
| 83 view_(base::MakeUnique<GlobalErrorBubbleView>( | 84 view_(base::MakeUnique<GlobalErrorBubbleView>( |
| 84 &arg_view_, | 85 &arg_view_, |
| 85 anchor_point_, | 86 anchor_point_, |
| 86 arrow_, | 87 arrow_, |
| 87 nullptr, | 88 nullptr, |
| 88 mock_global_error_with_standard_bubble_->AsWeakPtr())) {} | 89 mock_global_error_with_standard_bubble_->AsWeakPtr())) {} |
| 89 | 90 |
| 91 void SetUp() override { | |
| 92 testing::Test::SetUp(); | |
| 93 views_delegate_.set_layout_delegate(nullptr); | |
|
Peter Kasting
2017/04/04 02:08:52
Not necessary
kylix_rd
2017/04/04 20:28:23
Done.
| |
| 94 views_delegate_.set_layout_delegate( | |
| 95 base::MakeUnique<ChromeViewsLayoutDelegate>()); | |
| 96 } | |
| 97 | |
| 90 protected: | 98 protected: |
| 91 views::TestViewsDelegate views_delegate_; | 99 views::TestViewsDelegate views_delegate_; |
| 92 std::unique_ptr<StrictMock<MockGlobalErrorWithStandardBubble>> | 100 std::unique_ptr<StrictMock<MockGlobalErrorWithStandardBubble>> |
| 93 mock_global_error_with_standard_bubble_; | 101 mock_global_error_with_standard_bubble_; |
| 94 views::View arg_view_; | 102 views::View arg_view_; |
| 95 const gfx::Point anchor_point_; | 103 const gfx::Point anchor_point_; |
| 96 views::BubbleBorder::Arrow arrow_; | 104 views::BubbleBorder::Arrow arrow_; |
| 97 FakeButtonListener mock_button_listener_; | 105 FakeButtonListener mock_button_listener_; |
| 98 views::LabelButton button_; | 106 views::LabelButton button_; |
| 99 std::unique_ptr<GlobalErrorBubbleView> view_; | 107 std::unique_ptr<GlobalErrorBubbleView> view_; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_OK)); | 173 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_OK)); |
| 166 EXPECT_EQ(base::string16(), | 174 EXPECT_EQ(base::string16(), |
| 167 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_CANCEL)); | 175 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_CANCEL)); |
| 168 EXPECT_EQ(ui::DIALOG_BUTTON_NONE, view_->GetDialogButtons()); | 176 EXPECT_EQ(ui::DIALOG_BUTTON_NONE, view_->GetDialogButtons()); |
| 169 | 177 |
| 170 view_->Cancel(); | 178 view_->Cancel(); |
| 171 view_->Accept(); | 179 view_->Accept(); |
| 172 } | 180 } |
| 173 | 181 |
| 174 } // namespace views | 182 } // namespace views |
| OLD | NEW |