| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/fileapi/file_stream_reade
r.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reade
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" | 16 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
| 17 #include "chrome/browser/chromeos/file_system_provider/service.h" | 17 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 18 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" | 18 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" |
| 19 #include "chrome/test/base/testing_browser_process.h" | 19 #include "chrome/test/base/testing_browser_process.h" |
| 20 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 21 #include "chrome/test/base/testing_profile_manager.h" | 21 #include "chrome/test/base/testing_profile_manager.h" |
| 22 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
| 23 #include "content/public/test/test_file_system_context.h" | 23 #include "content/public/test/test_file_system_context.h" |
| 24 #include "extensions/browser/extension_registry.h" | 24 #include "extensions/browser/extension_registry.h" |
| 25 #include "net/base/io_buffer.h" | 25 #include "net/base/io_buffer.h" |
| 26 #include "net/base/net_errors.h" | 26 #include "net/base/net_errors.h" |
| 27 #include "storage/browser/fileapi/async_file_util.h" |
| 28 #include "storage/browser/fileapi/external_mount_points.h" |
| 29 #include "storage/browser/fileapi/file_system_url.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 28 #include "webkit/browser/fileapi/async_file_util.h" | |
| 29 #include "webkit/browser/fileapi/external_mount_points.h" | |
| 30 #include "webkit/browser/fileapi/file_system_url.h" | |
| 31 | 31 |
| 32 namespace chromeos { | 32 namespace chromeos { |
| 33 namespace file_system_provider { | 33 namespace file_system_provider { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; | 36 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; |
| 37 const char kFileSystemId[] = "testing-file-system"; | 37 const char kFileSystemId[] = "testing-file-system"; |
| 38 | 38 |
| 39 // Logs callbacks invocations on the file stream reader. | 39 // Logs callbacks invocations on the file stream reader. |
| 40 class EventLogger { | 40 class EventLogger { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 EXPECT_EQ(net::ERR_IO_PENDING, result); | 364 EXPECT_EQ(net::ERR_IO_PENDING, result); |
| 365 base::RunLoop().RunUntilIdle(); | 365 base::RunLoop().RunUntilIdle(); |
| 366 | 366 |
| 367 ASSERT_EQ(1u, logger.results().size()); | 367 ASSERT_EQ(1u, logger.results().size()); |
| 368 EXPECT_LT(0, logger.results()[0]); | 368 EXPECT_LT(0, logger.results()[0]); |
| 369 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]); | 369 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]); |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace file_system_provider | 372 } // namespace file_system_provider |
| 373 } // namespace chromeos | 373 } // namespace chromeos |
| OLD | NEW |