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

Unified Diff: chrome/test/pyautolib/pyautolib.cc

Issue 10383216: Replaced EXPECT_TRUE with a LOG(WARNING) for automation commands to provide more information... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switched to LOG(WARNING) and report how long the command ran. Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyautolib.cc
diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc
index 33814ac6a2d82a14a1d03041b42812c1375ab53b..5a7731d932f883ba05081915123f4077b17e6da8 100644
--- a/chrome/test/pyautolib/pyautolib.cc
+++ b/chrome/test/pyautolib/pyautolib.cc
@@ -7,6 +7,7 @@
#include "base/path_service.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/automation_proxy.h"
@@ -363,14 +364,25 @@ std::string PyUITestBase::_SendJSONRequest(int window_index,
const std::string& request,
int timeout) {
std::string response;
+ base::TimeTicks time;
if (window_index < 0) { // Do not need to target a browser window.
- EXPECT_TRUE(automation()->SendJSONRequest(request, timeout, &response));
+ time = base::TimeTicks::Now();
+ if (!automation()->SendJSONRequest(request, timeout, &response)) {
+ LOG(WARNING) << "SendJSONRequest returned false after "
+ << (base::TimeTicks::Now() - time).InSeconds()
+ << " seconds: " << request;
+ }
} else {
scoped_refptr<BrowserProxy> browser_proxy =
automation()->GetBrowserWindow(window_index);
EXPECT_TRUE(browser_proxy.get());
if (browser_proxy.get()) {
- EXPECT_TRUE(browser_proxy->SendJSONRequest(request, timeout, &response));
+ time = base::TimeTicks::Now();
+ if (!browser_proxy->SendJSONRequest(request, timeout, &response)) {
+ LOG(WARNING) << "SendJSONRequest returned false after "
+ << (base::TimeTicks::Now() - time).InSeconds()
+ << " seconds: " << request;
+ }
}
}
return response;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698