| 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 "content/browser/dom_storage/local_storage_context_mojo.h" | 5 #include "content/browser/dom_storage/local_storage_context_mojo.h" |
| 6 | 6 |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "components/filesystem/public/interfaces/file_system.mojom.h" | 10 #include "components/filesystem/public/interfaces/file_system.mojom.h" |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 service_factory_bindings_; | 567 service_factory_bindings_; |
| 568 std::unique_ptr<service_manager::ServiceContext> file_service_context_; | 568 std::unique_ptr<service_manager::ServiceContext> file_service_context_; |
| 569 }; | 569 }; |
| 570 | 570 |
| 571 } // namespace | 571 } // namespace |
| 572 | 572 |
| 573 class LocalStorageContextMojoTestWithService | 573 class LocalStorageContextMojoTestWithService |
| 574 : public service_manager::test::ServiceTest { | 574 : public service_manager::test::ServiceTest { |
| 575 public: | 575 public: |
| 576 LocalStorageContextMojoTestWithService() | 576 LocalStorageContextMojoTestWithService() |
| 577 : ServiceTest("content_unittests", false) {} | 577 : ServiceTest("content_unittests") {} |
| 578 ~LocalStorageContextMojoTestWithService() override {} | 578 ~LocalStorageContextMojoTestWithService() override {} |
| 579 | 579 |
| 580 protected: | 580 protected: |
| 581 void SetUp() override { | 581 void SetUp() override { |
| 582 ServiceTest::SetUp(); | 582 ServiceTest::SetUp(); |
| 583 ASSERT_TRUE(temp_path_.CreateUniqueTempDir()); | 583 ASSERT_TRUE(temp_path_.CreateUniqueTempDir()); |
| 584 file::AssociateServiceUserIdWithUserDir(test_userid(), | 584 file::AssociateServiceUserIdWithUserDir(test_userid(), |
| 585 temp_path_.GetPath()); | 585 temp_path_.GetPath()); |
| 586 } | 586 } |
| 587 | 587 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 // Should have created files. | 726 // Should have created files. |
| 727 EXPECT_EQ(test_path, FirstEntryInDir().BaseName()); | 727 EXPECT_EQ(test_path, FirstEntryInDir().BaseName()); |
| 728 | 728 |
| 729 // Should be able to re-open. | 729 // Should be able to re-open. |
| 730 context.reset(new LocalStorageContextMojo(connector(), test_path)); | 730 context.reset(new LocalStorageContextMojo(connector(), test_path)); |
| 731 EXPECT_TRUE(DoTestGet(context.get(), key, &result)); | 731 EXPECT_TRUE(DoTestGet(context.get(), key, &result)); |
| 732 EXPECT_EQ(value, result); | 732 EXPECT_EQ(value, result); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace content | 735 } // namespace content |
| OLD | NEW |