| OLD | NEW |
| 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 "chrome/browser/chromeos/drive/local_file_reader.h" | 5 #include "chrome/browser/chromeos/drive/local_file_reader.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
| 15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 16 #include "chrome/browser/chromeos/drive/test_util.h" | 16 #include "chrome/browser/chromeos/drive/test_util.h" |
| 17 #include "chrome/browser/google_apis/test_util.h" | 17 #include "google_apis/drive/test_util.h" |
| 18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| 19 #include "net/base/test_completion_callback.h" | 19 #include "net/base/test_completion_callback.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 namespace drive { | 22 namespace drive { |
| 23 namespace util { | 23 namespace util { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // An adapter to use test_util::ReadAllData. | 26 // An adapter to use test_util::ReadAllData. |
| 27 class LocalFileReaderAdapter { | 27 class LocalFileReaderAdapter { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ASSERT_EQ(net::OK, callback.WaitForResult()); | 98 ASSERT_EQ(net::OK, callback.WaitForResult()); |
| 99 | 99 |
| 100 LocalFileReaderAdapter adapter(file_reader_.get()); | 100 LocalFileReaderAdapter adapter(file_reader_.get()); |
| 101 std::string content; | 101 std::string content; |
| 102 ASSERT_EQ(net::OK, test_util::ReadAllData(&adapter, &content)); | 102 ASSERT_EQ(net::OK, test_util::ReadAllData(&adapter, &content)); |
| 103 EXPECT_EQ(expected_content, content); | 103 EXPECT_EQ(expected_content, content); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace util | 106 } // namespace util |
| 107 } // namespace drive | 107 } // namespace drive |
| OLD | NEW |