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

Side by Side Diff: chrome/test/automation/proxy_launcher.h

Issue 6689014: GTTF: Detect browser crashes on shutdown in UI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ 5 #ifndef CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
6 #define CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ 6 #define CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Terminates the browser, simulates end of session. 113 // Terminates the browser, simulates end of session.
114 void TerminateBrowser(); 114 void TerminateBrowser();
115 115
116 // Check that no processes related to Chrome exist, displaying 116 // Check that no processes related to Chrome exist, displaying
117 // the given message if any do. 117 // the given message if any do.
118 void AssertAppNotRunning(const std::wstring& error_message); 118 void AssertAppNotRunning(const std::wstring& error_message);
119 119
120 // Returns true when the browser process is running, independent if any 120 // Returns true when the browser process is running, independent if any
121 // renderer process exists or not. It will returns false if an user closed the 121 // renderer process exists or not. It will returns false if an user closed the
122 // window or if the browser process died by itself. 122 // window or if the browser process died by itself.
123 // TODO(phajdan.jr): Get rid of IsBrowserRunning, it is difficult
124 // to make it simple and reliable.
123 bool IsBrowserRunning(); 125 bool IsBrowserRunning();
124 126
125 // Returns true when timeout_ms milliseconds have elapsed.
126 // Returns false if the browser process died while waiting.
127 bool CrashAwareSleep(int timeout_ms);
128
129 // Wait for the browser process to shut down on its own (i.e. as a result of 127 // Wait for the browser process to shut down on its own (i.e. as a result of
130 // some action that your test has taken). 128 // some action that your test has taken). If it has exited within |timeout|,
131 bool WaitForBrowserProcessToQuit(int timeout); 129 // puts the exit code in |exit_code| and returns true.
130 bool WaitForBrowserProcessToQuit(int timeout, int* exit_code);
132 131
133 AutomationProxy* automation() const; 132 AutomationProxy* automation() const;
134 133
135 // Return the user data directory being used by the browser instance. 134 // Return the user data directory being used by the browser instance.
136 FilePath user_data_dir() const; 135 FilePath user_data_dir() const;
137 136
138 // Get the handle of browser process connected to the automation. This 137 // Get the handle of browser process connected to the automation. This
139 // function only returns a reference to the handle so the caller does not 138 // function only returns a reference to the handle so the caller does not
140 // own the handle returned. 139 // own the handle returned.
141 base::ProcessHandle process() const; 140 base::ProcessHandle process() const;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 343
345 protected: 344 protected:
346 std::string channel_id_; // Channel id of automation proxy. 345 std::string channel_id_; // Channel id of automation proxy.
347 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure. 346 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure.
348 347
349 private: 348 private:
350 DISALLOW_COPY_AND_ASSIGN(AnonymousProxyLauncher); 349 DISALLOW_COPY_AND_ASSIGN(AnonymousProxyLauncher);
351 }; 350 };
352 351
353 #endif // CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ 352 #endif // CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698