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_PUBLIC_TEST_CONTENT_BROWSER_TEST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_H_ |
6 #define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_H_ | 6 #define CONTENT_PUBLIC_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 namespace content { | 12 namespace content { |
13 class Shell; | 13 class Shell; |
14 class ShellMainDelegate; | 14 class ShellMainDelegate; |
15 | 15 |
16 // Base class for browser tests which use content_shell. | 16 // Base class for browser tests which use content_shell. |
17 class ContentBrowserTest : public BrowserTestBase { | 17 class ContentBrowserTest : public BrowserTestBase { |
18 protected: | 18 protected: |
19 ContentBrowserTest(); | 19 ContentBrowserTest(); |
20 virtual ~ContentBrowserTest(); | 20 virtual ~ContentBrowserTest(); |
21 | 21 |
22 // testing::Test: | 22 // testing::Test: |
23 virtual void SetUp() OVERRIDE; | 23 virtual void SetUp() override; |
24 virtual void TearDown() OVERRIDE; | 24 virtual void TearDown() override; |
25 | 25 |
26 // BrowserTestBase: | 26 // BrowserTestBase: |
27 virtual void RunTestOnMainThreadLoop() OVERRIDE; | 27 virtual void RunTestOnMainThreadLoop() override; |
28 | 28 |
29 protected: | 29 protected: |
30 // Creates a new window and loads about:blank. | 30 // Creates a new window and loads about:blank. |
31 Shell* CreateBrowser(); | 31 Shell* CreateBrowser(); |
32 | 32 |
33 // Creates an off-the-record window and loads about:blank. | 33 // Creates an off-the-record window and loads about:blank. |
34 Shell* CreateOffTheRecordBrowser(); | 34 Shell* CreateOffTheRecordBrowser(); |
35 | 35 |
36 // Returns the window for the test. | 36 // Returns the window for the test. |
37 Shell* shell() const { return shell_; } | 37 Shell* shell() const { return shell_; } |
38 | 38 |
39 private: | 39 private: |
40 Shell* shell_; | 40 Shell* shell_; |
41 | 41 |
42 bool setup_called_; | 42 bool setup_called_; |
43 | 43 |
44 #if defined(OS_ANDROID) | 44 #if defined(OS_ANDROID) |
45 // For all other platforms, this is done automatically when calling into | 45 // For all other platforms, this is done automatically when calling into |
46 // ContentMain. For Android we set things up manually. | 46 // ContentMain. For Android we set things up manually. |
47 scoped_ptr<ShellMainDelegate> shell_main_delegate_; | 47 scoped_ptr<ShellMainDelegate> shell_main_delegate_; |
48 #endif | 48 #endif |
49 }; | 49 }; |
50 | 50 |
51 } // namespace content | 51 } // namespace content |
52 | 52 |
53 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_H_ | 53 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_H_ |
OLD | NEW |