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

Side by Side Diff: content/browser/blob_storage/blob_url_request_job_unittest.cc

Issue 2082343002: Remove calls to deprecated MessageLoop methods in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Created 4 years, 5 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 void TestRequest(const std::string& method, 265 void TestRequest(const std::string& method,
266 const net::HttpRequestHeaders& extra_headers) { 266 const net::HttpRequestHeaders& extra_headers) {
267 request_ = url_request_context_.CreateRequest( 267 request_ = url_request_context_.CreateRequest(
268 GURL("blob:blah"), net::DEFAULT_PRIORITY, &url_request_delegate_); 268 GURL("blob:blah"), net::DEFAULT_PRIORITY, &url_request_delegate_);
269 request_->set_method(method); 269 request_->set_method(method);
270 if (!extra_headers.IsEmpty()) 270 if (!extra_headers.IsEmpty())
271 request_->SetExtraRequestHeaders(extra_headers); 271 request_->SetExtraRequestHeaders(extra_headers);
272 request_->Start(); 272 request_->Start();
273 273
274 base::MessageLoop::current()->Run(); 274 base::RunLoop().Run();
275 275
276 // Verify response. 276 // Verify response.
277 EXPECT_TRUE(request_->status().is_success()); 277 EXPECT_TRUE(request_->status().is_success());
278 EXPECT_EQ(expected_status_code_, 278 EXPECT_EQ(expected_status_code_,
279 request_->response_headers()->response_code()); 279 request_->response_headers()->response_code());
280 EXPECT_EQ(expected_response_, url_request_delegate_.response_data()); 280 EXPECT_EQ(expected_response_, url_request_delegate_.response_data());
281 } 281 }
282 282
283 void BuildComplicatedData(std::string* expected_result) { 283 void BuildComplicatedData(std::string* expected_result) {
284 blob_data_->AppendData(kTestData1 + 1, 2); 284 blob_data_->AppendData(kTestData1 + 1, 2);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 expected_status_code_ = 200; 597 expected_status_code_ = 200;
598 expected_response_ = kTestDiskCacheData2; 598 expected_response_ = kTestDiskCacheData2;
599 TestRequest("GET", net::HttpRequestHeaders()); 599 TestRequest("GET", net::HttpRequestHeaders());
600 EXPECT_EQ(static_cast<int>(arraysize(kTestDiskCacheData2) - 1), 600 EXPECT_EQ(static_cast<int>(arraysize(kTestDiskCacheData2) - 1),
601 request_->response_headers()->GetContentLength()); 601 request_->response_headers()->GetContentLength());
602 602
603 EXPECT_FALSE(url_request_delegate_.metadata()); 603 EXPECT_FALSE(url_request_delegate_.metadata());
604 } 604 }
605 605
606 } // namespace content 606 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/blob_storage/blob_reader_unittest.cc ('k') | content/browser/browser_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698