summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_uitest.cc
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 18:35:10 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 18:35:10 +0000
commitd480bc80924732bfe029c894db68cecb15ce0a9f (patch)
tree063298145cedbcd6cac8fb8987b1e5b41416c45c /chrome/browser/browser_uitest.cc
parent878c426fd8ec9fc5568a7549d7cebad29db3413e (diff)
downloadchromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.zip
chromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.tar.gz
chromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.tar.bz2
Fix DIR_SOURCE_ROOT to work in bundles like Chromium.app. Add more ui tests. Add a resource for tabs with no title on mac. Fix window title reporting. Remove the Browser dependency from the tab strip (only needs a TabStripModel).
Review URL: http://codereview.chromium.org/93025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_uitest.cc')
-rw-r--r--chrome/browser/browser_uitest.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 2f52007..99f9ccc 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -25,10 +25,17 @@ namespace {
// Given a page title, returns the expected window caption string.
std::wstring WindowCaptionFromPageTitle(std::wstring page_title) {
+#if defined(OS_WIN) || defined(OS_LINUX)
if (page_title.empty())
return l10n_util::GetString(IDS_PRODUCT_NAME);
return l10n_util::GetStringF(IDS_BROWSER_WINDOW_TITLE_FORMAT, page_title);
+#elif defined(OS_MACOSX)
+ // On Mac, we don't want to suffix the page title with the application name.
+ if (page_title.empty())
+ return l10n_util::GetString(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED);
+ return page_title;
+#endif
}
class BrowserTest : public UITest {
@@ -61,8 +68,6 @@ class VisibleBrowserTest : public UITest {
}
};
-} // namespace
-
// Launch the app on a page with no title, check that the app title was set
// correctly.
TEST_F(BrowserTest, NoTitle) {
@@ -112,12 +117,18 @@ TEST_F(BrowserTest, ThirtyFourTabs) {
return;
// See browser\renderer_host\render_process_host.cc for the algorithm to
// decide how many processes to create.
+#if defined(OS_WIN) || defined(OS_LINUX)
+// TODO(pinkerton): Turn this back on for Mac when ChromeBrowserProcessId()
+// gets implemented. Right now we don't have a good way to do it, and keeping
+// a file always open just so UI tests can check renderers seems a bit
+// wasteful.
int process_count = GetBrowserProcessCount();
if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 2048) {
EXPECT_GE(process_count, 24);
} else {
EXPECT_LE(process_count, 23);
}
+#endif
}
#if defined(OS_WIN)
@@ -246,7 +257,13 @@ TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
int orig_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&orig_tab_count));
int orig_process_count = GetBrowserProcessCount();
+#if defined(OS_WIN) || defined(OS_LINUX)
+// TODO(pinkerton): Turn this back on for Mac when ChromeBrowserProcessId()
+// gets implemented. Right now we don't have a good way to do it, and keeping
+// a file always open just so UI tests can check renderers seems a bit
+// wasteful.
ASSERT_GE(orig_process_count, 1);
+#endif
// Use JavaScript URL to almost fork a new tab, but not quite. (Leave the
// opener non-null.) Should not fork a process.
@@ -295,3 +312,5 @@ TEST_F(VisibleBrowserTest, WindowOpenClose) {
FAIL() << "failed to get error page title";
}
#endif
+
+} // namespace