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