| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/app_modal_dialog.h" | 9 #include "chrome/browser/app_modal_dialog.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #endif | 58 #endif |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Launch the app on a page with no title, check that the app title was set | 62 // Launch the app on a page with no title, check that the app title was set |
| 63 // correctly. | 63 // correctly. |
| 64 IN_PROC_BROWSER_TEST_F(BrowserTest, NoTitle) { | 64 IN_PROC_BROWSER_TEST_F(BrowserTest, NoTitle) { |
| 65 ui_test_utils::NavigateToURL(browser(), | 65 ui_test_utils::NavigateToURL(browser(), |
| 66 ui_test_utils::GetTestUrl(L".", L"title1.html")); | 66 ui_test_utils::GetTestUrl(L".", L"title1.html")); |
| 67 EXPECT_EQ(LocaleWindowCaptionFromPageTitle(L"title1.html"), | 67 EXPECT_EQ(LocaleWindowCaptionFromPageTitle(L"title1.html"), |
| 68 UTF16ToWideHack(browser()->GetCurrentPageTitle())); | 68 UTF16ToWideHack(browser()->GetWindowTitleForCurrentTab())); |
| 69 string16 tab_title; | 69 string16 tab_title; |
| 70 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title)); | 70 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title)); |
| 71 EXPECT_EQ(ASCIIToUTF16("title1.html"), tab_title); | 71 EXPECT_EQ(ASCIIToUTF16("title1.html"), tab_title); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Launch the app, navigate to a page with a title, check that the app title | 74 // Launch the app, navigate to a page with a title, check that the app title |
| 75 // was set correctly. | 75 // was set correctly. |
| 76 IN_PROC_BROWSER_TEST_F(BrowserTest, Title) { | 76 IN_PROC_BROWSER_TEST_F(BrowserTest, Title) { |
| 77 ui_test_utils::NavigateToURL(browser(), | 77 ui_test_utils::NavigateToURL(browser(), |
| 78 ui_test_utils::GetTestUrl(L".", L"title2.html")); | 78 ui_test_utils::GetTestUrl(L".", L"title2.html")); |
| 79 const std::wstring test_title(L"Title Of Awesomeness"); | 79 const std::wstring test_title(L"Title Of Awesomeness"); |
| 80 EXPECT_EQ(LocaleWindowCaptionFromPageTitle(test_title), | 80 EXPECT_EQ(LocaleWindowCaptionFromPageTitle(test_title), |
| 81 UTF16ToWideHack(browser()->GetCurrentPageTitle())); | 81 UTF16ToWideHack(browser()->GetWindowTitleForCurrentTab())); |
| 82 string16 tab_title; | 82 string16 tab_title; |
| 83 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title)); | 83 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title)); |
| 84 EXPECT_EQ(WideToUTF16(test_title), tab_title); | 84 EXPECT_EQ(WideToUTF16(test_title), tab_title); |
| 85 } | 85 } |
| 86 | 86 |
| 87 IN_PROC_BROWSER_TEST_F(BrowserTest, JavascriptAlertActivatesTab) { | 87 IN_PROC_BROWSER_TEST_F(BrowserTest, JavascriptAlertActivatesTab) { |
| 88 GURL url(ui_test_utils::GetTestUrl(L".", L"title1.html")); | 88 GURL url(ui_test_utils::GetTestUrl(L".", L"title1.html")); |
| 89 ui_test_utils::NavigateToURL(browser(), url); | 89 ui_test_utils::NavigateToURL(browser(), url); |
| 90 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, | 90 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, |
| 91 true, 0, false, NULL); | 91 true, 0, false, NULL); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 EXPECT_EQ(34, browser()->tab_count()); | 116 EXPECT_EQ(34, browser()->tab_count()); |
| 117 | 117 |
| 118 // See browser\renderer_host\render_process_host.cc for the algorithm to | 118 // See browser\renderer_host\render_process_host.cc for the algorithm to |
| 119 // decide how many processes to create. | 119 // decide how many processes to create. |
| 120 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 2048) { | 120 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 2048) { |
| 121 EXPECT_GE(RenderProcessHost::size(), 24U); | 121 EXPECT_GE(RenderProcessHost::size(), 24U); |
| 122 } else { | 122 } else { |
| 123 EXPECT_LE(RenderProcessHost::size(), 23U); | 123 EXPECT_LE(RenderProcessHost::size(), 23U); |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |