| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // all pending tasks. Can only be called from the UI thread. | 51 // all pending tasks. Can only be called from the UI thread. |
| 52 void RunAllPendingInMessageLoop(); | 52 void RunAllPendingInMessageLoop(); |
| 53 | 53 |
| 54 // Blocks the current thread until all the pending messages in the loop of the | 54 // Blocks the current thread until all the pending messages in the loop of the |
| 55 // thread |thread_id| have been processed. Can only be called from the UI | 55 // thread |thread_id| have been processed. Can only be called from the UI |
| 56 // thread. | 56 // thread. |
| 57 void RunAllPendingInMessageLoop(BrowserThread::ID thread_id); | 57 void RunAllPendingInMessageLoop(BrowserThread::ID thread_id); |
| 58 | 58 |
| 59 // Runs until both the blocking pool and the current message loop are empty | 59 // Runs until both the blocking pool and the current message loop are empty |
| 60 // (have no more scheduled tasks) and no tasks are running. | 60 // (have no more scheduled tasks) and no tasks are running. |
| 61 // |
| 62 // TODO(fdoray): Rename to RunAllTaskSchedulerTasksUntilIdle() once the blocking |
| 63 // pool is fully deprecated. https://crbug.com/667892 |
| 61 void RunAllBlockingPoolTasksUntilIdle(); | 64 void RunAllBlockingPoolTasksUntilIdle(); |
| 62 | 65 |
| 63 // Get task to quit the given RunLoop. It allows a few generations of pending | 66 // Get task to quit the given RunLoop. It allows a few generations of pending |
| 64 // tasks to run as opposed to run_loop->QuitClosure(). | 67 // tasks to run as opposed to run_loop->QuitClosure(). |
| 65 base::Closure GetDeferredQuitTaskForRunLoop(base::RunLoop* run_loop); | 68 base::Closure GetDeferredQuitTaskForRunLoop(base::RunLoop* run_loop); |
| 66 | 69 |
| 67 // Executes the specified JavaScript in the specified frame, and runs a nested | 70 // Executes the specified JavaScript in the specified frame, and runs a nested |
| 68 // MessageLoop. When the result is available, it is returned. | 71 // MessageLoop. When the result is available, it is returned. |
| 69 // This should not be used; the use of the ExecuteScript functions in | 72 // This should not be used; the use of the ExecuteScript functions in |
| 70 // browser_test_utils is preferable. | 73 // browser_test_utils is preferable. |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 void WebContentsDestroyed() override; | 307 void WebContentsDestroyed() override; |
| 305 | 308 |
| 306 base::RunLoop run_loop_; | 309 base::RunLoop run_loop_; |
| 307 | 310 |
| 308 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); | 311 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); |
| 309 }; | 312 }; |
| 310 | 313 |
| 311 } // namespace content | 314 } // namespace content |
| 312 | 315 |
| 313 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 316 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| OLD | NEW |