| 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_api.h" | 5 #include "extensions/browser/api/storage/storage_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Caller owns the returned object. | 35 // Caller owns the returned object. |
| 36 std::unique_ptr<KeyedService> CreateStorageFrontendForTesting( | 36 std::unique_ptr<KeyedService> CreateStorageFrontendForTesting( |
| 37 content::BrowserContext* context) { | 37 content::BrowserContext* context) { |
| 38 scoped_refptr<ValueStoreFactory> factory = | 38 scoped_refptr<ValueStoreFactory> factory = |
| 39 new ValueStoreFactoryImpl(context->GetPath()); | 39 new ValueStoreFactoryImpl(context->GetPath()); |
| 40 return StorageFrontend::CreateForTesting(factory, context); | 40 return StorageFrontend::CreateForTesting(factory, context); |
| 41 } | 41 } |
| 42 | 42 |
| 43 std::unique_ptr<KeyedService> BuildEventRouter( | 43 std::unique_ptr<KeyedService> BuildEventRouter( |
| 44 content::BrowserContext* context) { | 44 content::BrowserContext* context) { |
| 45 return base::WrapUnique(new extensions::EventRouter(context, nullptr)); | 45 return base::MakeUnique<extensions::EventRouter>(context, nullptr); |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 class StorageApiUnittest : public ApiUnitTest { | 50 class StorageApiUnittest : public ApiUnitTest { |
| 51 public: | 51 public: |
| 52 StorageApiUnittest() {} | 52 StorageApiUnittest() {} |
| 53 ~StorageApiUnittest() override {} | 53 ~StorageApiUnittest() override {} |
| 54 | 54 |
| 55 protected: | 55 protected: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 EXPECT_TRUE(leveldb_store->Get(kKey)->status().IsCorrupted()); | 122 EXPECT_TRUE(leveldb_store->Get(kKey)->status().IsCorrupted()); |
| 123 | 123 |
| 124 // Running another set should end up working (even though it will restore the | 124 // Running another set should end up working (even though it will restore the |
| 125 // store behind the scenes). | 125 // store behind the scenes). |
| 126 RunSetFunction(kKey, kValue); | 126 RunSetFunction(kKey, kValue); |
| 127 EXPECT_TRUE(RunGetFunction(kKey, &result)); | 127 EXPECT_TRUE(RunGetFunction(kKey, &result)); |
| 128 EXPECT_EQ(kValue, result); | 128 EXPECT_EQ(kValue, result); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace extensions | 131 } // namespace extensions |
| OLD | NEW |