Chromium Code Reviews| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/test/browser_test.h" | 10 #include "content/public/test/browser_test.h" |
| 11 #include "content/public/test/browser_test_base.h" | 11 #include "content/public/test/browser_test_base.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace chromecast { | 17 namespace chromecast { |
| 18 class CastContentWindow; | |
|
lcwu1
2014/10/21 19:34:56
While style guide calls for avoiding unnecessary v
gunsch
2014/10/21 19:36:19
Done.
| |
| 18 namespace shell { | 19 namespace shell { |
| 19 | 20 |
| 20 // This test allows for running an entire browser-process lifecycle per unit | 21 // This test allows for running an entire browser-process lifecycle per unit |
| 21 // test, using Chromecast's cast_shell. This starts up the shell, runs a test | 22 // test, using Chromecast's cast_shell. This starts up the shell, runs a test |
| 22 // case, then shuts down the entire shell. | 23 // case, then shuts down the entire shell. |
| 23 // Note that this process takes 7-10 seconds per test case on Chromecast, so | 24 // Note that this process takes 7-10 seconds per test case on Chromecast, so |
| 24 // fewer test cases with more assertions are preferable. | 25 // fewer test cases with more assertions are preferable. |
| 25 class ChromecastBrowserTest : public content::BrowserTestBase { | 26 class ChromecastBrowserTest : public content::BrowserTestBase { |
| 26 protected: | 27 protected: |
| 27 ChromecastBrowserTest(); | 28 ChromecastBrowserTest(); |
| 28 virtual ~ChromecastBrowserTest(); | 29 virtual ~ChromecastBrowserTest(); |
| 29 | 30 |
| 30 // testing::Test implementation: | 31 // testing::Test implementation: |
| 31 virtual void SetUp() override; | 32 virtual void SetUp() override; |
| 32 | 33 |
| 33 // BrowserTestBase implementation: | 34 // BrowserTestBase implementation: |
| 34 virtual void RunTestOnMainThreadLoop() override; | 35 virtual void RunTestOnMainThreadLoop() override; |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 void NavigateToURL(content::WebContents* window, const GURL& gurl); | 38 void NavigateToURL(content::WebContents* window, const GURL& gurl); |
| 38 | 39 |
| 39 // Creates a new window and loads about:blank. | 40 // Creates a new window and loads about:blank. |
| 40 content::WebContents* CreateBrowser(); | 41 content::WebContents* CreateBrowser(); |
| 41 | 42 |
| 42 // Returns the window for the test. | 43 // Returns the window for the test. |
| 43 content::WebContents* web_contents() const { return web_contents_.get(); } | 44 content::WebContents* web_contents() const { return web_contents_.get(); } |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 scoped_ptr<content::WebContents> web_contents_; | 47 scoped_ptr<content::WebContents> web_contents_; |
| 48 scoped_ptr<CastContentWindow> window_; | |
| 47 | 49 |
| 48 bool setup_called_; | 50 bool setup_called_; |
| 49 | 51 |
| 50 DISALLOW_COPY_AND_ASSIGN(ChromecastBrowserTest); | 52 DISALLOW_COPY_AND_ASSIGN(ChromecastBrowserTest); |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace shell | 55 } // namespace shell |
| 54 } // namespace chromecast | 56 } // namespace chromecast |
| 55 | 57 |
| 56 #endif // CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ | 58 #endif // CHROMECAST_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_ |
| OLD | NEW |