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

Unified Diff: cc/layers/delegated_frame_resource_collection_unittest.cc

Issue 485043003: cc: Use correct message loop proxy in BlockingTaskRunner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Help gn deal with it. Created 6 years, 4 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
Index: cc/layers/delegated_frame_resource_collection_unittest.cc
diff --git a/cc/layers/delegated_frame_resource_collection_unittest.cc b/cc/layers/delegated_frame_resource_collection_unittest.cc
index 9f131dfbf4375b029e4347b372ab2546ae7473b7..2a9f29f3ef31cea93793d6825810407bafa18344 100644
--- a/cc/layers/delegated_frame_resource_collection_unittest.cc
+++ b/cc/layers/delegated_frame_resource_collection_unittest.cc
@@ -9,6 +9,7 @@
#include "cc/layers/delegated_frame_resource_collection.h"
#include "cc/resources/returned_resource.h"
#include "cc/resources/transferable_resource.h"
+#include "cc/trees/blocking_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -78,10 +79,12 @@ TEST_F(DelegatedFrameResourceCollectionTest, NoRef) {
EXPECT_TRUE(resource_collection_->HasOneRef());
}
-void ReturnResourcesOnThread(ReturnCallback callback,
- const ReturnedResourceArray& resources,
- base::WaitableEvent* event) {
- callback.Run(resources);
+void ReturnResourcesOnThread(
+ ReturnCallback callback,
+ const ReturnedResourceArray& resources,
+ base::WaitableEvent* event,
+ scoped_refptr<BlockingTaskRunner> main_thread_task_runner) {
+ callback.Run(resources, main_thread_task_runner);
if (event)
event->Wait();
}
@@ -92,6 +95,8 @@ void ReturnResourcesOnThread(ReturnCallback callback,
TEST_F(DelegatedFrameResourceCollectionTest, Thread) {
base::Thread thread("test thread");
thread.Start();
+ scoped_refptr<BlockingTaskRunner> main_thread_task_runner(
+ BlockingTaskRunner::Create(base::MessageLoopProxy::current()));
TransferableResourceArray resources = CreateResourceArray();
resource_collection_->ReceivedResources(resources);
@@ -112,7 +117,8 @@ TEST_F(DelegatedFrameResourceCollectionTest, Thread) {
&ReturnResourcesOnThread,
resource_collection_->GetReturnResourcesCallbackForImplThread(),
returned_resources,
- &event));
+ &event,
+ main_thread_task_runner));
run_loop.Run();
}
@@ -151,7 +157,8 @@ TEST_F(DelegatedFrameResourceCollectionTest, Thread) {
base::Bind(&ReturnResourcesOnThread,
return_callback,
returned_resources,
- null_event));
+ null_event,
+ main_thread_task_runner));
thread.Stop();
}

Powered by Google App Engine
This is Rietveld 408576698