| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 #if defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) | 194 #if defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) |
| 195 TEST_F(RunLoopTest, DisallowWaitingDeathTest) { | 195 TEST_F(RunLoopTest, DisallowWaitingDeathTest) { |
| 196 EXPECT_TRUE(RunLoop::IsNestingAllowedOnCurrentThread()); | 196 EXPECT_TRUE(RunLoop::IsNestingAllowedOnCurrentThread()); |
| 197 RunLoop::DisallowNestingOnCurrentThread(); | 197 RunLoop::DisallowNestingOnCurrentThread(); |
| 198 EXPECT_FALSE(RunLoop::IsNestingAllowedOnCurrentThread()); | 198 EXPECT_FALSE(RunLoop::IsNestingAllowedOnCurrentThread()); |
| 199 | 199 |
| 200 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, Bind([]() { | 200 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, Bind([]() { |
| 201 RunLoop nested_run_loop; | 201 RunLoop nested_run_loop; |
| 202 nested_run_loop.RunUntilIdle(); | 202 nested_run_loop.RunUntilIdle(); |
| 203 })); | 203 })); |
| 204 EXPECT_DEATH({ run_loop_.RunUntilIdle(); }, "Check failed"); | 204 EXPECT_DEATH({ run_loop_.RunUntilIdle(); }, ""); |
| 205 } | 205 } |
| 206 #endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) | 206 #endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) |
| 207 | 207 |
| 208 } // namespace base | 208 } // namespace base |
| OLD | NEW |