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

Unified Diff: chrome/test/webdriver/webdriver_dispatch_unittest.cc

Issue 10827362: Fix ChromeDriver flakiness with the C# webdriver bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
« no previous file with comments | « chrome/test/webdriver/webdriver_dispatch.cc ('k') | chrome/test/webdriver/webdriver_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_dispatch_unittest.cc
diff --git a/chrome/test/webdriver/webdriver_dispatch_unittest.cc b/chrome/test/webdriver/webdriver_dispatch_unittest.cc
index edee1039a0527d6459ae73c8090084e7b9c3a55e..6abf90ca61e518aa786f38dfd5096a65a122908d 100644
--- a/chrome/test/webdriver/webdriver_dispatch_unittest.cc
+++ b/chrome/test/webdriver/webdriver_dispatch_unittest.cc
@@ -121,23 +121,18 @@ TEST(DispatchTest, ReturnsCommandResponseAsJson) {
EXPECT_EQ(HttpResponse::kOk, http_response.status());
ExpectHeaderValue(http_response, "content-type",
"application/json; charset=utf-8");
- ExpectHeaderValue(http_response, "content-length",
- base::StringPrintf("%"PRIuS, kExpectedData.length()));
// We do not know whether the response status or value will be
// encoded first, so we have to parse the response body to
// verify it is correct.
- std::string actual_data(http_response.data(),
- http_response.length());
-
int error_code;
std::string error_message;
scoped_ptr<Value> parsed_response(base::JSONReader::ReadAndReturnError(
- actual_data, base::JSON_PARSE_RFC, &error_code, &error_message));
+ http_response.body(), base::JSON_PARSE_RFC, &error_code, &error_message));
ASSERT_TRUE(parsed_response.get() != NULL) << error_message;
ASSERT_TRUE(parsed_response->IsType(Value::TYPE_DICTIONARY))
- << "Response should be a dictionary: " << actual_data;
+ << "Response should be a dictionary: " << http_response.body();
DictionaryValue* dict = static_cast<DictionaryValue*>(parsed_response.get());
EXPECT_EQ(2u, dict->size());
« no previous file with comments | « chrome/test/webdriver/webdriver_dispatch.cc ('k') | chrome/test/webdriver/webdriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698