| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/device_chooser_content_view.h" | 5 #include "chrome/browser/ui/views/device_chooser_content_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 class DeviceChooserContentViewTest : public views::ViewsTestBase { | 41 class DeviceChooserContentViewTest : public views::ViewsTestBase { |
| 42 public: | 42 public: |
| 43 DeviceChooserContentViewTest() {} | 43 DeviceChooserContentViewTest() {} |
| 44 | 44 |
| 45 // views::ViewsTestBase: | 45 // views::ViewsTestBase: |
| 46 void SetUp() override { | 46 void SetUp() override { |
| 47 views::ViewsTestBase::SetUp(); | 47 views::ViewsTestBase::SetUp(); |
| 48 std::unique_ptr<MockChooserController> mock_chooser_controller( | 48 auto mock_chooser_controller = base::MakeUnique<MockChooserController>(); |
| 49 new MockChooserController(nullptr)); | |
| 50 mock_chooser_controller_ = mock_chooser_controller.get(); | 49 mock_chooser_controller_ = mock_chooser_controller.get(); |
| 51 mock_table_view_observer_ = base::MakeUnique<MockTableViewObserver>(); | 50 mock_table_view_observer_ = base::MakeUnique<MockTableViewObserver>(); |
| 52 device_chooser_content_view_ = base::MakeUnique<DeviceChooserContentView>( | 51 device_chooser_content_view_ = base::MakeUnique<DeviceChooserContentView>( |
| 53 mock_table_view_observer_.get(), std::move(mock_chooser_controller)); | 52 mock_table_view_observer_.get(), std::move(mock_chooser_controller)); |
| 54 table_view_ = device_chooser_content_view_->table_view_; | 53 table_view_ = device_chooser_content_view_->table_view_; |
| 55 ASSERT_TRUE(table_view_); | 54 ASSERT_TRUE(table_view_); |
| 56 table_model_ = table_view_->model(); | 55 table_model_ = table_view_->model(); |
| 57 ASSERT_TRUE(table_model_); | 56 ASSERT_TRUE(table_model_); |
| 58 throbber_ = device_chooser_content_view_->throbber_; | 57 throbber_ = device_chooser_content_view_->throbber_; |
| 59 ASSERT_TRUE(throbber_); | 58 ASSERT_TRUE(throbber_); |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 EXPECT_CALL(*mock_chooser_controller_, RefreshOptions()).Times(1); | 633 EXPECT_CALL(*mock_chooser_controller_, RefreshOptions()).Times(1); |
| 635 device_chooser_content_view_->StyledLabelLinkClicked( | 634 device_chooser_content_view_->StyledLabelLinkClicked( |
| 636 footnote_link_, device_chooser_content_view_->re_scan_text_range_, 0); | 635 footnote_link_, device_chooser_content_view_->re_scan_text_range_, 0); |
| 637 } | 636 } |
| 638 | 637 |
| 639 TEST_F(DeviceChooserContentViewTest, ClickGetHelpLink) { | 638 TEST_F(DeviceChooserContentViewTest, ClickGetHelpLink) { |
| 640 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); | 639 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); |
| 641 device_chooser_content_view_->StyledLabelLinkClicked( | 640 device_chooser_content_view_->StyledLabelLinkClicked( |
| 642 footnote_link_, device_chooser_content_view_->help_text_range_, 0); | 641 footnote_link_, device_chooser_content_view_->help_text_range_, 0); |
| 643 } | 642 } |
| OLD | NEW |