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

Side by Side Diff: content/test/test_renderer_host.cc

Issue 9696008: TestScreen shouldn't be marked aura export (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again. 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
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/test/test_renderer_host.h" 5 #include "content/test/test_renderer_host.h"
6 6
7 #include "content/browser/renderer_host/mock_render_process_host.h" 7 #include "content/browser/renderer_host/mock_render_process_host.h"
8 #include "content/browser/renderer_host/render_view_host_factory.h" 8 #include "content/browser/renderer_host/render_view_host_factory.h"
9 #include "content/browser/renderer_host/test_render_view_host.h" 9 #include "content/browser/renderer_host/test_render_view_host.h"
10 #include "content/browser/site_instance_impl.h" 10 #include "content/browser/site_instance_impl.h"
11 #include "content/browser/tab_contents/navigation_entry_impl.h" 11 #include "content/browser/tab_contents/navigation_entry_impl.h"
12 #include "content/browser/tab_contents/test_tab_contents.h" 12 #include "content/browser/tab_contents/test_tab_contents.h"
13 #include "content/test/test_browser_context.h" 13 #include "content/test/test_browser_context.h"
14 14
15 #if defined(USE_AURA) 15 #if defined(USE_AURA)
16 #include "ui/aura/root_window.h" 16 #include "ui/aura/root_window.h"
17 #include "ui/aura/test/test_screen.h"
17 #include "ui/aura/test/test_stacking_client.h" 18 #include "ui/aura/test/test_stacking_client.h"
18 #endif 19 #endif
19 20
20 namespace content { 21 namespace content {
21 22
22 // Manages creation of the RenderViewHosts using our special subclass. This 23 // Manages creation of the RenderViewHosts using our special subclass. This
23 // automatically registers itself when it goes in scope, and unregisters itself 24 // automatically registers itself when it goes in scope, and unregisters itself
24 // when it goes out of scope. Since you can't have more than one factory 25 // when it goes out of scope. Since you can't have more than one factory
25 // registered at a time, you can only have one of these objects at a time. 26 // registered at a time, you can only have one of these objects at a time.
26 // 27 //
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 NavigationEntry* entry = controller().GetLastCommittedEntry(); 175 NavigationEntry* entry = controller().GetLastCommittedEntry();
175 DCHECK(entry); 176 DCHECK(entry);
176 controller().Reload(false); 177 controller().Reload(false);
177 static_cast<TestRenderViewHost*>( 178 static_cast<TestRenderViewHost*>(
178 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL()); 179 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL());
179 } 180 }
180 181
181 void RenderViewHostTestHarness::SetUp() { 182 void RenderViewHostTestHarness::SetUp() {
182 #if defined(USE_AURA) 183 #if defined(USE_AURA)
183 root_window_.reset(new aura::RootWindow); 184 root_window_.reset(new aura::RootWindow);
185 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
184 test_stacking_client_.reset( 186 test_stacking_client_.reset(
185 new aura::test::TestStackingClient(root_window_.get())); 187 new aura::test::TestStackingClient(root_window_.get()));
186 #endif 188 #endif
187 SetContents(CreateTestTabContents()); 189 SetContents(CreateTestTabContents());
188 } 190 }
189 191
190 void RenderViewHostTestHarness::TearDown() { 192 void RenderViewHostTestHarness::TearDown() {
191 SetContents(NULL); 193 SetContents(NULL);
192 #if defined(USE_AURA) 194 #if defined(USE_AURA)
193 test_stacking_client_.reset(); 195 test_stacking_client_.reset();
194 root_window_.reset(); 196 root_window_.reset();
195 #endif 197 #endif
196 198
197 // Make sure that we flush any messages related to TabContents destruction 199 // Make sure that we flush any messages related to TabContents destruction
198 // before we destroy the browser context. 200 // before we destroy the browser context.
199 MessageLoop::current()->RunAllPending(); 201 MessageLoop::current()->RunAllPending();
200 202
201 // Release the browser context on the UI thread. 203 // Release the browser context on the UI thread.
202 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); 204 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
203 message_loop_.RunAllPending(); 205 message_loop_.RunAllPending();
204 } 206 }
205 207
206 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 208 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
207 RenderProcessHostFactory* factory) { 209 RenderProcessHostFactory* factory) {
208 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 210 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
209 } 211 }
210 212
211 } // namespace content 213 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698