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

Side by Side Diff: chrome/browser/google_apis/gdata_wapi_operations_unittest.cc

Issue 12039005: drive: Deal with the root directory in the same way as others in MoveOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 818
819 TEST_F(GDataWapiOperationsTest, RemoveResourceFromDirectoryOperation) { 819 TEST_F(GDataWapiOperationsTest, RemoveResourceFromDirectoryOperation) {
820 GDataErrorCode result_code = GDATA_OTHER_ERROR; 820 GDataErrorCode result_code = GDATA_OTHER_ERROR;
821 821
822 // Remove a file from the root directory. 822 // Remove a file from the root directory.
823 RemoveResourceFromDirectoryOperation* operation = 823 RemoveResourceFromDirectoryOperation* operation =
824 new RemoveResourceFromDirectoryOperation( 824 new RemoveResourceFromDirectoryOperation(
825 &operation_registry_, 825 &operation_registry_,
826 request_context_getter_.get(), 826 request_context_getter_.get(),
827 *url_generator_,
827 base::Bind(&CopyResultFromEntryActionCallbackAndQuit, 828 base::Bind(&CopyResultFromEntryActionCallbackAndQuit,
828 &result_code), 829 &result_code),
829 test_server_.GetURL("/feeds/default/private/full/folder%3Aroot"), 830 test_server_.GetURL("/feeds/default/private/full/folder%3Aroot"),
830 "file:2_file_resource_id"); 831 "file:2_file_resource_id");
831 832
832 operation->Start(kTestGDataAuthToken, kTestUserAgent, 833 operation->Start(kTestGDataAuthToken, kTestUserAgent,
833 base::Bind(&test_util::DoNothingForReAuthenticateCallback)); 834 base::Bind(&test_util::DoNothingForReAuthenticateCallback));
834 MessageLoop::current()->Run(); 835 MessageLoop::current()->Run();
835 836
836 EXPECT_EQ(HTTP_SUCCESS, result_code); 837 EXPECT_EQ(HTTP_SUCCESS, result_code);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), 1412 EXPECT_EQ(base::Int64ToString(kUploadContent.size()),
1412 http_request_.headers["X-Upload-Content-Length"]); 1413 http_request_.headers["X-Upload-Content-Length"]);
1413 // For updating an existing file, an empty body should be attached (PUT 1414 // For updating an existing file, an empty body should be attached (PUT
1414 // requires a body) 1415 // requires a body)
1415 EXPECT_TRUE(http_request_.has_content); 1416 EXPECT_TRUE(http_request_.has_content);
1416 EXPECT_EQ("", http_request_.content); 1417 EXPECT_EQ("", http_request_.content);
1417 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); 1418 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]);
1418 } 1419 }
1419 1420
1420 } // namespace google_apis 1421 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698