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

Unified Diff: components/sync/base/bind_to_task_runner_unittest.cc

Issue 2257523003: [Sync] Move StartAssociation from NonUIDataTypeController to SharedChangeProcessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move local_service_ WeakPtr to SharedChangeProcessor. Created 4 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
« no previous file with comments | « components/sync/base/bind_to_task_runner.h ('k') | components/sync/driver/non_ui_data_type_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/base/bind_to_task_runner_unittest.cc
diff --git a/chromecast/base/bind_to_task_runner_unittest.cc b/components/sync/base/bind_to_task_runner_unittest.cc
similarity index 91%
copy from chromecast/base/bind_to_task_runner_unittest.cc
copy to components/sync/base/bind_to_task_runner_unittest.cc
index 753fd1c0f78f14a6eec51f6e9bc86285a4ae910f..6798960b685164a1e1a617c07c53f32cabf2f895 100644
--- a/chromecast/base/bind_to_task_runner_unittest.cc
+++ b/components/sync/base/bind_to_task_runner_unittest.cc
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chromecast/base/bind_to_task_runner.h"
+#include "components/sync/base/bind_to_task_runner.h"
#include <utility>
#include "base/memory/free_deleter.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace chromecast {
+namespace syncer {
void BoundBoolSet(bool* var, bool val) {
*var = val;
@@ -55,7 +56,7 @@ TEST_F(BindToTaskRunnerTest, Closure) {
base::Bind(&base::WaitableEvent::Signal, Unretained(&waiter)));
cb.Run();
EXPECT_FALSE(waiter.IsSignaled());
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(waiter.IsSignaled());
}
@@ -65,7 +66,7 @@ TEST_F(BindToTaskRunnerTest, Bool) {
BindToCurrentThread(base::Bind(&BoundBoolSet, &bool_var));
cb.Run(true);
EXPECT_FALSE(bool_var);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_var);
}
@@ -76,7 +77,7 @@ TEST_F(BindToTaskRunnerTest, BoundScopedPtrBool) {
&BoundBoolSetFromScopedPtr, &bool_val, base::Passed(&scoped_ptr_bool)));
cb.Run();
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -87,7 +88,7 @@ TEST_F(BindToTaskRunnerTest, PassedScopedPtrBool) {
BindToCurrentThread(base::Bind(&BoundBoolSetFromScopedPtr, &bool_val));
cb.Run(std::move(scoped_ptr_bool));
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -100,7 +101,7 @@ TEST_F(BindToTaskRunnerTest, BoundScopedArrayBool) {
base::Passed(&scoped_array_bool)));
cb.Run();
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -112,7 +113,7 @@ TEST_F(BindToTaskRunnerTest, PassedScopedArrayBool) {
BindToCurrentThread(base::Bind(&BoundBoolSetFromScopedArray, &bool_val));
cb.Run(std::move(scoped_array_bool));
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -126,7 +127,7 @@ TEST_F(BindToTaskRunnerTest, BoundScopedPtrFreeDeleterBool) {
base::Passed(&scoped_ptr_free_deleter_bool)));
cb.Run();
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -140,7 +141,7 @@ TEST_F(BindToTaskRunnerTest, PassedScopedPtrFreeDeleterBool) {
base::Bind(&BoundBoolSetFromScopedPtrFreeDeleter, &bool_val));
cb.Run(std::move(scoped_ptr_free_deleter_bool));
EXPECT_FALSE(bool_val);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_val);
}
@@ -152,7 +153,7 @@ TEST_F(BindToTaskRunnerTest, BoolConstRef) {
base::Bind(&BoundBoolSetFromConstRef, &bool_var, true_ref));
cb.Run();
EXPECT_FALSE(bool_var);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(bool_var);
}
@@ -164,9 +165,9 @@ TEST_F(BindToTaskRunnerTest, Integers) {
cb.Run(1, -1);
EXPECT_EQ(a, 0);
EXPECT_EQ(b, 0);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(a, 1);
EXPECT_EQ(b, -1);
}
-} // namespace chromecast
+} // namespace syncer
« no previous file with comments | « components/sync/base/bind_to_task_runner.h ('k') | components/sync/driver/non_ui_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698