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

Unified Diff: chrome/test/chromedriver/util.cc

Issue 23542005: [chromedriver] Improve timeout behavior. Prompted by user who executes script on busy page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 4 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
Index: chrome/test/chromedriver/util.cc
diff --git a/chrome/test/chromedriver/util.cc b/chrome/test/chromedriver/util.cc
index 3bde66eb41f42362e2546f5dca9ca36cd8e4709b..454949e79e58c02e4368568867116667b30b9e89 100644
--- a/chrome/test/chromedriver/util.cc
+++ b/chrome/test/chromedriver/util.cc
@@ -117,6 +117,8 @@ class DataOutputStream {
}
void WriteBytes(const void* bytes, int size) {
+ if (!size)
+ return;
size_t next = buffer_.length();
buffer_.resize(next + size);
memcpy(&buffer_[next], bytes, size);
@@ -150,6 +152,8 @@ class DataInputStream {
if (iter_ + length > size_)
return false;
data->resize(length);
+ if (length == 0)
+ return true;
return ReadBytes(&(*data)[0], length);
}

Powered by Google App Engine
This is Rietveld 408576698