Chromium Code Reviews| Index: blimp/engine/browser_tests/blimp_browser_test.h |
| diff --git a/blimp/engine/browser_tests/blimp_browser_test.h b/blimp/engine/browser_tests/blimp_browser_test.h |
| index 820ec27e9fbd7fa285924664af12d0d1818812fd..992efb0da054cfde718518f28dce4a0baa80b8f6 100644 |
| --- a/blimp/engine/browser_tests/blimp_browser_test.h |
| +++ b/blimp/engine/browser_tests/blimp_browser_test.h |
| @@ -7,6 +7,7 @@ |
| #include <memory> |
| +#include "base/synchronization/waitable_event.h" |
| #include "content/public/test/browser_test_base.h" |
| namespace base { |
| @@ -33,13 +34,17 @@ class BlimpBrowserTest : public content::BrowserTestBase { |
| // exit. |
| void QuitRunLoop(); |
| + // Tells RunUntilCompletion() to break and discontinue processing UI & IO |
| + // thread MessageLoops. |
| + void SignalCompletion(); |
| + |
| protected: |
| BlimpBrowserTest(); |
| ~BlimpBrowserTest() override; |
| - // Run an asynchronous test in a nested run loop. The caller should call |
| - // QuitRunLoop() to notify that the test should finish. |
| - void RunUntilQuit(); |
| + // Processes tasks in the UI and IO thread until SignalCompletion() is |
| + // called. |
| + void RunUntilCompletion(); |
| engine::BlimpEngineSession* GetEngineSession(); |
| @@ -50,15 +55,20 @@ class BlimpBrowserTest : public content::BrowserTestBase { |
| // content::BrowserTestBase implementation. |
| void RunTestOnMainThreadLoop() override; |
| + void SetUpCommandLine(base::CommandLine* command_line) override; |
| void SetUpOnMainThread() override; |
| void TearDownOnMainThread() override; |
| - void SetUpCommandLine(base::CommandLine* command_line) override; |
| private: |
| - void OnGetEnginePort(uint16_t port); |
| + // Receives the port number from an asynchronously connected socket. |
| + // Calls SignalCompletion() when set. |
|
Wez
2016/08/20 00:40:24
nit: I suggest being more explicit - this is used
Kevin M
2016/08/22 19:46:56
Done.
|
| + void SetEnginePort(uint16_t port); |
| uint16_t engine_port_; |
| - std::unique_ptr<base::RunLoop> run_loop_; |
| + |
| + // Used to signal the completion of asynchronous processing to |
| + // RunUntilCompletion(). |
| + base::WaitableEvent completion_event_; |
| DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest); |
| }; |