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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 7843 matching lines...) Expand 10 before | Expand all | Expand 10 after
7854 EXPECT_EQ(OK, rv); 7854 EXPECT_EQ(OK, rv);
7855 EXPECT_EQ("hello world", response_data); 7855 EXPECT_EQ("hello world", response_data);
7856 7856
7857 base::DeleteFile(temp_file_path, false); 7857 base::DeleteFile(temp_file_path, false);
7858 } 7858 }
7859 7859
7860 TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) { 7860 TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) {
7861 base::FilePath temp_file; 7861 base::FilePath temp_file;
7862 ASSERT_TRUE(base::CreateTemporaryFile(&temp_file)); 7862 ASSERT_TRUE(base::CreateTemporaryFile(&temp_file));
7863 std::string temp_file_content("Unreadable file."); 7863 std::string temp_file_content("Unreadable file.");
7864 ASSERT_TRUE(file_util::WriteFile(temp_file, temp_file_content.c_str(), 7864 ASSERT_TRUE(base::WriteFile(temp_file, temp_file_content.c_str(),
7865 temp_file_content.length())); 7865 temp_file_content.length()));
7866 ASSERT_TRUE(file_util::MakeFileUnreadable(temp_file)); 7866 ASSERT_TRUE(file_util::MakeFileUnreadable(temp_file));
7867 7867
7868 ScopedVector<UploadElementReader> element_readers; 7868 ScopedVector<UploadElementReader> element_readers;
7869 element_readers.push_back( 7869 element_readers.push_back(
7870 new UploadFileElementReader(base::MessageLoopProxy::current().get(), 7870 new UploadFileElementReader(base::MessageLoopProxy::current().get(),
7871 temp_file, 7871 temp_file,
7872 0, 7872 0,
7873 kuint64max, 7873 kuint64max,
7874 base::Time())); 7874 base::Time()));
(...skipping 4559 matching lines...) Expand 10 before | Expand all | Expand 10 after
12434 // established, to let the HTTP request start. 12434 // established, to let the HTTP request start.
12435 ASSERT_EQ(OK, http_callback.WaitForResult()); 12435 ASSERT_EQ(OK, http_callback.WaitForResult());
12436 std::string response_data; 12436 std::string response_data;
12437 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data)); 12437 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data));
12438 EXPECT_EQ("falafel", response_data); 12438 EXPECT_EQ("falafel", response_data);
12439 12439
12440 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); 12440 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
12441 } 12441 }
12442 12442
12443 } // namespace net 12443 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_version_upgrade_unittest.cc ('k') | net/http/transport_security_persister_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698