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

Unified Diff: chrome/browser/process_singleton_linux_uitest.cc

Issue 1547003: [GTTF] Miscellanous UI tests cleanups: (Closed)
Patch Set: updated Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/printing_layout_uitest.cc ('k') | chrome/browser/process_singleton_win_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_linux_uitest.cc
diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc
index 8bef1020a73fe606cf5daffcd057862ca4ad998a..d0ba75083a93fef8d929bea51955ced442ef6335 100644
--- a/chrome/browser/process_singleton_linux_uitest.cc
+++ b/chrome/browser/process_singleton_linux_uitest.cc
@@ -32,7 +32,8 @@ typedef UITest ProcessSingletonLinuxTest;
// A helper method to call ProcessSingleton::NotifyOtherProcess().
// |url| will be added to CommandLine for current process, so that it can be
// sent to browser process by ProcessSingleton::NotifyOtherProcess().
-ProcessSingleton::NotifyResult NotifyOtherProcess(const std::string& url) {
+ProcessSingleton::NotifyResult NotifyOtherProcess(const std::string& url,
+ int timeout_ms) {
FilePath user_data_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
@@ -49,10 +50,8 @@ ProcessSingleton::NotifyResult NotifyOtherProcess(const std::string& url) {
ProcessSingleton process_singleton(user_data_dir);
- // Use a short timeout to keep tests fast.
- const int kTimeoutSeconds = 3;
- return process_singleton.NotifyOtherProcessWithTimeout(new_cmd_line,
- kTimeoutSeconds);
+ return process_singleton.NotifyOtherProcessWithTimeout(
+ new_cmd_line, timeout_ms / 1000);
}
} // namespace
@@ -95,7 +94,8 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessSuccess) {
std::string url("about:blank");
int original_tab_count = GetTabCount();
- EXPECT_EQ(ProcessSingleton::PROCESS_NOTIFIED, NotifyOtherProcess(url));
+ EXPECT_EQ(ProcessSingleton::PROCESS_NOTIFIED,
+ NotifyOtherProcess(url, action_timeout_ms()));
EXPECT_EQ(original_tab_count + 1, GetTabCount());
EXPECT_EQ(url, GetActiveTabURL().spec());
}
@@ -115,10 +115,11 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessFailure) {
HANDLE_EINTR(waitpid(pid, 0, WUNTRACED));
std::string url("about:blank");
- EXPECT_EQ(ProcessSingleton::PROCESS_NONE, NotifyOtherProcess(url));
+ EXPECT_EQ(ProcessSingleton::PROCESS_NONE,
+ NotifyOtherProcess(url, action_timeout_ms()));
// Wait for a while to make sure the browser process is actually killed.
- EXPECT_FALSE(CrashAwareSleep(1000));
+ EXPECT_FALSE(CrashAwareSleep(sleep_timeout_ms()));
}
// Test that we can still notify a process on the same host even after the
@@ -131,7 +132,8 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessHostChanged) {
int original_tab_count = GetTabCount();
std::string url("about:blank");
- EXPECT_EQ(ProcessSingleton::PROCESS_NOTIFIED, NotifyOtherProcess(url));
+ EXPECT_EQ(ProcessSingleton::PROCESS_NOTIFIED,
+ NotifyOtherProcess(url, action_timeout_ms()));
EXPECT_EQ(original_tab_count + 1, GetTabCount());
EXPECT_EQ(url, GetActiveTabURL().spec());
}
@@ -146,12 +148,13 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessDifferingHost) {
// Kill the browser process, so that it does not respond on the socket.
kill(pid, SIGKILL);
// Wait for a while to make sure the browser process is actually killed.
- EXPECT_FALSE(CrashAwareSleep(1000));
+ EXPECT_FALSE(CrashAwareSleep(sleep_timeout_ms()));
FilePath lock_path = user_data_dir().Append(chrome::kSingletonLockFilename);
EXPECT_EQ(0, unlink(lock_path.value().c_str()));
EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path.value().c_str()));
std::string url("about:blank");
- EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, NotifyOtherProcess(url));
+ EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE,
+ NotifyOtherProcess(url, action_timeout_ms()));
}
« no previous file with comments | « chrome/browser/printing/printing_layout_uitest.cc ('k') | chrome/browser/process_singleton_win_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698