| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_TEST_CONTENT_BROWSER_TEST_H_ | 5 #ifndef CONTENT_TEST_CONTENT_BROWSER_TEST_H_ |
| 6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_H_ | 6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/public/test/browser_test.h" | 9 #include "content/public/test/browser_test.h" |
| 10 #include "content/public/test/browser_test_base.h" | 10 #include "content/public/test/browser_test_base.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class ContentRendererClient; | |
| 16 class Shell; | 15 class Shell; |
| 17 class ShellMainDelegate; | |
| 18 | 16 |
| 19 class ContentBrowserTest : public BrowserTestBase { | 17 class ContentBrowserTest : public BrowserTestBase { |
| 20 protected: | 18 protected: |
| 21 ContentBrowserTest(); | 19 ContentBrowserTest(); |
| 22 virtual ~ContentBrowserTest(); | 20 virtual ~ContentBrowserTest(); |
| 23 | 21 |
| 24 // testing::Test: | 22 // testing::Test: |
| 25 virtual void SetUp() OVERRIDE; | 23 virtual void SetUp() OVERRIDE; |
| 26 virtual void TearDown() OVERRIDE; | 24 virtual void TearDown() OVERRIDE; |
| 27 | 25 |
| 28 // BrowserTestBase: | 26 // BrowserTestBase: |
| 29 virtual void RunTestOnMainThreadLoop() OVERRIDE; | 27 virtual void RunTestOnMainThreadLoop() OVERRIDE; |
| 30 | 28 |
| 31 // Must be called before or during setup. | |
| 32 void SetContentRendererClient( | |
| 33 scoped_ptr<ContentRendererClient> renderer_client); | |
| 34 | |
| 35 protected: | 29 protected: |
| 36 // Creates a new window and loads about:blank. | 30 // Creates a new window and loads about:blank. |
| 37 Shell* CreateBrowser(); | 31 Shell* CreateBrowser(); |
| 38 | 32 |
| 39 // Creates an off-the-record window and loads about:blank. | 33 // Creates an off-the-record window and loads about:blank. |
| 40 Shell* CreateOffTheRecordBrowser(); | 34 Shell* CreateOffTheRecordBrowser(); |
| 41 | 35 |
| 42 // Returns the window for the test. | 36 // Returns the window for the test. |
| 43 Shell* shell() const { return shell_; } | 37 Shell* shell() const { return shell_; } |
| 44 | 38 |
| 45 private: | 39 private: |
| 46 scoped_ptr<ShellMainDelegate> shell_main_delegate_; | |
| 47 | |
| 48 Shell* shell_; | 40 Shell* shell_; |
| 49 | 41 |
| 50 bool setup_called_; | 42 bool setup_called_; |
| 51 | |
| 52 // ContentRendererClient when running in single-process mode. | |
| 53 scoped_ptr<ContentRendererClient> single_process_renderer_client_; | |
| 54 }; | 43 }; |
| 55 | 44 |
| 56 } // namespace content | 45 } // namespace content |
| 57 | 46 |
| 58 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_H_ | 47 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_H_ |
| OLD | NEW |