| 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..a2990aa7210ee70867b00327d1d216bbd05c7ce0 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.
|
| + void OnGetEnginePortCompletion(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);
|
| };
|
|
|