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/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 void BrowserWithTestWindowTest::CommitPendingLoad( | 72 void BrowserWithTestWindowTest::CommitPendingLoad( |
73 NavigationController* controller) { | 73 NavigationController* controller) { |
74 if (!controller->pending_entry()) | 74 if (!controller->pending_entry()) |
75 return; // Nothing to commit. | 75 return; // Nothing to commit. |
76 | 76 |
77 TestRenderViewHost* old_rvh = | 77 TestRenderViewHost* old_rvh = |
78 TestRenderViewHostForTab(controller->tab_contents()); | 78 TestRenderViewHostForTab(controller->tab_contents()); |
79 | 79 |
80 TestRenderViewHost* pending_rvh = static_cast<TestRenderViewHost*>( | 80 TestRenderViewHost* pending_rvh = static_cast<TestRenderViewHost*>( |
81 controller->tab_contents()->render_manager_for_testing()-> | 81 controller->tab_contents()->GetRenderManagerForTesting()-> |
82 pending_render_view_host()); | 82 pending_render_view_host()); |
83 if (pending_rvh) { | 83 if (pending_rvh) { |
84 // Simulate the ShouldClose_ACK that is received from the current renderer | 84 // Simulate the ShouldClose_ACK that is received from the current renderer |
85 // for a cross-site navigation. | 85 // for a cross-site navigation. |
86 DCHECK_NE(old_rvh, pending_rvh); | 86 DCHECK_NE(old_rvh, pending_rvh); |
87 old_rvh->SendShouldCloseACK(true); | 87 old_rvh->SendShouldCloseACK(true); |
88 } | 88 } |
89 // Commit on the pending_rvh, if one exists. | 89 // Commit on the pending_rvh, if one exists. |
90 TestRenderViewHost* test_rvh = pending_rvh ? pending_rvh : old_rvh; | 90 TestRenderViewHost* test_rvh = pending_rvh ? pending_rvh : old_rvh; |
91 | 91 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Make sure we close all tabs, otherwise Browser isn't happy in its | 130 // Make sure we close all tabs, otherwise Browser isn't happy in its |
131 // destructor. | 131 // destructor. |
132 browser()->CloseAllTabs(); | 132 browser()->CloseAllTabs(); |
133 browser_.reset(NULL); | 133 browser_.reset(NULL); |
134 window_.reset(NULL); | 134 window_.reset(NULL); |
135 } | 135 } |
136 | 136 |
137 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { | 137 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { |
138 return new TestingProfile(); | 138 return new TestingProfile(); |
139 } | 139 } |
OLD | NEW |