| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 using File = arc::FakeFileSystemInstance::File; | 26 using File = arc::FakeFileSystemInstance::File; |
| 27 | 27 |
| 28 namespace arc { | 28 namespace arc { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 constexpr char kArcUrl[] = "content://org.chromium.foo/bar"; | 32 constexpr char kArcUrl[] = "content://org.chromium.foo/bar"; |
| 33 constexpr char kData[] = "abcdef"; | 33 constexpr char kData[] = "abcdef"; |
| 34 constexpr char kMimeType[] = "application/octet-stream"; |
| 34 | 35 |
| 35 class ArcContentFileSystemAsyncFileUtilTest : public testing::Test { | 36 class ArcContentFileSystemAsyncFileUtilTest : public testing::Test { |
| 36 public: | 37 public: |
| 37 ArcContentFileSystemAsyncFileUtilTest() = default; | 38 ArcContentFileSystemAsyncFileUtilTest() = default; |
| 38 ~ArcContentFileSystemAsyncFileUtilTest() override = default; | 39 ~ArcContentFileSystemAsyncFileUtilTest() override = default; |
| 39 | 40 |
| 40 void SetUp() override { | 41 void SetUp() override { |
| 41 fake_file_system_.AddFile(File(kArcUrl, kData, File::Seekable::NO)); | 42 fake_file_system_.AddFile( |
| 43 File(kArcUrl, kData, kMimeType, File::Seekable::NO)); |
| 42 | 44 |
| 43 arc_service_manager_ = base::MakeUnique<ArcServiceManager>(nullptr); | 45 arc_service_manager_ = base::MakeUnique<ArcServiceManager>(nullptr); |
| 44 arc_service_manager_->AddService( | 46 arc_service_manager_->AddService( |
| 45 ArcFileSystemOperationRunner::CreateForTesting( | 47 ArcFileSystemOperationRunner::CreateForTesting( |
| 46 arc_service_manager_->arc_bridge_service())); | 48 arc_service_manager_->arc_bridge_service())); |
| 47 arc_service_manager_->arc_bridge_service()->file_system()->SetInstance( | 49 arc_service_manager_->arc_bridge_service()->file_system()->SetInstance( |
| 48 &fake_file_system_); | 50 &fake_file_system_); |
| 49 } | 51 } |
| 50 | 52 |
| 51 protected: | 53 protected: |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const base::File::Info& info) { | 87 const base::File::Info& info) { |
| 86 EXPECT_EQ(base::File::FILE_OK, error); | 88 EXPECT_EQ(base::File::FILE_OK, error); |
| 87 EXPECT_EQ(static_cast<int64_t>(strlen(kData)), info.size); | 89 EXPECT_EQ(static_cast<int64_t>(strlen(kData)), info.size); |
| 88 run_loop->Quit(); | 90 run_loop->Quit(); |
| 89 }, | 91 }, |
| 90 &run_loop)); | 92 &run_loop)); |
| 91 run_loop.Run(); | 93 run_loop.Run(); |
| 92 } | 94 } |
| 93 | 95 |
| 94 } // namespace arc | 96 } // namespace arc |
| OLD | NEW |