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

Side by Side Diff: google_apis/drive/drive_api_requests_unittest.cc

Issue 763833003: Remove using namespace in net/quic/quic_stream_sequencer.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missing part device_cloud_policy_manager_chromeos_unittest.cc Created 6 years 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 expected_upload_path_.clear(); 146 expected_upload_path_.clear();
147 expected_content_type_.clear(); 147 expected_content_type_.clear();
148 expected_content_.clear(); 148 expected_content_.clear();
149 } 149 }
150 150
151 // For "Children: delete" request, the server will return "204 No Content" 151 // For "Children: delete" request, the server will return "204 No Content"
152 // response meaning "success". 152 // response meaning "success".
153 scoped_ptr<net::test_server::HttpResponse> HandleChildrenDeleteRequest( 153 scoped_ptr<net::test_server::HttpResponse> HandleChildrenDeleteRequest(
154 const net::test_server::HttpRequest& request) { 154 const net::test_server::HttpRequest& request) {
155 if (request.method != net::test_server::METHOD_DELETE || 155 if (request.method != net::test_server::METHOD_DELETE ||
156 request.relative_url.find("/children/") == string::npos) { 156 request.relative_url.find("/children/") == std::string::npos) {
157 // The request is not the "Children: delete" request. Delegate the 157 // The request is not the "Children: delete" request. Delegate the
158 // processing to the next handler. 158 // processing to the next handler.
159 return scoped_ptr<net::test_server::HttpResponse>(); 159 return scoped_ptr<net::test_server::HttpResponse>();
160 } 160 }
161 161
162 http_request_ = request; 162 http_request_ = request;
163 163
164 // Return the response with just "204 No Content" status code. 164 // Return the response with just "204 No Content" status code.
165 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 165 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
166 new net::test_server::BasicHttpResponse); 166 new net::test_server::BasicHttpResponse);
(...skipping 17 matching lines...) Expand all
184 184
185 // Return the response from the data file. 185 // Return the response from the data file.
186 return test_util::CreateHttpResponseFromFile(expected_data_file_path_); 186 return test_util::CreateHttpResponseFromFile(expected_data_file_path_);
187 } 187 }
188 188
189 // Deletes the resource and returns no content with HTTP_NO_CONTENT status 189 // Deletes the resource and returns no content with HTTP_NO_CONTENT status
190 // code. 190 // code.
191 scoped_ptr<net::test_server::HttpResponse> HandleDeleteRequest( 191 scoped_ptr<net::test_server::HttpResponse> HandleDeleteRequest(
192 const net::test_server::HttpRequest& request) { 192 const net::test_server::HttpRequest& request) {
193 if (request.method != net::test_server::METHOD_DELETE || 193 if (request.method != net::test_server::METHOD_DELETE ||
194 request.relative_url.find("/files/") == string::npos) { 194 request.relative_url.find("/files/") == std::string::npos) {
195 // The file is not file deletion request. Delegate the processing to the 195 // The file is not file deletion request. Delegate the processing to the
196 // next handler. 196 // next handler.
197 return scoped_ptr<net::test_server::HttpResponse>(); 197 return scoped_ptr<net::test_server::HttpResponse>();
198 } 198 }
199 199
200 http_request_ = request; 200 http_request_ = request;
201 201
202 scoped_ptr<net::test_server::BasicHttpResponse> response( 202 scoped_ptr<net::test_server::BasicHttpResponse> response(
203 new net::test_server::BasicHttpResponse); 203 new net::test_server::BasicHttpResponse);
204 response->set_code(net::HTTP_NO_CONTENT); 204 response->set_code(net::HTTP_NO_CONTENT);
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 expected.reset(base::JSONReader::Read( 1845 expected.reset(base::JSONReader::Read(
1846 "{\"role\":\"writer\", \"type\":\"domain\",\"value\":\"example.com\"}")); 1846 "{\"role\":\"writer\", \"type\":\"domain\",\"value\":\"example.com\"}"));
1847 ASSERT_TRUE(expected); 1847 ASSERT_TRUE(expected);
1848 1848
1849 result.reset(base::JSONReader::Read(http_request_.content)); 1849 result.reset(base::JSONReader::Read(http_request_.content));
1850 EXPECT_TRUE(http_request_.has_content); 1850 EXPECT_TRUE(http_request_.has_content);
1851 EXPECT_TRUE(base::Value::Equals(expected.get(), result.get())); 1851 EXPECT_TRUE(base::Value::Equals(expected.get(), result.get()));
1852 } 1852 }
1853 1853
1854 } // namespace google_apis 1854 } // namespace google_apis
OLDNEW
« no previous file with comments | « content/browser/tracing/trace_uploader.cc ('k') | net/http/disk_cache_based_quic_server_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698