diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 16:45:59 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 16:45:59 +0000 |
commit | 4a58c42d044631d9ca3e1f80747e3089a8a87c05 (patch) | |
tree | c25e5bff5877956b5dfdb438b05004e121e33b30 /cc/layers | |
parent | 78127e620e70c4bdf030ebd8e54598c9182b0e4e (diff) | |
download | chromium_src-4a58c42d044631d9ca3e1f80747e3089a8a87c05.zip chromium_src-4a58c42d044631d9ca3e1f80747e3089a8a87c05.tar.gz chromium_src-4a58c42d044631d9ca3e1f80747e3089a8a87c05.tar.bz2 |
Fix DelegatedFrameResourceCollectionTest.Thread
In the previous code, depending on ordering, we might Signal the event twice
before we Wait, causing the second Wait to never finish. We don't actually need
the event the second time, so don't use it then.
BUG=313441
Review URL: https://codereview.chromium.org/46473003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r-- | cc/layers/delegated_frame_resource_collection_unittest.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cc/layers/delegated_frame_resource_collection_unittest.cc b/cc/layers/delegated_frame_resource_collection_unittest.cc index ace3def..29f0eb5 100644 --- a/cc/layers/delegated_frame_resource_collection_unittest.cc +++ b/cc/layers/delegated_frame_resource_collection_unittest.cc @@ -82,13 +82,14 @@ void ReturnResourcesOnThread(ReturnCallback callback, const ReturnedResourceArray& resources, base::WaitableEvent* event) { callback.Run(resources); - event->Wait(); + if (event) + event->Wait(); } // Tests that the ReturnCallback can run safely on threads even after the // last references to the collection were dropped. // Flaky: crbug.com/313441 -TEST_F(DelegatedFrameResourceCollectionTest, DISABLED_Thread) { +TEST_F(DelegatedFrameResourceCollectionTest, Thread) { base::Thread thread("test thread"); thread.Start(); @@ -145,12 +146,12 @@ TEST_F(DelegatedFrameResourceCollectionTest, DISABLED_Thread) { EXPECT_TRUE(returned_resources_[0].lost); returned_resources_.clear(); + base::WaitableEvent* null_event = NULL; thread.message_loop()->PostTask(FROM_HERE, base::Bind(&ReturnResourcesOnThread, return_callback, returned_resources, - &event)); - event.Signal(); + null_event)); thread.Stop(); } |