| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ | 5 #ifndef CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ |
| 6 #define CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ | 6 #define CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/public/test/browser_test.h" | 11 #include "content/public/test/browser_test.h" |
| 12 #include "content/public/test/browser_test_base.h" | 12 #include "content/public/test/browser_test_base.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class WebContents; | 15 class WebContents; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace chromecast { | 18 namespace chromecast { |
| 19 namespace shell { | 19 namespace shell { |
| 20 class ChromecastBrowserTestHelper; | 20 |
| 21 class CastContentWindow; |
| 21 | 22 |
| 22 // This test allows for running an entire browser-process lifecycle per unit | 23 // This test allows for running an entire browser-process lifecycle per unit |
| 23 // test, using Chromecast's cast_shell. This starts up the shell, runs a test | 24 // test, using Chromecast's cast_shell. This starts up the shell, runs a test |
| 24 // case, then shuts down the entire shell. | 25 // case, then shuts down the entire shell. |
| 25 // Note that this process takes 7-10 seconds per test case on Chromecast, so | 26 // Note that this process takes 7-10 seconds per test case on Chromecast, so |
| 26 // fewer test cases with more assertions are preferable. | 27 // fewer test cases with more assertions are preferable. |
| 27 class ChromecastBrowserTest : public content::BrowserTestBase { | 28 class ChromecastBrowserTest : public content::BrowserTestBase { |
| 28 protected: | 29 protected: |
| 29 ChromecastBrowserTest(); | 30 ChromecastBrowserTest(); |
| 30 ~ChromecastBrowserTest() override; | 31 ~ChromecastBrowserTest() override; |
| 31 | 32 |
| 32 // testing::Test implementation: | 33 // content::BrowserTestBase implementation: |
| 33 void SetUp() override; | 34 void SetUp() override; |
| 34 | 35 void TearDownOnMainThread() override; |
| 35 // BrowserTestBase implementation: | |
| 36 void RunTestOnMainThreadLoop() override; | 36 void RunTestOnMainThreadLoop() override; |
| 37 | 37 |
| 38 protected: | 38 content::WebContents* NavigateToURL(const GURL& url); |
| 39 std::unique_ptr<ChromecastBrowserTestHelper> helper_; | |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 bool setup_called_; | 41 std::unique_ptr<CastContentWindow> window_; |
| 42 std::unique_ptr<content::WebContents> web_contents_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ChromecastBrowserTest); | 44 DISALLOW_COPY_AND_ASSIGN(ChromecastBrowserTest); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace shell | 47 } // namespace shell |
| 48 } // namespace chromecast | 48 } // namespace chromecast |
| 49 | 49 |
| 50 #endif // CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ | 50 #endif // CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ |
| OLD | NEW |