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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation | 109 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation |
110 // without making any network requests. | 110 // without making any network requests. |
111 if (pending_rvh) | 111 if (pending_rvh) |
112 old_rvh->OnSwapOutACK(); | 112 old_rvh->OnSwapOutACK(); |
113 } | 113 } |
114 | 114 |
115 void BrowserWithTestWindowTest::NavigateAndCommit( | 115 void BrowserWithTestWindowTest::NavigateAndCommit( |
116 NavigationController* controller, | 116 NavigationController* controller, |
117 const GURL& url) { | 117 const GURL& url) { |
118 controller->LoadURL( | 118 controller->LoadURL( |
119 url, GURL(), content::PAGE_TRANSITION_LINK, std::string()); | 119 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
120 CommitPendingLoad(controller); | 120 CommitPendingLoad(controller); |
121 } | 121 } |
122 | 122 |
123 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { | 123 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { |
124 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); | 124 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); |
125 } | 125 } |
126 | 126 |
127 void BrowserWithTestWindowTest::DestroyBrowser() { | 127 void BrowserWithTestWindowTest::DestroyBrowser() { |
128 if (!browser_.get()) | 128 if (!browser_.get()) |
129 return; | 129 return; |
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 |