| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 TabContents* tab_contents) { | 57 TabContents* tab_contents) { |
| 58 return static_cast<TestRenderViewHost*>( | 58 return static_cast<TestRenderViewHost*>( |
| 59 tab_contents->render_view_host()); | 59 tab_contents->render_view_host()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { | 62 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { |
| 63 browser::NavigateParams params(browser, url, content::PAGE_TRANSITION_TYPED); | 63 browser::NavigateParams params(browser, url, content::PAGE_TRANSITION_TYPED); |
| 64 params.tabstrip_index = 0; | 64 params.tabstrip_index = 0; |
| 65 params.disposition = NEW_FOREGROUND_TAB; | 65 params.disposition = NEW_FOREGROUND_TAB; |
| 66 browser::Navigate(¶ms); | 66 browser::Navigate(¶ms); |
| 67 CommitPendingLoad(¶ms.target_contents->controller()); | 67 CommitPendingLoad(¶ms.target_contents->tab_contents()->controller()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void BrowserWithTestWindowTest::CommitPendingLoad( | 70 void BrowserWithTestWindowTest::CommitPendingLoad( |
| 71 NavigationController* controller) { | 71 NavigationController* controller) { |
| 72 if (!controller->pending_entry()) | 72 if (!controller->pending_entry()) |
| 73 return; // Nothing to commit. | 73 return; // Nothing to commit. |
| 74 | 74 |
| 75 TestRenderViewHost* old_rvh = | 75 TestRenderViewHost* old_rvh = |
| 76 TestRenderViewHostForTab(controller->tab_contents()); | 76 TestRenderViewHostForTab(controller->tab_contents()); |
| 77 MockRenderProcessHost* mock_rph = static_cast<MockRenderProcessHost*>( | 77 MockRenderProcessHost* mock_rph = static_cast<MockRenderProcessHost*>( |
| (...skipping 52 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 |