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

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

Issue 12785003: Implement generic CreateCopyResultCallback and RunAndQuit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update comments. Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/google_apis/test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/drive_api_operations_unittest.cc
diff --git a/chrome/browser/google_apis/drive_api_operations_unittest.cc b/chrome/browser/google_apis/drive_api_operations_unittest.cc
index 8216c0836a51cb638045f2525d685aef12aaf448..648a579bf3336d1890923d1b3e3de51a07582d71 100644
--- a/chrome/browser/google_apis/drive_api_operations_unittest.cc
+++ b/chrome/browser/google_apis/drive_api_operations_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/drive_api_url_generator.h"
#include "chrome/browser/google_apis/operation_registry.h"
+#include "chrome/browser/google_apis/task_util.h"
#include "chrome/browser/google_apis/test_server/http_request.h"
#include "chrome/browser/google_apis/test_server/http_response.h"
#include "chrome/browser/google_apis/test_server/http_server.h"
@@ -38,16 +39,6 @@ const char kTestChildrenResponse[] =
const char kTestUploadExistingFilePath[] = "/upload/existingfile/path";
const char kTestUploadNewFilePath[] = "/upload/newfile/path";
-void CopyResultsFromGetAboutResourceCallbackAndQuit(
- GDataErrorCode* error_out,
- scoped_ptr<AboutResource>* about_resource_out,
- const GDataErrorCode error_in,
- scoped_ptr<AboutResource> about_resource_in) {
- *error_out = error_in;
- *about_resource_out = about_resource_in.Pass();
- MessageLoop::current()->Quit();
-}
-
void CopyResultsFromFileResourceCallbackAndQuit(
GDataErrorCode* error_out,
scoped_ptr<FileResource>* file_resource_out,
@@ -339,8 +330,9 @@ TEST_F(DriveApiOperationsTest, GetAboutOperation_ValidFeed) {
&operation_registry_,
request_context_getter_.get(),
*url_generator_,
- base::Bind(&CopyResultsFromGetAboutResourceCallbackAndQuit,
- &error, &feed_data));
+ CreateComposedCallback(
+ base::Bind(&test_util::RunAndQuit),
+ test_util::CreateCopyResultCallback(&error, &feed_data)));
operation->Start(kTestDriveApiAuthToken, kTestUserAgent,
base::Bind(&test_util::DoNothingForReAuthenticateCallback));
MessageLoop::current()->Run();
@@ -371,8 +363,9 @@ TEST_F(DriveApiOperationsTest, GetAboutOperation_InvalidFeed) {
&operation_registry_,
request_context_getter_.get(),
*url_generator_,
- base::Bind(&CopyResultsFromGetAboutResourceCallbackAndQuit,
- &error, &feed_data));
+ CreateComposedCallback(
+ base::Bind(&test_util::RunAndQuit),
+ test_util::CreateCopyResultCallback(&error, &feed_data)));
operation->Start(kTestDriveApiAuthToken, kTestUserAgent,
base::Bind(&test_util::DoNothingForReAuthenticateCallback));
MessageLoop::current()->Run();
« no previous file with comments | « no previous file | chrome/browser/google_apis/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698