Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Side by Side Diff: chrome/test/base/browser_with_test_window_test.h

Issue 9645003: Introduce abstractions to allow embedders to test RenderViewHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 5 #ifndef CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/test/base/test_browser_window.h" 11 #include "chrome/test/base/test_browser_window.h"
12 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
13 #include "content/browser/renderer_host/test_render_view_host.h"
14 #include "content/test/test_browser_thread.h" 13 #include "content/test/test_browser_thread.h"
14 #include "content/test/test_renderer_host.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 class GURL; 17 class GURL;
18 18
19 #if defined(USE_AURA) 19 #if defined(USE_AURA)
20 namespace aura { 20 namespace aura {
21 class RootWindow; 21 class RootWindow;
22 namespace test { 22 namespace test {
23 class TestActivationClient; 23 class TestActivationClient;
24 class TestStackingClient; 24 class TestStackingClient;
(...skipping 29 matching lines...) Expand all
54 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible 54 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible
55 // for creating the various objects of this class. 55 // for creating the various objects of this class.
56 class BrowserWithTestWindowTest : public testing::Test { 56 class BrowserWithTestWindowTest : public testing::Test {
57 public: 57 public:
58 BrowserWithTestWindowTest(); 58 BrowserWithTestWindowTest();
59 virtual ~BrowserWithTestWindowTest(); 59 virtual ~BrowserWithTestWindowTest();
60 60
61 virtual void SetUp() OVERRIDE; 61 virtual void SetUp() OVERRIDE;
62 virtual void TearDown() OVERRIDE; 62 virtual void TearDown() OVERRIDE;
63 63
64 // Returns the current RenderViewHost for the current tab as a
65 // TestRenderViewHost.
66 content::TestRenderViewHost* TestRenderViewHostForTab(
67 content::WebContents* web_contents);
68
69 protected: 64 protected:
70 TestBrowserWindow* window() const { return window_.get(); } 65 TestBrowserWindow* window() const { return window_.get(); }
71 void set_window(TestBrowserWindow* window) { 66 void set_window(TestBrowserWindow* window) {
72 window_.reset(window); 67 window_.reset(window);
73 } 68 }
74 69
75 Browser* browser() const { return browser_.get(); } 70 Browser* browser() const { return browser_.get(); }
76 void set_browser(Browser* browser) { 71 void set_browser(Browser* browser) {
77 browser_.reset(browser); 72 browser_.reset(browser);
78 } 73 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // We need to create a MessageLoop, otherwise a bunch of things fails. 109 // We need to create a MessageLoop, otherwise a bunch of things fails.
115 MessageLoopForUI ui_loop_; 110 MessageLoopForUI ui_loop_;
116 content::TestBrowserThread ui_thread_; 111 content::TestBrowserThread ui_thread_;
117 content::TestBrowserThread file_thread_; 112 content::TestBrowserThread file_thread_;
118 content::TestBrowserThread file_user_blocking_thread_; 113 content::TestBrowserThread file_user_blocking_thread_;
119 114
120 scoped_ptr<TestingProfile> profile_; 115 scoped_ptr<TestingProfile> profile_;
121 scoped_ptr<TestBrowserWindow> window_; 116 scoped_ptr<TestBrowserWindow> window_;
122 scoped_ptr<Browser> browser_; 117 scoped_ptr<Browser> browser_;
123 118
124 MockRenderProcessHostFactory rph_factory_; 119 // The existence of this object enables tests via
125 TestRenderViewHostFactory rvh_factory_; 120 // RenderViewHostTester.
121 content::RenderViewHostTestEnabler rvh_test_enabler_;
126 122
127 #if defined(USE_AURA) 123 #if defined(USE_AURA)
128 scoped_ptr<aura::RootWindow> root_window_; 124 scoped_ptr<aura::RootWindow> root_window_;
129 scoped_ptr<aura::test::TestActivationClient> test_activation_client_; 125 scoped_ptr<aura::test::TestActivationClient> test_activation_client_;
130 scoped_ptr<aura::test::TestStackingClient> test_stacking_client_; 126 scoped_ptr<aura::test::TestStackingClient> test_stacking_client_;
131 #endif 127 #endif
132 128
133 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); 129 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest);
134 }; 130 };
135 131
136 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 132 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app_unittest.cc ('k') | chrome/test/base/browser_with_test_window_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698