OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser_with_test_window_test.h" | 5 #include "chrome/test/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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 TestRenderViewHost* BrowserWithTestWindowTest::TestRenderViewHostForTab( | 52 TestRenderViewHost* BrowserWithTestWindowTest::TestRenderViewHostForTab( |
53 TabContents* tab_contents) { | 53 TabContents* tab_contents) { |
54 return static_cast<TestRenderViewHost*>( | 54 return static_cast<TestRenderViewHost*>( |
55 tab_contents->render_view_host()); | 55 tab_contents->render_view_host()); |
56 } | 56 } |
57 | 57 |
58 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { | 58 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { |
59 TabContents* new_tab = browser->AddTabWithURL( | 59 TabContents* new_tab = browser->AddTabWithURL( |
60 url, GURL(), PageTransition::TYPED, 0, TabStripModel::ADD_SELECTED, NULL, | 60 url, GURL(), PageTransition::TYPED, 0, TabStripModel::ADD_SELECTED, NULL, |
61 std::string()); | 61 std::string(), NULL); |
62 CommitPendingLoad(&new_tab->controller()); | 62 CommitPendingLoad(&new_tab->controller()); |
63 } | 63 } |
64 | 64 |
65 void BrowserWithTestWindowTest::CommitPendingLoad( | 65 void BrowserWithTestWindowTest::CommitPendingLoad( |
66 NavigationController* controller) { | 66 NavigationController* controller) { |
67 if (!controller->pending_entry()) | 67 if (!controller->pending_entry()) |
68 return; // Nothing to commit. | 68 return; // Nothing to commit. |
69 | 69 |
70 TestRenderViewHost* test_rvh = | 70 TestRenderViewHost* test_rvh = |
71 TestRenderViewHostForTab(controller->tab_contents()); | 71 TestRenderViewHostForTab(controller->tab_contents()); |
(...skipping 16 matching lines...) Expand all Loading... |
88 void BrowserWithTestWindowTest::NavigateAndCommit( | 88 void BrowserWithTestWindowTest::NavigateAndCommit( |
89 NavigationController* controller, | 89 NavigationController* controller, |
90 const GURL& url) { | 90 const GURL& url) { |
91 controller->LoadURL(url, GURL(), 0); | 91 controller->LoadURL(url, GURL(), 0); |
92 CommitPendingLoad(controller); | 92 CommitPendingLoad(controller); |
93 } | 93 } |
94 | 94 |
95 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { | 95 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { |
96 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); | 96 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); |
97 } | 97 } |
OLD | NEW |