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

Unified Diff: chrome/browser/google_apis/gdata_wapi_operations_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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: chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
index abf2b0271a0f05e72f76e1ee7a9ed31101a56b3a..66c78a59912dd0a25b120634b66c5f9c70f04570 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
@@ -302,7 +302,7 @@ class GDataWapiOperationsTest : public testing::Test {
return response.Pass();
}
- MessageLoopForUI message_loop_;
+ base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
content::TestBrowserThread io_thread_;
@@ -345,7 +345,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_DefaultFeed) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -377,7 +377,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_ValidFeed) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -410,7 +410,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_InvalidFeed) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(GDATA_PARSE_ERROR, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -434,7 +434,7 @@ TEST_F(GDataWapiOperationsTest, SearchByTitleOperation) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -458,7 +458,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceEntryOperation_ValidResourceId) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -483,7 +483,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceEntryOperation_InvalidResourceId) {
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_NOT_FOUND, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -506,7 +506,7 @@ TEST_F(GDataWapiOperationsTest, GetAccountMetadataOperation) {
test_util::CreateCopyResultCallback(&result_code, &result_data)),
true); // Include installed apps.
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -545,7 +545,7 @@ TEST_F(GDataWapiOperationsTest,
test_util::CreateCopyResultCallback(&result_code, &result_data)),
false); // Exclude installed apps.
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@@ -581,7 +581,7 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperation) {
std::string());
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_DELETE, http_request_.method);
@@ -606,7 +606,7 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperationWithETag) {
"etag");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_DELETE, http_request_.method);
@@ -633,7 +633,7 @@ TEST_F(GDataWapiOperationsTest, CreateDirectoryOperation) {
"new directory");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method);
@@ -668,7 +668,7 @@ TEST_F(GDataWapiOperationsTest, CopyHostedDocumentOperation) {
"New Document");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method);
@@ -700,7 +700,7 @@ TEST_F(GDataWapiOperationsTest, RenameResourceOperation) {
"New File");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -735,7 +735,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_ValidFeed) {
"the_app_id");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(GURL("https://entry1_open_with_link/"), result_data);
@@ -772,7 +772,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_NotFound) {
"unauthorized_app_id");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(GDATA_OTHER_ERROR, result_code);
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -807,7 +807,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_InvalidFeed) {
"APP_ID");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(GDATA_PARSE_ERROR, result_code);
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -842,7 +842,7 @@ TEST_F(GDataWapiOperationsTest, AddResourceToDirectoryOperation) {
"file:2_file_resource_id");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method);
@@ -877,7 +877,7 @@ TEST_F(GDataWapiOperationsTest, RemoveResourceFromDirectoryOperation) {
"file:2_file_resource_id");
operation_runner_->StartOperationWithRetry(operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
// DELETE method should be used, without the body content.
@@ -916,7 +916,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewFile) {
"New file");
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url);
@@ -959,7 +959,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewFile) {
kTestFilePath);
operation_runner_->StartOperationWithRetry(resume_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1018,7 +1018,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) {
"New file");
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url);
@@ -1061,7 +1061,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) {
upload_url,
kUploadContent.size());
operation_runner_->StartOperationWithRetry(get_upload_status_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1113,7 +1113,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) {
kTestFilePath);
operation_runner_->StartOperationWithRetry(resume_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1158,7 +1158,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) {
upload_url,
kUploadContent.size());
operation_runner_->StartOperationWithRetry(get_upload_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1211,7 +1211,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) {
"New file");
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url);
@@ -1254,7 +1254,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) {
kTestFilePath);
operation_runner_->StartOperationWithRetry(resume_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1301,7 +1301,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) {
std::string() /* etag */);
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server_.GetURL("/upload_existing_file"), upload_url);
@@ -1343,7 +1343,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) {
kTestFilePath);
operation_runner_->StartOperationWithRetry(resume_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1392,7 +1392,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETag) {
kTestETag);
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server_.GetURL("/upload_existing_file"), upload_url);
@@ -1434,7 +1434,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETag) {
kTestFilePath);
operation_runner_->StartOperationWithRetry(resume_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
// METHOD_PUT should be used to upload data.
EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method);
@@ -1479,7 +1479,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETagConflict) {
kWrongETag);
operation_runner_->StartOperationWithRetry(initiate_operation);
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
EXPECT_EQ(HTTP_PRECONDITION, result_code);
// For updating an existing file, METHOD_PUT should be used.

Powered by Google App Engine
This is Rietveld 408576698