| 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_write
r.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_write
r.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file.h" | 14 #include "base/files/file.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 19 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" | 19 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
| 20 #include "chrome/browser/chromeos/file_system_provider/service.h" | 20 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 21 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" | 21 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" |
| 22 #include "chrome/test/base/testing_browser_process.h" | 22 #include "chrome/test/base/testing_browser_process.h" |
| 23 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 24 #include "chrome/test/base/testing_profile_manager.h" | 24 #include "chrome/test/base/testing_profile_manager.h" |
| 25 #include "content/public/test/test_browser_thread_bundle.h" | 25 #include "content/public/test/test_browser_thread_bundle.h" |
| 26 #include "content/public/test/test_file_system_context.h" | |
| 27 #include "extensions/browser/extension_registry.h" | 26 #include "extensions/browser/extension_registry.h" |
| 28 #include "net/base/io_buffer.h" | 27 #include "net/base/io_buffer.h" |
| 29 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
| 30 #include "storage/browser/fileapi/async_file_util.h" | 29 #include "storage/browser/fileapi/async_file_util.h" |
| 31 #include "storage/browser/fileapi/external_mount_points.h" | 30 #include "storage/browser/fileapi/external_mount_points.h" |
| 32 #include "storage/browser/fileapi/file_system_url.h" | 31 #include "storage/browser/fileapi/file_system_url.h" |
| 32 #include "storage/browser/test/test_file_system_context.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 | 34 |
| 35 namespace chromeos { | 35 namespace chromeos { |
| 36 namespace file_system_provider { | 36 namespace file_system_provider { |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; | 39 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; |
| 40 const char kFileSystemId[] = "testing-file-system"; | 40 const char kFileSystemId[] = "testing-file-system"; |
| 41 const char kTextToWrite[] = "This is a test of FileStreamWriter."; | 41 const char kTextToWrite[] = "This is a test of FileStreamWriter."; |
| 42 | 42 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 ASSERT_EQ(1u, write_log.size()); | 232 ASSERT_EQ(1u, write_log.size()); |
| 233 EXPECT_EQ(sizeof(kTextToWrite) - 1, static_cast<size_t>(write_log[0])); | 233 EXPECT_EQ(sizeof(kTextToWrite) - 1, static_cast<size_t>(write_log[0])); |
| 234 | 234 |
| 235 const std::string expected_contents = original_contents + kTextToWrite; | 235 const std::string expected_contents = original_contents + kTextToWrite; |
| 236 EXPECT_EQ(expected_contents, entry->contents); | 236 EXPECT_EQ(expected_contents, entry->contents); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace file_system_provider | 239 } // namespace file_system_provider |
| 240 } // namespace chromeos | 240 } // namespace chromeos |
| OLD | NEW |