OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync_file_system/drive_backend/callback_helper.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/callback_helper.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ui_task_runner, &called))); | 79 ui_task_runner, &called))); |
80 worker_task_runner->PostTask( | 80 worker_task_runner->PostTask( |
81 FROM_HERE, | 81 FROM_HERE, |
82 RelayCallbackToTaskRunner( | 82 RelayCallbackToTaskRunner( |
83 ui_task_runner, FROM_HERE, | 83 ui_task_runner, FROM_HERE, |
84 run_loop.QuitClosure())); | 84 run_loop.QuitClosure())); |
85 run_loop.Run(); | 85 run_loop.Run(); |
86 EXPECT_TRUE(called); | 86 EXPECT_TRUE(called); |
87 | 87 |
88 thread.Stop(); | 88 thread.Stop(); |
| 89 base::RunLoop().RunUntilIdle(); |
89 } | 90 } |
90 | 91 |
91 TEST(DriveBackendCallbackHelperTest, PassNullFunctionTest) { | 92 TEST(DriveBackendCallbackHelperTest, PassNullFunctionTest) { |
92 base::MessageLoop message_loop; | 93 base::MessageLoop message_loop; |
93 base::Closure closure = RelayCallbackToCurrentThread( | 94 base::Closure closure = RelayCallbackToCurrentThread( |
94 FROM_HERE, | 95 FROM_HERE, |
95 base::Closure()); | 96 base::Closure()); |
96 EXPECT_TRUE(closure.is_null()); | 97 EXPECT_TRUE(closure.is_null()); |
97 } | 98 } |
98 | 99 |
99 } // namespace drive_backend | 100 } // namespace drive_backend |
100 } // namespace sync_file_system | 101 } // namespace sync_file_system |
OLD | NEW |