Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/browser/browser_browsertest.cc

Issue 155534: Fix misleading name and comment of Browser::GetCurrentPageTitle. (Closed)
Patch Set: replace in one more place Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698