| 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/chooser_content_view.h" | 5 #include "chrome/browser/ui/views/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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 // Select option 1. | 331 // Select option 1. |
| 332 table_view_->Select(1); | 332 table_view_->Select(1); |
| 333 | 333 |
| 334 // Update option 1. | 334 // Update option 1. |
| 335 mock_chooser_controller_->OptionUpdated(base::ASCIIToUTF16("b"), | 335 mock_chooser_controller_->OptionUpdated(base::ASCIIToUTF16("b"), |
| 336 base::ASCIIToUTF16("d")); | 336 base::ASCIIToUTF16("d")); |
| 337 | 337 |
| 338 EXPECT_EQ(1, table_view_->SelectedRowCount()); | 338 EXPECT_EQ(1, table_view_->SelectedRowCount()); |
| 339 EXPECT_EQ(1, table_view_->FirstSelectedRow()); | 339 EXPECT_EQ(1, table_view_->FirstSelectedRow()); |
| 340 EXPECT_EQ(base::ASCIIToUTF16("a"), table_model_->GetText(0, 0)); |
| 340 EXPECT_EQ(base::ASCIIToUTF16("d"), table_model_->GetText(1, 0)); | 341 EXPECT_EQ(base::ASCIIToUTF16("d"), table_model_->GetText(1, 0)); |
| 342 EXPECT_EQ(base::ASCIIToUTF16("c"), table_model_->GetText(2, 0)); |
| 341 } | 343 } |
| 342 | 344 |
| 343 TEST_F(ChooserContentViewTest, | 345 TEST_F(ChooserContentViewTest, |
| 344 AddAnOptionAndSelectItAndRemoveTheSelectedOption) { | 346 AddAnOptionAndSelectItAndRemoveTheSelectedOption) { |
| 345 EXPECT_CALL(*mock_table_view_observer_, OnSelectionChanged()).Times(2); | 347 EXPECT_CALL(*mock_table_view_observer_, OnSelectionChanged()).Times(2); |
| 346 | 348 |
| 347 mock_chooser_controller_->OptionAdded(base::ASCIIToUTF16("a")); | 349 mock_chooser_controller_->OptionAdded(base::ASCIIToUTF16("a")); |
| 348 | 350 |
| 349 // Select option 0. | 351 // Select option 0. |
| 350 table_view_->Select(0); | 352 table_view_->Select(0); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 514 |
| 513 TEST_F(ChooserContentViewTest, ClickRescanLink) { | 515 TEST_F(ChooserContentViewTest, ClickRescanLink) { |
| 514 EXPECT_CALL(*mock_chooser_controller_, RefreshOptions()).Times(1); | 516 EXPECT_CALL(*mock_chooser_controller_, RefreshOptions()).Times(1); |
| 515 chooser_content_view_->LinkClicked(nullptr, 0); | 517 chooser_content_view_->LinkClicked(nullptr, 0); |
| 516 } | 518 } |
| 517 | 519 |
| 518 TEST_F(ChooserContentViewTest, ClickStyledLabelLink) { | 520 TEST_F(ChooserContentViewTest, ClickStyledLabelLink) { |
| 519 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); | 521 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); |
| 520 styled_label_->LinkClicked(nullptr, 0); | 522 styled_label_->LinkClicked(nullptr, 0); |
| 521 } | 523 } |
| OLD | NEW |