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

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

Issue 548343004: Move chrome/test/data/gdata/testfile.txt to chrome/test/data/drive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/test/data/gdata/testfile.txt ('k') | google_apis/drive/drive_api_requests_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "google_apis/drive/base_requests.h" 5 #include "google_apis/drive/base_requests.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 base::FilePath temp_file; 74 base::FilePath temp_file;
75 { 75 {
76 base::RunLoop run_loop; 76 base::RunLoop run_loop;
77 DownloadFileRequestBase* request = new DownloadFileRequestBase( 77 DownloadFileRequestBase* request = new DownloadFileRequestBase(
78 request_sender_.get(), 78 request_sender_.get(),
79 test_util::CreateQuitCallback( 79 test_util::CreateQuitCallback(
80 &run_loop, 80 &run_loop,
81 test_util::CreateCopyResultCallback(&result_code, &temp_file)), 81 test_util::CreateCopyResultCallback(&result_code, &temp_file)),
82 GetContentCallback(), 82 GetContentCallback(),
83 ProgressCallback(), 83 ProgressCallback(),
84 test_server_.GetURL("/files/gdata/testfile.txt"), 84 test_server_.GetURL("/files/drive/testfile.txt"),
85 GetTestCachedFilePath( 85 GetTestCachedFilePath(
86 base::FilePath::FromUTF8Unsafe("cached_testfile.txt"))); 86 base::FilePath::FromUTF8Unsafe("cached_testfile.txt")));
87 request_sender_->StartRequestWithRetry(request); 87 request_sender_->StartRequestWithRetry(request);
88 run_loop.Run(); 88 run_loop.Run();
89 } 89 }
90 90
91 std::string contents; 91 std::string contents;
92 base::ReadFileToString(temp_file, &contents); 92 base::ReadFileToString(temp_file, &contents);
93 base::DeleteFile(temp_file, false); 93 base::DeleteFile(temp_file, false);
94 94
95 EXPECT_EQ(HTTP_SUCCESS, result_code); 95 EXPECT_EQ(HTTP_SUCCESS, result_code);
96 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); 96 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
97 EXPECT_EQ("/files/gdata/testfile.txt", http_request_.relative_url); 97 EXPECT_EQ("/files/drive/testfile.txt", http_request_.relative_url);
98 98
99 const base::FilePath expected_path = 99 const base::FilePath expected_path =
100 test_util::GetTestFilePath("gdata/testfile.txt"); 100 test_util::GetTestFilePath("drive/testfile.txt");
101 std::string expected_contents; 101 std::string expected_contents;
102 base::ReadFileToString(expected_path, &expected_contents); 102 base::ReadFileToString(expected_path, &expected_contents);
103 EXPECT_EQ(expected_contents, contents); 103 EXPECT_EQ(expected_contents, contents);
104 } 104 }
105 105
106 TEST_F(BaseRequestsServerTest, DownloadFileRequest_NonExistentFile) { 106 TEST_F(BaseRequestsServerTest, DownloadFileRequest_NonExistentFile) {
107 GDataErrorCode result_code = GDATA_OTHER_ERROR; 107 GDataErrorCode result_code = GDATA_OTHER_ERROR;
108 base::FilePath temp_file; 108 base::FilePath temp_file;
109 { 109 {
110 base::RunLoop run_loop; 110 base::RunLoop run_loop;
(...skipping 11 matching lines...) Expand all
122 run_loop.Run(); 122 run_loop.Run();
123 } 123 }
124 EXPECT_EQ(HTTP_NOT_FOUND, result_code); 124 EXPECT_EQ(HTTP_NOT_FOUND, result_code);
125 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); 125 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
126 EXPECT_EQ("/files/gdata/no-such-file.txt", 126 EXPECT_EQ("/files/gdata/no-such-file.txt",
127 http_request_.relative_url); 127 http_request_.relative_url);
128 // Do not verify the not found message. 128 // Do not verify the not found message.
129 } 129 }
130 130
131 } // namespace google_apis 131 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/test/data/gdata/testfile.txt ('k') | google_apis/drive/drive_api_requests_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698