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