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

Side by Side Diff: content/test/mock_google_streaming_server.cc

Issue 2303653002: Precache per-resource cap should be applied on network bytes used (Closed)
Patch Set: rebased Created 4 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/test/mock_google_streaming_server.h" 5 #include "content/test/mock_google_streaming_server.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 void MockGoogleStreamingServer::SimulateServerResponse( 132 void MockGoogleStreamingServer::SimulateServerResponse(
133 bool success, const std::string& http_response) { 133 bool success, const std::string& http_response) {
134 net::TestURLFetcher* fetcher = GetURLFetcher(true); 134 net::TestURLFetcher* fetcher = GetURLFetcher(true);
135 135
136 fetcher->set_status( 136 fetcher->set_status(
137 net::URLRequestStatus::FromError(success ? net::OK : net::ERR_FAILED)); 137 net::URLRequestStatus::FromError(success ? net::OK : net::ERR_FAILED));
138 fetcher->set_response_code(success ? 200 : 500); 138 fetcher->set_response_code(success ? 200 : 500);
139 fetcher->SetResponseString(http_response); 139 fetcher->SetResponseString(http_response);
140 fetcher->delegate()->OnURLFetchDownloadProgress(fetcher, 0, 0); 140 fetcher->delegate()->OnURLFetchDownloadProgress(fetcher, 0, 0, 0);
141 } 141 }
142 142
143 // Can return NULL if the SpeechRecognizer has not requested the connection yet. 143 // Can return NULL if the SpeechRecognizer has not requested the connection yet.
144 net::TestURLFetcher* MockGoogleStreamingServer::GetURLFetcher( 144 net::TestURLFetcher* MockGoogleStreamingServer::GetURLFetcher(
145 bool downstream) const { 145 bool downstream) const {
146 return url_fetcher_factory_.GetFetcherByID( 146 return url_fetcher_factory_.GetFetcherByID(
147 downstream ? kDownstreamUrlFetcherId : kUpstreamUrlFetcherId); 147 downstream ? kDownstreamUrlFetcherId : kUpstreamUrlFetcherId);
148 } 148 }
149 149
150 } // namespace content 150 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_engine_unittest.cc ('k') | google_apis/drive/base_requests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698