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

Unified Diff: ui/views/controls/table/table_view_unittest.cc

Issue 11801027: More work to make ash_unittests pass when we require context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TableViewTest by making it a ViewsTestBase. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/oak/oak_window.cc ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 797674f8a0bafb7cde23fc6a0dabb6f35d744ccb..5b14c5a9cc3793b9abe7823e15033142aa89760a 100644
--- a/ui/views/controls/table/table_view_unittest.cc
+++ b/ui/views/controls/table/table_view_unittest.cc
@@ -17,8 +17,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/models/table_model.h"
#include "ui/base/models/table_model_observer.h"
-#include "ui/base/win/scoped_ole_initializer.h"
#include "ui/views/controls/table/table_view.h"
+#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -133,7 +133,7 @@ int TestTableModel::CompareValues(int row1, int row2, int column_id) {
// TableViewTest ---------------------------------------------------------------
-class TableViewTest : public testing::Test, views::WidgetDelegate {
+class TableViewTest : public ViewsTestBase, views::WidgetDelegate {
public:
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
@@ -173,28 +173,29 @@ class TableViewTest : public testing::Test, views::WidgetDelegate {
TableView* table_;
private:
- MessageLoopForUI message_loop_;
views::Widget* window_;
- ui::ScopedOleInitializer ole_initializer_;
};
void TableViewTest::SetUp() {
+ ViewsTestBase::SetUp();
+
model_.reset(CreateModel());
std::vector<ui::TableColumn> columns;
columns.resize(2);
columns[0].id = 0;
columns[1].id = 1;
+
+ // TODO(erg): This crashes on windows. Try making this derive from ViewsTests.
table_ = new TableView(model_.get(), columns, views::ICON_AND_TEXT,
false, false, false);
- window_ = views::Widget::CreateWindowWithBounds(
- this,
- gfx::Rect(100, 100, 512, 512));
+ window_ = views::Widget::CreateWindowWithContextAndBounds(
+ this, GetContext(), gfx::Rect(100, 100, 512, 512));
}
void TableViewTest::TearDown() {
window_->Close();
- // Temporary workaround to avoid leak of RootView::pending_paint_task_.
- message_loop_.RunUntilIdle();
+
+ ViewsTestBase::TearDown();
}
void TableViewTest::VerifyViewOrder(int first, ...) {
« no previous file with comments | « ui/oak/oak_window.cc ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698