| 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 #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" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 void RenderViewHostTestHarness::Reload() { | 394 void RenderViewHostTestHarness::Reload() { |
| 395 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 395 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
| 396 DCHECK(entry); | 396 DCHECK(entry); |
| 397 controller().Reload(false); | 397 controller().Reload(false); |
| 398 rvh()->SendNavigate(entry->GetPageID(), entry->GetURL()); | 398 rvh()->SendNavigate(entry->GetPageID(), entry->GetURL()); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void RenderViewHostTestHarness::SetUp() { | 401 void RenderViewHostTestHarness::SetUp() { |
| 402 #if defined(USE_AURA) | 402 #if defined(USE_AURA) |
| 403 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); | 403 root_window_.reset(new aura::RootWindow); |
| 404 test_stacking_client_.reset(new aura::test::TestStackingClient(root_window)); | 404 test_stacking_client_.reset( |
| 405 new aura::test::TestStackingClient(root_window_.get())); |
| 405 #endif | 406 #endif |
| 406 SetContents(CreateTestTabContents()); | 407 SetContents(CreateTestTabContents()); |
| 407 } | 408 } |
| 408 | 409 |
| 409 void RenderViewHostTestHarness::TearDown() { | 410 void RenderViewHostTestHarness::TearDown() { |
| 410 SetContents(NULL); | 411 SetContents(NULL); |
| 411 #if defined(USE_AURA) | 412 #if defined(USE_AURA) |
| 412 test_stacking_client_.reset(); | 413 test_stacking_client_.reset(); |
| 414 root_window_.reset(); |
| 413 #endif | 415 #endif |
| 414 | 416 |
| 415 // Make sure that we flush any messages related to TabContents destruction | 417 // Make sure that we flush any messages related to TabContents destruction |
| 416 // before we destroy the browser context. | 418 // before we destroy the browser context. |
| 417 MessageLoop::current()->RunAllPending(); | 419 MessageLoop::current()->RunAllPending(); |
| 418 | 420 |
| 419 // Release the browser context on the UI thread. | 421 // Release the browser context on the UI thread. |
| 420 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 422 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
| 421 message_loop_.RunAllPending(); | 423 message_loop_.RunAllPending(); |
| 422 } | 424 } |
| OLD | NEW |