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

Side by Side Diff: content/browser/renderer_host/test_render_view_host.cc

Issue 9616045: Aura/Ash split: Move ScreenAura to ash::ScreenAsh. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a separate aura::TestScreen in tests instead, partially reverting to patchset 2 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/browser/browser_url_handler.h" 5 #include "content/browser/browser_url_handler.h"
6 #include "content/browser/renderer_host/test_backing_store.h" 6 #include "content/browser/renderer_host/test_backing_store.h"
7 #include "content/browser/renderer_host/test_render_view_host.h" 7 #include "content/browser/renderer_host/test_render_view_host.h"
8 #include "content/browser/site_instance_impl.h" 8 #include "content/browser/site_instance_impl.h"
9 #include "content/browser/tab_contents/navigation_controller_impl.h" 9 #include "content/browser/tab_contents/navigation_controller_impl.h"
10 #include "content/browser/tab_contents/navigation_entry_impl.h" 10 #include "content/browser/tab_contents/navigation_entry_impl.h"
11 #include "content/browser/tab_contents/test_tab_contents.h" 11 #include "content/browser/tab_contents/test_tab_contents.h"
12 #include "content/common/dom_storage_common.h" 12 #include "content/common/dom_storage_common.h"
13 #include "content/common/view_messages.h" 13 #include "content/common/view_messages.h"
14 #include "content/public/browser/navigation_controller.h" 14 #include "content/public/browser/navigation_controller.h"
15 #include "content/public/common/content_client.h" 15 #include "content/public/common/content_client.h"
16 #include "content/test/test_browser_context.h" 16 #include "content/test/test_browser_context.h"
17 #include "ui/gfx/rect.h" 17 #include "ui/gfx/rect.h"
18 #include "webkit/forms/password_form.h" 18 #include "webkit/forms/password_form.h"
19 #include "webkit/glue/webkit_glue.h" 19 #include "webkit/glue/webkit_glue.h"
20 #include "webkit/glue/webpreferences.h" 20 #include "webkit/glue/webpreferences.h"
21 21
22 #if defined(USE_AURA) 22 #if defined(USE_AURA)
23 #include "ui/aura/root_window.h" 23 #include "ui/aura/root_window.h"
24 #include "ui/aura/test/test_screen.h"
24 #include "ui/aura/test/test_stacking_client.h" 25 #include "ui/aura/test/test_stacking_client.h"
25 #endif 26 #endif
26 27
27 using content::NavigationController; 28 using content::NavigationController;
28 using content::NavigationEntry; 29 using content::NavigationEntry;
29 using content::RenderViewHostDelegate; 30 using content::RenderViewHostDelegate;
30 using content::RenderWidgetHost; 31 using content::RenderWidgetHost;
31 using content::SessionStorageNamespace; 32 using content::SessionStorageNamespace;
32 using content::SiteInstance; 33 using content::SiteInstance;
33 using content::TestRenderViewHost; 34 using content::TestRenderViewHost;
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 void RenderViewHostTestHarness::Reload() { 411 void RenderViewHostTestHarness::Reload() {
411 NavigationEntry* entry = controller().GetLastCommittedEntry(); 412 NavigationEntry* entry = controller().GetLastCommittedEntry();
412 DCHECK(entry); 413 DCHECK(entry);
413 controller().Reload(false); 414 controller().Reload(false);
414 rvh()->SendNavigate(entry->GetPageID(), entry->GetURL()); 415 rvh()->SendNavigate(entry->GetPageID(), entry->GetURL());
415 } 416 }
416 417
417 void RenderViewHostTestHarness::SetUp() { 418 void RenderViewHostTestHarness::SetUp() {
418 #if defined(USE_AURA) 419 #if defined(USE_AURA)
419 root_window_.reset(new aura::RootWindow); 420 root_window_.reset(new aura::RootWindow);
421 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
420 test_stacking_client_.reset( 422 test_stacking_client_.reset(
421 new aura::test::TestStackingClient(root_window_.get())); 423 new aura::test::TestStackingClient(root_window_.get()));
422 #endif 424 #endif
423 SetContents(CreateTestTabContents()); 425 SetContents(CreateTestTabContents());
424 } 426 }
425 427
426 void RenderViewHostTestHarness::TearDown() { 428 void RenderViewHostTestHarness::TearDown() {
427 SetContents(NULL); 429 SetContents(NULL);
428 #if defined(USE_AURA) 430 #if defined(USE_AURA)
429 test_stacking_client_.reset(); 431 test_stacking_client_.reset();
430 root_window_.reset(); 432 root_window_.reset();
431 #endif 433 #endif
432 434
433 // Make sure that we flush any messages related to TabContents destruction 435 // Make sure that we flush any messages related to TabContents destruction
434 // before we destroy the browser context. 436 // before we destroy the browser context.
435 MessageLoop::current()->RunAllPending(); 437 MessageLoop::current()->RunAllPending();
436 438
437 // Release the browser context on the UI thread. 439 // Release the browser context on the UI thread.
438 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); 440 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
439 message_loop_.RunAllPending(); 441 message_loop_.RunAllPending();
440 } 442 }
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