summaryrefslogtreecommitdiffstats
path: root/views/controls/tabbed_pane
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-14 18:18:38 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-14 18:18:38 +0000
commitfc7727d03bb4d6125a2c9b03c6029684858fb441 (patch)
treecba1f075874488ba97183ed319d4ce0023129867 /views/controls/tabbed_pane
parent239b3ae232a2fe5335f17d4a2aead54dc2cf157e (diff)
downloadchromium_src-fc7727d03bb4d6125a2c9b03c6029684858fb441.zip
chromium_src-fc7727d03bb4d6125a2c9b03c6029684858fb441.tar.gz
chromium_src-fc7727d03bb4d6125a2c9b03c6029684858fb441.tar.bz2
Fix test setup for TabbedPaneTest.
Previously, the test didn't derive from ViewsTestBase, resulting in OLE not getting initialized, which would lead to failure registering drop targets. BUG=chromium:104067 TEST=TabbedPaneTest.* doesn't crash. Review URL: http://codereview.chromium.org/8567002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/tabbed_pane')
-rw-r--r--views/controls/tabbed_pane/tabbed_pane_unittest.cc26
1 files changed, 7 insertions, 19 deletions
diff --git a/views/controls/tabbed_pane/tabbed_pane_unittest.cc b/views/controls/tabbed_pane/tabbed_pane_unittest.cc
index a637c3ed..59e3bfc 100644
--- a/views/controls/tabbed_pane/tabbed_pane_unittest.cc
+++ b/views/controls/tabbed_pane/tabbed_pane_unittest.cc
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "views/controls/tabbed_pane/tabbed_pane.h"
+#include "views/test/views_test_base.h"
#include "views/widget/widget.h"
#include "views/widget/widget_delegate.h"
@@ -27,19 +28,16 @@ class FixedSizeView : public View {
DISALLOW_COPY_AND_ASSIGN(FixedSizeView);
};
-class TabbedPaneTest : public testing::Test,
+class TabbedPaneTest : public ViewsTestBase,
public WidgetDelegate {
public:
TabbedPaneTest() {}
TabbedPane* tabbed_pane_;
- void RunAllPending() {
- message_loop_.RunAllPending();
- }
-
private:
virtual void SetUp() OVERRIDE {
+ ViewsTestBase::SetUp();
tabbed_pane_ = new TabbedPane();
window_ = Widget::CreateWindowWithBounds(this, gfx::Rect(0, 0, 100, 100));
window_->Show();
@@ -47,7 +45,7 @@ class TabbedPaneTest : public testing::Test,
virtual void TearDown() OVERRIDE {
window_->Close();
- message_loop_.RunAllPending();
+ ViewsTestBase::TearDown();
}
virtual views::View* GetContentsView() OVERRIDE {
@@ -60,23 +58,13 @@ class TabbedPaneTest : public testing::Test,
return tabbed_pane_->GetWidget();
}
- MessageLoopForUI message_loop_;
Widget* window_;
DISALLOW_COPY_AND_ASSIGN(TabbedPaneTest);
};
-#if defined(OS_WIN)
-// These test are failing and crash on Win7. See http://crbug.com/104067
-#define MAYBE_SizeAndLayout DISABLED_SizeAndLayout
-#define MAYBE_AddRemove DISABLED_AddRemove
-#else
-#define MAYBE_SizeAndLayout SizeAndLayout
-#define MAYBE_AddRemove AddRemove
-#endif
-
// Tests that TabbedPane::GetPreferredSize() and TabbedPane::Layout().
-TEST_F(TabbedPaneTest, MAYBE_SizeAndLayout) {
+TEST_F(TabbedPaneTest, SizeAndLayout) {
View* child1 = new FixedSizeView(gfx::Size(20, 10));
tabbed_pane_->AddTab(ASCIIToUTF16("tab1"), child1);
View* child2 = new FixedSizeView(gfx::Size(5, 5));
@@ -90,7 +78,7 @@ TEST_F(TabbedPaneTest, MAYBE_SizeAndLayout) {
// The bounds of our children should be smaller than the tabbed pane's bounds.
tabbed_pane_->SetBounds(0, 0, 100, 200);
- RunAllPending();
+ RunPendingMessages();
gfx::Rect bounds(child1->bounds());
EXPECT_GT(bounds.width(), 0);
EXPECT_LT(bounds.width(), 100);
@@ -102,7 +90,7 @@ TEST_F(TabbedPaneTest, MAYBE_SizeAndLayout) {
EXPECT_EQ(bounds, child2->bounds());
}
-TEST_F(TabbedPaneTest, MAYBE_AddRemove) {
+TEST_F(TabbedPaneTest, AddRemove) {
View* tab0 = new View;
tabbed_pane_->AddTab(ASCIIToUTF16("tab0"), tab0);
EXPECT_EQ(tab0, tabbed_pane_->GetSelectedTab());