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

Side by Side Diff: net/url_request/url_fetcher_impl_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup_util.cc ('k') | net/url_request/url_request_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) 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 "net/url_request/url_fetcher_impl.h" 5 #include "net/url_request/url_fetcher_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 fetcher_->SetUploadFilePath("application/x-www-form-urlencoded", 548 fetcher_->SetUploadFilePath("application/x-www-form-urlencoded",
549 path_, 549 path_,
550 range_offset_, 550 range_offset_,
551 range_length_, 551 range_length_,
552 base::MessageLoopProxy::current()); 552 base::MessageLoopProxy::current());
553 fetcher_->Start(); 553 fetcher_->Start();
554 } 554 }
555 555
556 void URLFetcherPostFileTest::OnURLFetchComplete(const URLFetcher* source) { 556 void URLFetcherPostFileTest::OnURLFetchComplete(const URLFetcher* source) {
557 std::string expected; 557 std::string expected;
558 ASSERT_TRUE(file_util::ReadFileToString(path_, &expected)); 558 ASSERT_TRUE(base::ReadFileToString(path_, &expected));
559 ASSERT_LE(range_offset_, expected.size()); 559 ASSERT_LE(range_offset_, expected.size());
560 uint64 expected_size = 560 uint64 expected_size =
561 std::min(range_length_, expected.size() - range_offset_); 561 std::min(range_length_, expected.size() - range_offset_);
562 562
563 std::string data; 563 std::string data;
564 EXPECT_TRUE(source->GetResponseAsString(&data)); 564 EXPECT_TRUE(source->GetResponseAsString(&data));
565 EXPECT_EQ(expected.substr(range_offset_, expected_size), data); 565 EXPECT_EQ(expected.substr(range_offset_, expected_size), data);
566 URLFetcherTest::OnURLFetchComplete(source); 566 URLFetcherTest::OnURLFetchComplete(source);
567 } 567 }
568 568
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 1532
1533 base::MessageLoop::current()->RunUntilIdle(); 1533 base::MessageLoop::current()->RunUntilIdle();
1534 ASSERT_EQ(kTake[i], base::PathExists(file_path_)) << 1534 ASSERT_EQ(kTake[i], base::PathExists(file_path_)) <<
1535 "FilePath: " << file_path_.value(); 1535 "FilePath: " << file_path_.value();
1536 } 1536 }
1537 } 1537 }
1538 1538
1539 } // namespace 1539 } // namespace
1540 1540
1541 } // namespace net 1541 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup_util.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698