| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | |
| 10 #include <atlbase.h> // NOLINT | 9 #include <atlbase.h> // NOLINT |
| 11 #include <atlwin.h> // NOLINT | 10 #include <atlwin.h> // NOLINT |
| 12 #endif | |
| 13 | |
| 14 #include <vector> // NOLINT | 11 #include <vector> // NOLINT |
| 15 | 12 |
| 16 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 17 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 18 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 19 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "ui/base/models/table_model.h" | 18 #include "ui/base/models/table_model.h" |
| 22 #include "ui/base/models/table_model_observer.h" | 19 #include "ui/base/models/table_model_observer.h" |
| 23 #include "ui/views/controls/table/table_view.h" | 20 #include "ui/views/controls/table/table_view.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 123 } |
| 127 | 124 |
| 128 void TestTableModel::SetObserver(ui::TableModelObserver* observer) { | 125 void TestTableModel::SetObserver(ui::TableModelObserver* observer) { |
| 129 observer_ = observer; | 126 observer_ = observer; |
| 130 } | 127 } |
| 131 | 128 |
| 132 int TestTableModel::CompareValues(int row1, int row2, int column_id) { | 129 int TestTableModel::CompareValues(int row1, int row2, int column_id) { |
| 133 return rows_[row1][column_id] - rows_[row2][column_id]; | 130 return rows_[row1][column_id] - rows_[row2][column_id]; |
| 134 } | 131 } |
| 135 | 132 |
| 136 #if defined(OS_WIN) | |
| 137 | |
| 138 // TableViewTest --------------------------------------------------------------- | 133 // TableViewTest --------------------------------------------------------------- |
| 139 | 134 |
| 140 class TableViewTest : public testing::Test, views::WidgetDelegate { | 135 class TableViewTest : public testing::Test, views::WidgetDelegate { |
| 141 public: | 136 public: |
| 142 virtual void SetUp() OVERRIDE; | 137 virtual void SetUp() OVERRIDE; |
| 143 virtual void TearDown() OVERRIDE; | 138 virtual void TearDown() OVERRIDE; |
| 144 | 139 |
| 145 virtual views::View* GetContentsView() OVERRIDE { | 140 virtual views::View* GetContentsView() OVERRIDE { |
| 146 return table_; | 141 return table_; |
| 147 } | 142 } |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 ASSERT_TRUE(table_->SelectMultiple(2, 0)); | 453 ASSERT_TRUE(table_->SelectMultiple(2, 0)); |
| 459 VerifySelectedRows(2, 0, -1); | 454 VerifySelectedRows(2, 0, -1); |
| 460 } | 455 } |
| 461 | 456 |
| 462 // Crashing: http://crbug.com/45015 | 457 // Crashing: http://crbug.com/45015 |
| 463 TEST_F(NullModelTableViewTest, DISABLED_NullModel) { | 458 TEST_F(NullModelTableViewTest, DISABLED_NullModel) { |
| 464 // There's nothing explicit to test. If there is a bug in TableView relating | 459 // There's nothing explicit to test. If there is a bug in TableView relating |
| 465 // to a NULL model we'll crash. | 460 // to a NULL model we'll crash. |
| 466 } | 461 } |
| 467 | 462 |
| 468 #endif // OS_WIN | |
| 469 | |
| 470 } // namespace views | 463 } // namespace views |
| OLD | NEW |