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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 444163003: Move the rest of test_file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 4 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
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/spdy/spdy_network_transaction_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 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 "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 8132 matching lines...) Expand 10 before | Expand all | Expand 10 after
8143 8143
8144 base::DeleteFile(temp_file_path, false); 8144 base::DeleteFile(temp_file_path, false);
8145 } 8145 }
8146 8146
8147 TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) { 8147 TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) {
8148 base::FilePath temp_file; 8148 base::FilePath temp_file;
8149 ASSERT_TRUE(base::CreateTemporaryFile(&temp_file)); 8149 ASSERT_TRUE(base::CreateTemporaryFile(&temp_file));
8150 std::string temp_file_content("Unreadable file."); 8150 std::string temp_file_content("Unreadable file.");
8151 ASSERT_TRUE(base::WriteFile(temp_file, temp_file_content.c_str(), 8151 ASSERT_TRUE(base::WriteFile(temp_file, temp_file_content.c_str(),
8152 temp_file_content.length())); 8152 temp_file_content.length()));
8153 ASSERT_TRUE(file_util::MakeFileUnreadable(temp_file)); 8153 ASSERT_TRUE(base::MakeFileUnreadable(temp_file));
8154 8154
8155 ScopedVector<UploadElementReader> element_readers; 8155 ScopedVector<UploadElementReader> element_readers;
8156 element_readers.push_back( 8156 element_readers.push_back(
8157 new UploadFileElementReader(base::MessageLoopProxy::current().get(), 8157 new UploadFileElementReader(base::MessageLoopProxy::current().get(),
8158 temp_file, 8158 temp_file,
8159 0, 8159 0,
8160 kuint64max, 8160 kuint64max,
8161 base::Time())); 8161 base::Time()));
8162 UploadDataStream upload_data_stream(element_readers.Pass(), 0); 8162 UploadDataStream upload_data_stream(element_readers.Pass(), 0);
8163 8163
(...skipping 5041 matching lines...) Expand 10 before | Expand all | Expand 10 after
13205 EXPECT_EQ(ERR_IO_PENDING, rv); 13205 EXPECT_EQ(ERR_IO_PENDING, rv);
13206 13206
13207 rv = callback.WaitForResult(); 13207 rv = callback.WaitForResult();
13208 EXPECT_EQ(ERR_CONNECTION_RESET, rv); 13208 EXPECT_EQ(ERR_CONNECTION_RESET, rv);
13209 13209
13210 const HttpResponseInfo* response = trans->GetResponseInfo(); 13210 const HttpResponseInfo* response = trans->GetResponseInfo();
13211 EXPECT_TRUE(response == NULL); 13211 EXPECT_TRUE(response == NULL);
13212 } 13212 }
13213 13213
13214 } // namespace net 13214 } // namespace net
OLDNEW
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698