OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <atlbase.h> |
| 6 #include <atlwin.h> |
5 #include <vector> | 7 #include <vector> |
6 | 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
9 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/base/models/table_model.h" | 14 #include "ui/base/models/table_model.h" |
13 #include "ui/base/models/table_model_observer.h" | 15 #include "ui/base/models/table_model_observer.h" |
14 #include "views/controls/table/table_view.h" | 16 #include "views/controls/table/table_view.h" |
15 #include "views/controls/table/table_view2.h" | 17 #include "views/controls/table/table_view2.h" |
16 #include "views/window/window_delegate.h" | 18 #include "views/window/window_delegate.h" |
17 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
18 #include "views/window/window_win.h" | 20 #include "views/window/window_win.h" |
19 #else | 21 #else |
20 #include "views/window/window_gtk.h" | 22 #include "views/window/window_gtk.h" |
21 #endif | 23 #endif |
22 | 24 |
23 using ui::TableModel; | 25 using ui::TableModel; |
24 using ui::TableModelObserver; // TODO(beng): remove these | 26 using ui::TableModelObserver; // TODO(beng): remove these |
25 | 27 |
26 // Put the tests in the views namespace to make it easier to declare them as | 28 // Put the tests in the views namespace to make it easier to declare them as |
27 // friend classes. | 29 // friend classes. |
28 namespace views { | 30 namespace views { |
29 | 31 |
30 // TestTableModel -------------------------------------------------------------- | 32 // TestTableModel -------------------------------------------------------------- |
31 | 33 |
32 // Trivial TableModel implementation that is backed by a vector of vectors. | 34 // Trivial TableModel implementation that is backed by a vector of vectors. |
33 // Provides methods for adding/removing/changing the contents that notify the | 35 // Provides methods for adding/removing/changing the contents that notify the |
34 // observer appropriately. | 36 // observer appropriately. |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 626 |
625 table_->FocusRow(2); | 627 table_->FocusRow(2); |
626 EXPECT_EQ(2, table_->GetFirstFocusedRow()); | 628 EXPECT_EQ(2, table_->GetFirstFocusedRow()); |
627 | 629 |
628 table_->ClearRowFocus(); | 630 table_->ClearRowFocus(); |
629 EXPECT_EQ(-1, table_->GetFirstSelectedRow()); | 631 EXPECT_EQ(-1, table_->GetFirstSelectedRow()); |
630 } | 632 } |
631 #endif | 633 #endif |
632 | 634 |
633 } // namespace views | 635 } // namespace views |
OLD | NEW |