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