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

Unified Diff: content/test/mock_google_streaming_server.cc

Issue 1164823002: Remove URLRequestStatus mutators and introduce FromError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: content/test/mock_google_streaming_server.cc
diff --git a/content/test/mock_google_streaming_server.cc b/content/test/mock_google_streaming_server.cc
index 5e13609060b11cc9f2df3e077d71d1dd72d5dbc7..5d8b846a6439f029a5825353b115cd39a54c62e7 100644
--- a/content/test/mock_google_streaming_server.cc
+++ b/content/test/mock_google_streaming_server.cc
@@ -14,6 +14,7 @@
#include "content/browser/speech/proto/google_streaming_api.pb.h"
#include "content/browser/speech/speech_recognition_manager_impl.h"
#include "net/base/escape.h"
+#include "net/base/net_errors.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
@@ -129,10 +130,8 @@ void MockGoogleStreamingServer::SimulateServerResponse(
bool success, const std::string& http_response) {
net::TestURLFetcher* fetcher = GetURLFetcher(true);
- net::URLRequestStatus status;
- status.set_status(success ? net::URLRequestStatus::SUCCESS :
- net::URLRequestStatus::FAILED);
- fetcher->set_status(status);
+ fetcher->set_status(
+ net::URLRequestStatus::FromError(success ? net::OK : net::ERR_FAILED));
fetcher->set_response_code(success ? 200 : 500);
fetcher->SetResponseString(http_response);
fetcher->delegate()->OnURLFetchDownloadProgress(fetcher, 0, 0);

Powered by Google App Engine
This is Rietveld 408576698