| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/browser_url_handler.h" | 5 #include "chrome/browser/browser_url_handler.h" |
| 6 #include "chrome/test/testing_profile.h" | 6 #include "chrome/test/testing_profile.h" |
| 7 #include "content/browser/renderer_host/test_backing_store.h" | 7 #include "content/browser/renderer_host/test_backing_store.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.h" | 9 #include "content/browser/site_instance.h" |
| 10 #include "content/browser/tab_contents/navigation_controller.h" | 10 #include "content/browser/tab_contents/navigation_controller.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 } | 331 } |
| 332 | 332 |
| 333 void RenderViewHostTestHarness::Reload() { | 333 void RenderViewHostTestHarness::Reload() { |
| 334 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 334 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
| 335 DCHECK(entry); | 335 DCHECK(entry); |
| 336 controller().Reload(false); | 336 controller().Reload(false); |
| 337 rvh()->SendNavigate(entry->page_id(), entry->url()); | 337 rvh()->SendNavigate(entry->page_id(), entry->url()); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void RenderViewHostTestHarness::SetUp() { | 340 void RenderViewHostTestHarness::SetUp() { |
| 341 // Initialize Chrome's ContentBrowserClient here, since we won't go through | |
| 342 // BrowserMain. | |
| 343 content::GetContentClient()->set_browser(&browser_client_); | |
| 344 contents_.reset(CreateTestTabContents()); | 341 contents_.reset(CreateTestTabContents()); |
| 345 } | 342 } |
| 346 | 343 |
| 347 void RenderViewHostTestHarness::TearDown() { | 344 void RenderViewHostTestHarness::TearDown() { |
| 348 contents_.reset(); | 345 contents_.reset(); |
| 349 | 346 |
| 350 // Make sure that we flush any messages related to TabContents destruction | 347 // Make sure that we flush any messages related to TabContents destruction |
| 351 // before we destroy the profile. | 348 // before we destroy the profile. |
| 352 MessageLoop::current()->RunAllPending(); | 349 MessageLoop::current()->RunAllPending(); |
| 353 | 350 |
| 354 // Release the profile on the UI thread. | 351 // Release the profile on the UI thread. |
| 355 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); | 352 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); |
| 356 message_loop_.RunAllPending(); | 353 message_loop_.RunAllPending(); |
| 357 } | 354 } |
| OLD | NEW |