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

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store_unittest.cc

Issue 2233153002: IndexedDB: WrapUnique(new T(args..)) -> MakeUnique<T>(args...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/indexed_db/indexed_db_backing_store.h" 5 #include "content/browser/indexed_db/indexed_db_backing_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/files/scoped_temp_dir.h" 13 #include "base/files/scoped_temp_dir.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h"
16 #include "base/sequenced_task_runner.h" 17 #include "base/sequenced_task_runner.h"
17 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "base/test/test_simple_task_runner.h" 20 #include "base/test/test_simple_task_runner.h"
20 #include "content/browser/indexed_db/indexed_db_context_impl.h" 21 #include "content/browser/indexed_db/indexed_db_context_impl.h"
21 #include "content/browser/indexed_db/indexed_db_factory_impl.h" 22 #include "content/browser/indexed_db/indexed_db_factory_impl.h"
22 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" 23 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
23 #include "content/browser/indexed_db/indexed_db_value.h" 24 #include "content/browser/indexed_db/indexed_db_value.h"
24 #include "content/browser/indexed_db/leveldb/leveldb_factory.h" 25 #include "content/browser/indexed_db/leveldb/leveldb_factory.h"
25 #include "content/browser/quota/mock_quota_manager_proxy.h" 26 #include "content/browser/quota/mock_quota_manager_proxy.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static scoped_refptr<TestableIndexedDBBackingStore> Open( 70 static scoped_refptr<TestableIndexedDBBackingStore> Open(
70 IndexedDBFactory* indexed_db_factory, 71 IndexedDBFactory* indexed_db_factory,
71 const Origin& origin, 72 const Origin& origin,
72 const base::FilePath& path_base, 73 const base::FilePath& path_base,
73 net::URLRequestContext* request_context, 74 net::URLRequestContext* request_context,
74 LevelDBFactory* leveldb_factory, 75 LevelDBFactory* leveldb_factory,
75 base::SequencedTaskRunner* task_runner, 76 base::SequencedTaskRunner* task_runner,
76 leveldb::Status* status) { 77 leveldb::Status* status) {
77 DCHECK(!path_base.empty()); 78 DCHECK(!path_base.empty());
78 79
79 std::unique_ptr<LevelDBComparator> comparator(new Comparator()); 80 std::unique_ptr<LevelDBComparator> comparator =
81 base::MakeUnique<Comparator>();
80 82
81 if (!base::CreateDirectory(path_base)) { 83 if (!base::CreateDirectory(path_base)) {
82 *status = leveldb::Status::IOError("Unable to create base dir"); 84 *status = leveldb::Status::IOError("Unable to create base dir");
83 return scoped_refptr<TestableIndexedDBBackingStore>(); 85 return scoped_refptr<TestableIndexedDBBackingStore>();
84 } 86 }
85 87
86 const base::FilePath file_path = path_base.AppendASCII("test_db_path"); 88 const base::FilePath file_path = path_base.AppendASCII("test_db_path");
87 const base::FilePath blob_path = path_base.AppendASCII("test_blob_path"); 89 const base::FilePath blob_path = path_base.AppendASCII("test_blob_path");
88 90
89 std::unique_ptr<LevelDBDatabase> db; 91 std::unique_ptr<LevelDBDatabase> db;
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 1048
1047 std::vector<base::string16> names = backing_store_->GetDatabaseNames(&s); 1049 std::vector<base::string16> names = backing_store_->GetDatabaseNames(&s);
1048 EXPECT_TRUE(s.ok()); 1050 EXPECT_TRUE(s.ok());
1049 EXPECT_EQ(names.size(), 1ULL); 1051 EXPECT_EQ(names.size(), 1ULL);
1050 EXPECT_EQ(names[0], db1_name); 1052 EXPECT_EQ(names[0], db1_name);
1051 } 1053 }
1052 1054
1053 } // namespace 1055 } // namespace
1054 1056
1055 } // namespace content 1057 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.cc ('k') | content/browser/indexed_db/indexed_db_class_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698