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

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

Issue 2256453002: Update test code to check what is displayed in chooser's table view (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698