| Index: ui/views/controls/table/table_view_unittest.cc
|
| diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc
|
| index d72345c69be3b05b8091f9cbc9739b6697405dda..9bbc97b6a278d024c77f2beb6002d60b2d8780e7 100644
|
| --- a/ui/views/controls/table/table_view_unittest.cc
|
| +++ b/ui/views/controls/table/table_view_unittest.cc
|
| @@ -1023,4 +1023,19 @@ TEST_F(TableViewTest, FocusAfterRemovingAnchor) {
|
| helper_->OnFocus();
|
| }
|
|
|
| +// Tests that focusing the table will activate the first row, but only if
|
| +// there's no active row.
|
| +TEST_F(TableViewTest, InitialFocusActivatesFirstRow) {
|
| + EXPECT_EQ(-1, table_->selection_model().active());
|
| + helper_->OnFocus();
|
| + EXPECT_EQ(0, table_->selection_model().active());
|
| +
|
| + ui::ListSelectionModel new_selection;
|
| + new_selection.set_active(1);
|
| + helper_->SetSelectionModel(new_selection);
|
| + EXPECT_EQ(1, table_->selection_model().active());
|
| + helper_->OnFocus();
|
| + EXPECT_EQ(1, table_->selection_model().active());
|
| +}
|
| +
|
| } // namespace views
|
|
|