From b890108601c2300f83a4a5b661b8a68c5a70cedb Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Fri, 12 Nov 2010 01:14:28 +0000 Subject: Cleanup named shmem segment after DeferredResourceLoadingTest. Otherwise the test fails if you run it twice because it leaves stuff in the tempdir. BUG=none TEST=none Review URL: http://codereview.chromium.org/4847002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65886 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/resource_dispatcher_unittest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'chrome') diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc index f5828ff..e5d6dfd 100644 --- a/chrome/common/resource_dispatcher_unittest.cc +++ b/chrome/common/resource_dispatcher_unittest.cc @@ -30,6 +30,8 @@ static const char test_page_contents[] = "Google

Google

"; static const uint32 test_page_contents_len = arraysize(test_page_contents) - 1; +static const char kShmemSegmentName[] = "DeferredResourceLoaderTest"; + // Listens for request response data and stores it so that it can be compared // to the reference data. class TestRequestCallback : public ResourceLoaderBridge::Peer { @@ -289,13 +291,14 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, protected: virtual void SetUp() { - EXPECT_EQ(true, shared_handle_.CreateNamed("DeferredResourceLoaderTest", - false, 100)); ResourceDispatcherTest::SetUp(); + shared_handle_.Delete(kShmemSegmentName); + EXPECT_EQ(true, shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); } virtual void TearDown() { shared_handle_.Close(); + EXPECT_TRUE(shared_handle_.Delete(kShmemSegmentName)); ResourceDispatcherTest::TearDown(); } @@ -325,4 +328,3 @@ TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) { message_loop.RunAllPending(); delete bridge; } - -- cgit v1.1