| 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/browser/ui/browser_navigator_browsertest.h" | 5 #include "chrome/browser/ui/browser_navigator_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // We should have one window, with one tab. | 107 // We should have one window, with one tab. |
| 108 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 108 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
| 109 EXPECT_EQ(2, browser()->tab_strip_model()->count()); | 109 EXPECT_EQ(2, browser()->tab_strip_model()->count()); |
| 110 | 110 |
| 111 *title = param.target_contents->GetTitle(); | 111 *title = param.target_contents->GetTitle(); |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 | 114 |
| 115 Browser* BrowserNavigatorTest::CreateEmptyBrowserForType(Browser::Type type, | 115 Browser* BrowserNavigatorTest::CreateEmptyBrowserForType(Browser::Type type, |
| 116 Profile* profile) { | 116 Profile* profile) { |
| 117 Browser* browser = new Browser( | 117 Browser* browser = new Browser(Browser::CreateParams(type, profile)); |
| 118 Browser::CreateParams(type, profile, chrome::GetActiveDesktop())); | |
| 119 chrome::AddTabAt(browser, GURL(), -1, true); | 118 chrome::AddTabAt(browser, GURL(), -1, true); |
| 120 return browser; | 119 return browser; |
| 121 } | 120 } |
| 122 | 121 |
| 123 Browser* BrowserNavigatorTest::CreateEmptyBrowserForApp(Profile* profile) { | 122 Browser* BrowserNavigatorTest::CreateEmptyBrowserForApp(Profile* profile) { |
| 124 Browser* browser = new Browser( | 123 Browser* browser = new Browser(Browser::CreateParams::CreateForApp( |
| 125 Browser::CreateParams::CreateForApp( | 124 "Test", false /* trusted_source */, gfx::Rect(), profile)); |
| 126 "Test", false /* trusted_source */, gfx::Rect(), profile, | |
| 127 chrome::GetActiveDesktop())); | |
| 128 chrome::AddTabAt(browser, GURL(), -1, true); | 125 chrome::AddTabAt(browser, GURL(), -1, true); |
| 129 return browser; | 126 return browser; |
| 130 } | 127 } |
| 131 | 128 |
| 132 WebContents* BrowserNavigatorTest::CreateWebContents() { | 129 WebContents* BrowserNavigatorTest::CreateWebContents() { |
| 133 content::WebContents::CreateParams create_params(browser()->profile()); | 130 content::WebContents::CreateParams create_params(browser()->profile()); |
| 134 content::WebContents* base_web_contents = | 131 content::WebContents* base_web_contents = |
| 135 browser()->tab_strip_model()->GetActiveWebContents(); | 132 browser()->tab_strip_model()->GetActiveWebContents(); |
| 136 if (base_web_contents) { | 133 if (base_web_contents) { |
| 137 create_params.initial_size = | 134 create_params.initial_size = |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 EXPECT_EQ(expected_title, params.target_contents->GetTitle()); | 1412 EXPECT_EQ(expected_title, params.target_contents->GetTitle()); |
| 1416 // GURL always keeps non-ASCII characters escaped, but check them anyways. | 1413 // GURL always keeps non-ASCII characters escaped, but check them anyways. |
| 1417 EXPECT_EQ(GURL(expected_url).spec(), params.target_contents->GetURL().spec()); | 1414 EXPECT_EQ(GURL(expected_url).spec(), params.target_contents->GetURL().spec()); |
| 1418 // Check the omnibox text. It should have escaped RTL with unescaped text. | 1415 // Check the omnibox text. It should have escaped RTL with unescaped text. |
| 1419 LocationBar* location_bar = browser()->window()->GetLocationBar(); | 1416 LocationBar* location_bar = browser()->window()->GetLocationBar(); |
| 1420 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); | 1417 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); |
| 1421 EXPECT_EQ(base::UTF8ToUTF16(expected_url), omnibox_view->GetText()); | 1418 EXPECT_EQ(base::UTF8ToUTF16(expected_url), omnibox_view->GetText()); |
| 1422 } | 1419 } |
| 1423 | 1420 |
| 1424 } // namespace | 1421 } // namespace |
| OLD | NEW |