diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 02:49:57 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 02:49:57 +0000 |
commit | c454e5afa8a7027b3552e7d6976aaceb9ce11250 (patch) | |
tree | 025fc80a5004d629494db66ca98933b70509b4af /ash | |
parent | da34320a25c202e43a7b62e954c95810dec2b1a5 (diff) | |
download | chromium_src-c454e5afa8a7027b3552e7d6976aaceb9ce11250.zip chromium_src-c454e5afa8a7027b3552e7d6976aaceb9ce11250.tar.gz chromium_src-c454e5afa8a7027b3552e7d6976aaceb9ce11250.tar.bz2 |
cros: Fix FramePainterTest.Basics failure on VS2010
The test was asserting that FramePainter::instances_ was NULL, but that may not be true if another test has run that created a FramePainter. Perhaps VS2010 has changed the order in which this test runs. Removed that assertion and reworked the test slightly for clarity.
BUG=137886
TEST=ash_unittests FramePainterTest.Basics
Review URL: https://chromiumcodereview.appspot.com/10808015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/wm/frame_painter_unittest.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc index d0b4bdf..62e98dc 100644 --- a/ash/wm/frame_painter_unittest.cc +++ b/ash/wm/frame_painter_unittest.cc @@ -54,18 +54,17 @@ namespace ash { typedef ash::test::AshTestBase FramePainterTest; TEST_F(FramePainterTest, Basics) { - // We start with a null instances pointer, as we don't initialize until the - // first FramePainter is created. - EXPECT_FALSE(FramePainter::instances_); + // Other tests might have created a FramePainter, so we cannot assert that + // FramePainter::instances_ is NULL here. // Creating a painter bumps the instance count. - { - FramePainter painter; - EXPECT_TRUE(FramePainter::instances_); - EXPECT_EQ(1u, FramePainter::instances_->size()); - } + scoped_ptr<FramePainter> painter(new FramePainter); + ASSERT_TRUE(FramePainter::instances_); + EXPECT_EQ(1u, FramePainter::instances_->size()); + // Destroying that painter leaves a valid pointer but no instances. - EXPECT_TRUE(FramePainter::instances_); + painter.reset(); + ASSERT_TRUE(FramePainter::instances_); EXPECT_EQ(0u, FramePainter::instances_->size()); } |