| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
| 6 #define BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "content/public/test/browser_test_base.h" |
| 11 |
| 12 namespace base { |
| 13 class RunLoop; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 19 |
| 20 namespace blimp { |
| 21 namespace engine { |
| 22 class BlimpEngineSession; |
| 23 } // namespace engine |
| 24 |
| 25 // Base class for tests which require a full instance of the Blimp engine. |
| 26 class BlimpBrowserTest : public content::BrowserTestBase { |
| 27 public: |
| 28 // Notify that an asynchronous test is now complete and the test runner should |
| 29 // exit. |
| 30 void QuitRunLoop(); |
| 31 |
| 32 protected: |
| 33 BlimpBrowserTest(); |
| 34 ~BlimpBrowserTest() override; |
| 35 |
| 36 // Run an asynchronous test in a nested run loop. The caller should call |
| 37 // QuitRunLoop() to notify that the test should finish. |
| 38 void RunUntilQuit(); |
| 39 |
| 40 engine::BlimpEngineSession* GetEngineSession(); |
| 41 |
| 42 // testing::Test implementation. |
| 43 void SetUp() override; |
| 44 |
| 45 // content::BrowserTestBase implementation. |
| 46 void RunTestOnMainThreadLoop() override; |
| 47 void SetUpOnMainThread() override; |
| 48 void TearDownOnMainThread() override; |
| 49 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 50 |
| 51 private: |
| 52 void OnGetEnginePort(uint16_t port); |
| 53 |
| 54 std::unique_ptr<base::RunLoop> run_loop_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest); |
| 57 }; |
| 58 |
| 59 } // namespace blimp |
| 60 |
| 61 #endif // BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
| OLD | NEW |