OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { | 176 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { |
177 NavigateAndCommit(&browser()->tab_strip_model()->GetActiveWebContents()-> | 177 NavigateAndCommit(&browser()->tab_strip_model()->GetActiveWebContents()-> |
178 GetController(), | 178 GetController(), |
179 url); | 179 url); |
180 } | 180 } |
181 | 181 |
182 void BrowserWithTestWindowTest::NavigateAndCommitActiveTabWithTitle( | 182 void BrowserWithTestWindowTest::NavigateAndCommitActiveTabWithTitle( |
183 Browser* navigating_browser, | 183 Browser* navigating_browser, |
184 const GURL& url, | 184 const GURL& url, |
185 const base::string16& title) { | 185 const base::string16& title) { |
186 NavigationController* controller = &navigating_browser->tab_strip_model()-> | 186 WebContents* contents = |
187 GetActiveWebContents()->GetController(); | 187 navigating_browser->tab_strip_model()->GetActiveWebContents(); |
| 188 NavigationController* controller = &contents->GetController(); |
188 NavigateAndCommit(controller, url); | 189 NavigateAndCommit(controller, url); |
189 controller->GetActiveEntry()->SetTitle(title); | 190 contents->UpdateTitleForEntry(controller->GetActiveEntry(), title); |
190 } | 191 } |
191 | 192 |
192 void BrowserWithTestWindowTest::DestroyBrowserAndProfile() { | 193 void BrowserWithTestWindowTest::DestroyBrowserAndProfile() { |
193 if (browser_.get()) { | 194 if (browser_.get()) { |
194 // Make sure we close all tabs, otherwise Browser isn't happy in its | 195 // Make sure we close all tabs, otherwise Browser isn't happy in its |
195 // destructor. | 196 // destructor. |
196 browser()->tab_strip_model()->CloseAllTabs(); | 197 browser()->tab_strip_model()->CloseAllTabs(); |
197 browser_.reset(NULL); | 198 browser_.reset(NULL); |
198 } | 199 } |
199 window_.reset(NULL); | 200 window_.reset(NULL); |
(...skipping 26 matching lines...) Expand all Loading... |
226 Browser::CreateParams params(profile); | 227 Browser::CreateParams params(profile); |
227 if (hosted_app) { | 228 if (hosted_app) { |
228 params = Browser::CreateParams::CreateForApp( | 229 params = Browser::CreateParams::CreateForApp( |
229 "Test", true /* trusted_source */, gfx::Rect(), profile); | 230 "Test", true /* trusted_source */, gfx::Rect(), profile); |
230 } else { | 231 } else { |
231 params.type = browser_type; | 232 params.type = browser_type; |
232 } | 233 } |
233 params.window = browser_window; | 234 params.window = browser_window; |
234 return new Browser(params); | 235 return new Browser(params); |
235 } | 236 } |
OLD | NEW |