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

Side by Side Diff: components/drive/local_file_reader_unittest.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « components/drive/local_file_reader.cc ('k') | components/drive/resource_entry_conversion.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 "components/drive/local_file_reader.h" 5 #include "components/drive/local_file_reader.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include <string> 10 #include <string>
8 11
9 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 13 #include "base/files/scoped_temp_dir.h"
11 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
14 #include "base/rand_util.h" 17 #include "base/rand_util.h"
15 #include "base/threading/thread.h" 18 #include "base/threading/thread.h"
16 #include "components/drive/drive_test_util.h" 19 #include "components/drive/drive_test_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 TEST_F(LocalFileReaderTest, OpenWithOffset) { 89 TEST_F(LocalFileReaderTest, OpenWithOffset) {
87 base::FilePath test_file; 90 base::FilePath test_file;
88 std::string expected_content; 91 std::string expected_content;
89 ASSERT_TRUE(google_apis::test_util::CreateFileOfSpecifiedSize( 92 ASSERT_TRUE(google_apis::test_util::CreateFileOfSpecifiedSize(
90 temp_dir_.path(), 1024, &test_file, &expected_content)); 93 temp_dir_.path(), 1024, &test_file, &expected_content));
91 94
92 size_t offset = expected_content.size() / 2; 95 size_t offset = expected_content.size() / 2;
93 expected_content.erase(0, offset); 96 expected_content.erase(0, offset);
94 97
95 net::TestCompletionCallback callback; 98 net::TestCompletionCallback callback;
96 file_reader_->Open( 99 file_reader_->Open(test_file, static_cast<int64_t>(offset),
97 test_file, static_cast<int64>(offset), callback.callback()); 100 callback.callback());
98 ASSERT_EQ(net::OK, callback.WaitForResult()); 101 ASSERT_EQ(net::OK, callback.WaitForResult());
99 102
100 LocalFileReaderAdapter adapter(file_reader_.get()); 103 LocalFileReaderAdapter adapter(file_reader_.get());
101 std::string content; 104 std::string content;
102 ASSERT_EQ(net::OK, test_util::ReadAllData(&adapter, &content)); 105 ASSERT_EQ(net::OK, test_util::ReadAllData(&adapter, &content));
103 EXPECT_EQ(expected_content, content); 106 EXPECT_EQ(expected_content, content);
104 } 107 }
105 108
106 } // namespace util 109 } // namespace util
107 } // namespace drive 110 } // namespace drive
OLDNEW
« no previous file with comments | « components/drive/local_file_reader.cc ('k') | components/drive/resource_entry_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698