summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui/ui_test.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 23:15:47 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 23:15:47 +0000
commit3753f52d42975eaefcafca9fc0257ec24e161a9c (patch)
treec9622baf613dd1b47c304d30e1ded74fa84fce54 /chrome/test/ui/ui_test.cc
parent9e23bb1bba29dad5305e8f8a08341aefe7275502 (diff)
downloadchromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.zip
chromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.tar.gz
chromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.tar.bz2
Implement chrome_proces_util for linux and enable download ui test.
To get the PID from the socket, we use lsof (fuser doesn't work with unix sockets apparently). The download shelf, save page, and browser ui tests now pass. Review URL: http://codereview.chromium.org/66071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui/ui_test.cc')
-rw-r--r--chrome/test/ui/ui_test.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index d30643b2..f0f29aa 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -253,12 +253,7 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
std::wstring extra_chrome_flags =
CommandLine::ForCurrentProcess()->GetSwitchValue(kExtraChromeFlagsSwitch);
if (!extra_chrome_flags.empty()) {
-#if defined(OS_WIN)
command_line.AppendLooseValue(extra_chrome_flags);
-#else
- // TODO(port): figure out how to pass through extra flags via a string.
- NOTIMPLEMENTED();
-#endif
}
// We need cookies on file:// for things like the page cycler.
@@ -446,7 +441,7 @@ void UITest::QuitBrowser() {
}
void UITest::AssertAppNotRunning(const std::wstring& error_message) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
ASSERT_EQ(0, GetBrowserProcessCount()) << error_message;
#else
// TODO(port): Enable when chrome_process_util is ported.
@@ -455,7 +450,7 @@ void UITest::AssertAppNotRunning(const std::wstring& error_message) {
}
void UITest::CleanupAppProcesses() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
TerminateAllChromeProcesses(FilePath::FromWStringHack(user_data_dir()));
// Suppress spammy failures that seem to be occurring when running
@@ -503,10 +498,6 @@ void UITest::NavigateToURL(const GURL& url) {
ASSERT_FALSE(is_timeout) << url.spec();
}
-// TODO(port): this #if effectively cuts out half of this file on
-// non-Windows platforms, and is a temporary hack to get things
-// building.
-#if defined(OS_WIN)
bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) {
const int kCycles = 20;
for (int i = 0; i < kCycles; i++) {
@@ -522,6 +513,10 @@ bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) {
return false;
}
+// TODO(port): this #if effectively cuts out half of this file on
+// non-Windows platforms, and is a temporary hack to get things
+// building.
+#if defined(OS_WIN)
bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser,
bool wait_for_open) {
const int kCycles = 20;
@@ -585,16 +580,15 @@ bool UITest::CrashAwareSleep(int time_out_ms) {
return base::CrashAwareSleep(process_, time_out_ms);
}
-#if defined(OS_WIN)
-// TODO(port): Port GetRunningChromeProcesses and sort out one w/string issue.
-
-/*static*/
+// static
int UITest::GetBrowserProcessCount() {
FilePath data_dir;
PathService::Get(chrome::DIR_USER_DATA, &data_dir);
return GetRunningChromeProcesses(data_dir).size();
}
+#if defined(OS_WIN)
+// TODO(port): Port GetRunningChromeProcesses and sort out one w/string issue.
static DictionaryValue* LoadDictionaryValueFromPath(const FilePath& path) {
if (path.empty())
return NULL;