summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton_win_uitest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 10:21:27 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 10:21:27 +0000
commit0e60b64fcae0a0f21982bc42e0e608c8d44b12c1 (patch)
tree5ec1f7dfc5a1955d370ef071abba840c4054271d /chrome/browser/process_singleton_win_uitest.cc
parent80de4fa5861be1171ad502eba157570839601086 (diff)
downloadchromium_src-0e60b64fcae0a0f21982bc42e0e608c8d44b12c1.zip
chromium_src-0e60b64fcae0a0f21982bc42e0e608c8d44b12c1.tar.gz
chromium_src-0e60b64fcae0a0f21982bc42e0e608c8d44b12c1.tar.bz2
[GTTF] Miscellanous UI tests cleanups:
- use built-in timeouts instead of "inventing" them in each test case - avoid unneeded checks and operations - use automation calls more effectively - use FLAKY mark instead of DISABLED to maintain test coverage - split some tests to make the above possible TEST=UI test based BUG=39785 Review URL: http://codereview.chromium.org/1547003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_win_uitest.cc')
-rw-r--r--chrome/browser/process_singleton_win_uitest.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/process_singleton_win_uitest.cc b/chrome/browser/process_singleton_win_uitest.cc
index 7611a83..929e271b2 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());
}
}