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

Unified Diff: chrome/browser/process_singleton_win_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/process_singleton_linux_uitest.cc ('k') | chrome/browser/repost_form_warning_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_win_uitest.cc
diff --git a/chrome/browser/process_singleton_win_uitest.cc b/chrome/browser/process_singleton_win_uitest.cc
index 7611a839498667dc87e937fb01ac1324533b675a..929e271b23e081618178c93bdcfa1998dda8e1e8 100644
--- a/chrome/browser/process_singleton_win_uitest.cc
+++ b/chrome/browser/process_singleton_win_uitest.cc
@@ -33,11 +33,12 @@ namespace {
// NewRunnableMethod class to run the StartChrome methods in many threads.
class ChromeStarter : public base::RefCountedThreadSafe<ChromeStarter> {
public:
- ChromeStarter()
+ explicit ChromeStarter(int timeout_ms)
: ready_event_(false /* manual */, false /* signaled */),
done_event_(false /* manual */, false /* signaled */),
process_handle_(NULL),
- process_terminated_(false) {
+ process_terminated_(false),
+ timeout_ms_(timeout_ms) {
}
// We must reset some data members since we reuse the same ChromeStarter
@@ -75,9 +76,8 @@ class ChromeStarter : public base::RefCountedThreadSafe<ChromeStarter> {
// We can wait on the handle here, we should get stuck on one and only
// one process. The test below will take care of killing that process
// to unstuck us once it confirms there is only one.
- static const int64 kWaitForProcessDeath = 5000;
process_terminated_ = base::WaitForSingleProcess(process_handle_,
- kWaitForProcessDeath);
+ timeout_ms_);
// Let the test know we are done.
done_event_.Signal();
}
@@ -90,10 +90,14 @@ class ChromeStarter : public base::RefCountedThreadSafe<ChromeStarter> {
private:
friend class base::RefCountedThreadSafe<ChromeStarter>;
+
~ChromeStarter() {
if (process_handle_ != NULL)
base::CloseProcessHandle(process_handle_);
}
+
+ int timeout_ms_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeStarter);
};
@@ -111,7 +115,7 @@ class ProcessSingletonWinTest : public UITest {
for (size_t i = 0; i < kNbThreads; ++i) {
chrome_starter_threads_[i].reset(new base::Thread("ChromeStarter"));
ASSERT_TRUE(chrome_starter_threads_[i]->Start());
- chrome_starters_[i] = new ChromeStarter;
+ chrome_starters_[i] = new ChromeStarter(action_max_timeout_ms());
}
}
« no previous file with comments | « chrome/browser/process_singleton_linux_uitest.cc ('k') | chrome/browser/repost_form_warning_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698