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

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

Issue 10082008: Aura demo fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export Created 8 years, 8 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/render_view_host_factory.h" 7 #include "content/browser/renderer_host/render_view_host_factory.h"
8 #include "content/browser/renderer_host/test_render_view_host.h" 8 #include "content/browser/renderer_host/test_render_view_host.h"
9 #include "content/browser/site_instance_impl.h" 9 #include "content/browser/site_instance_impl.h"
10 #include "content/browser/web_contents/navigation_entry_impl.h" 10 #include "content/browser/web_contents/navigation_entry_impl.h"
11 #include "content/browser/web_contents/test_web_contents.h" 11 #include "content/browser/web_contents/test_web_contents.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/test/mock_render_process_host.h" 13 #include "content/test/mock_render_process_host.h"
14 #include "content/test/test_browser_context.h" 14 #include "content/test/test_browser_context.h"
15 15
16 #if defined(USE_ASH) 16 #if defined(USE_ASH)
17 #include "ui/aura/test/test_screen.h" 17 #include "ui/aura/test/test_screen.h"
18 #endif 18 #endif
19 19
20 #if defined(USE_AURA) 20 #if defined(USE_AURA)
21 #include "ui/aura/env.h" 21 #include "ui/aura/env.h"
22 #include "ui/aura/monitor_manager.h" 22 #include "ui/aura/monitor_manager.h"
23 #include "ui/aura/root_window.h" 23 #include "ui/aura/root_window.h"
24 #include "ui/aura/test/single_monitor_manager.h" 24 #include "ui/aura/single_monitor_manager.h"
25 #include "ui/aura/test/test_stacking_client.h" 25 #include "ui/aura/test/test_stacking_client.h"
26 #endif 26 #endif
27 27
28 namespace content { 28 namespace content {
29 29
30 // Manages creation of the RenderViewHosts using our special subclass. This 30 // Manages creation of the RenderViewHosts using our special subclass. This
31 // automatically registers itself when it goes in scope, and unregisters itself 31 // automatically registers itself when it goes in scope, and unregisters itself
32 // when it goes out of scope. Since you can't have more than one factory 32 // when it goes out of scope. Since you can't have more than one factory
33 // registered at a time, you can only have one of these objects at a time. 33 // registered at a time, you can only have one of these objects at a time.
34 // 34 //
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void RenderViewHostTestHarness::Reload() { 188 void RenderViewHostTestHarness::Reload() {
189 NavigationEntry* entry = controller().GetLastCommittedEntry(); 189 NavigationEntry* entry = controller().GetLastCommittedEntry();
190 DCHECK(entry); 190 DCHECK(entry);
191 controller().Reload(false); 191 controller().Reload(false);
192 static_cast<TestRenderViewHost*>( 192 static_cast<TestRenderViewHost*>(
193 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL()); 193 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL());
194 } 194 }
195 195
196 void RenderViewHostTestHarness::SetUp() { 196 void RenderViewHostTestHarness::SetUp() {
197 #if defined(USE_AURA) 197 #if defined(USE_AURA)
198 aura::Env::GetInstance()->SetMonitorManager( 198 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager);
199 new aura::test::SingleMonitorManager);
200 root_window_.reset(aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); 199 root_window_.reset(aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
201 #if defined(USE_ASH) 200 #if defined(USE_ASH)
202 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); 201 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
203 #endif // USE_ASH 202 #endif // USE_ASH
204 test_stacking_client_.reset( 203 test_stacking_client_.reset(
205 new aura::test::TestStackingClient(root_window_.get())); 204 new aura::test::TestStackingClient(root_window_.get()));
206 #endif // USE_AURA 205 #endif // USE_AURA
207 SetContents(CreateTestWebContents()); 206 SetContents(CreateTestWebContents());
208 } 207 }
209 208
(...skipping 12 matching lines...) Expand all
222 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); 221 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
223 message_loop_.RunAllPending(); 222 message_loop_.RunAllPending();
224 } 223 }
225 224
226 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 225 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
227 RenderProcessHostFactory* factory) { 226 RenderProcessHostFactory* factory) {
228 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 227 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
229 } 228 }
230 229
231 } // namespace content 230 } // 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