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

Side by Side Diff: chrome/browser/ui/views/global_error_bubble_view_unittest.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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_layout_provider.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
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 test_views_delegate_.set_layout_provider(
94 ChromeLayoutProvider::CreateLayoutProvider());
95 }
96
90 protected: 97 protected:
91 views::TestViewsDelegate views_delegate_; 98 views::TestViewsDelegate test_views_delegate_;
92 std::unique_ptr<StrictMock<MockGlobalErrorWithStandardBubble>> 99 std::unique_ptr<StrictMock<MockGlobalErrorWithStandardBubble>>
93 mock_global_error_with_standard_bubble_; 100 mock_global_error_with_standard_bubble_;
94 views::View arg_view_; 101 views::View arg_view_;
95 const gfx::Point anchor_point_; 102 const gfx::Point anchor_point_;
96 views::BubbleBorder::Arrow arrow_; 103 views::BubbleBorder::Arrow arrow_;
97 FakeButtonListener mock_button_listener_; 104 FakeButtonListener mock_button_listener_;
98 views::LabelButton button_; 105 views::LabelButton button_;
99 std::unique_ptr<GlobalErrorBubbleView> view_; 106 std::unique_ptr<GlobalErrorBubbleView> view_;
100 107
101 private: 108 private:
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_OK)); 172 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_OK));
166 EXPECT_EQ(base::string16(), 173 EXPECT_EQ(base::string16(),
167 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_CANCEL)); 174 view_->GetDialogButtonLabel(ui::DIALOG_BUTTON_CANCEL));
168 EXPECT_EQ(ui::DIALOG_BUTTON_NONE, view_->GetDialogButtons()); 175 EXPECT_EQ(ui::DIALOG_BUTTON_NONE, view_->GetDialogButtons());
169 176
170 view_->Cancel(); 177 view_->Cancel();
171 view_->Accept(); 178 view_->Accept();
172 } 179 }
173 180
174 } // namespace views 181 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.cc ('k') | chrome/browser/ui/views/harmony/chrome_layout_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698