| 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 "extensions/browser/api/storage/storage_frontend.h" | 5 #include "extensions/browser/api/storage/storage_frontend.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void SetUp() override { | 49 void SetUp() override { |
| 50 ExtensionsTest::SetUp(); | 50 ExtensionsTest::SetUp(); |
| 51 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 51 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 52 storage_factory_ = new ValueStoreFactoryImpl(temp_dir_.path()); | 52 storage_factory_ = new ValueStoreFactoryImpl(temp_dir_.path()); |
| 53 ResetFrontend(); | 53 ResetFrontend(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void TearDown() override { | 56 void TearDown() override { |
| 57 frontend_.reset(); | 57 frontend_.reset(); |
| 58 // Execute any pending deletion tasks. | 58 // Execute any pending deletion tasks. |
| 59 message_loop_.RunUntilIdle(); | 59 base::RunLoop().RunUntilIdle(); |
| 60 ExtensionsTest::TearDown(); | 60 ExtensionsTest::TearDown(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 void ResetFrontend() { | 64 void ResetFrontend() { |
| 65 frontend_ = | 65 frontend_ = |
| 66 StorageFrontend::CreateForTesting(storage_factory_, browser_context()); | 66 StorageFrontend::CreateForTesting(storage_factory_, browser_context()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 base::ScopedTempDir temp_dir_; | 69 base::ScopedTempDir temp_dir_; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 std::unique_ptr<base::Value> megabyte = util::CreateMegabyte(); | 215 std::unique_ptr<base::Value> megabyte = util::CreateMegabyte(); |
| 216 for (int i = 0; i < 5; ++i) { | 216 for (int i = 0; i < 5; ++i) { |
| 217 local_storage->Set(DEFAULTS, base::IntToString(i), *megabyte); | 217 local_storage->Set(DEFAULTS, base::IntToString(i), *megabyte); |
| 218 } | 218 } |
| 219 | 219 |
| 220 EXPECT_FALSE( | 220 EXPECT_FALSE( |
| 221 local_storage->Set(DEFAULTS, "WillError", *megabyte)->status().ok()); | 221 local_storage->Set(DEFAULTS, "WillError", *megabyte)->status().ok()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace extensions | 224 } // namespace extensions |
| OLD | NEW |