Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Side by Side Diff: extensions/browser/api/storage/storage_api_unittest.cc

Issue 2252373002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_udp/sockets_udp_api_unittest.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698