Chromium Code Reviews| Index: blimp/test/browser_tests/blimp_browser_test.h |
| diff --git a/blimp/test/browser_tests/blimp_browser_test.h b/blimp/test/browser_tests/blimp_browser_test.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c39475c078f6a052b99cb2bd97bb2309606049b5 |
| --- /dev/null |
| +++ b/blimp/test/browser_tests/blimp_browser_test.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
| +#define BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
| + |
| +#include <memory> |
| +#include "content/public/test/browser_test_base.h" |
|
mmenke
2016/05/03 21:21:53
nit: Blank line between standard and chrome heade
haibinlu
2016/05/04 21:55:23
Done.
|
| + |
| +namespace base { |
| +class RunLoop; |
| +} |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace blimp { |
| + |
| +// Base class for tests which require a full instance of the Blimp engine. |
| +class BlimpBrowserTest : public content::BrowserTestBase { |
| + public: |
| + // Notify that an asynchronous test is now complete and the test runner should |
| + // exit. |
| + void QuitRunLoop(); |
| + |
| + 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(); |
| + |
| + // testing::Test implementation. |
| + void SetUp() override; |
| + |
| + // content::BrowserTestBase implementation. |
| + void RunTestOnMainThreadLoop() override; |
| + void SetUpOnMainThread() override; |
| + void TearDownOnMainThread() override; |
| + void SetUpCommandLine(base::CommandLine* command_line) override; |
| + |
| + private: |
| + std::unique_ptr<base::RunLoop> run_loop_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest); |
| +}; |
| + |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |