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

Side by Side Diff: content/child/indexed_db/webidbcursor_impl_unittest.cc

Issue 2254173002: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/child/indexed_db/webidbcursor_impl.h" 5 #include "content/child/indexed_db/webidbcursor_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 }; 132 };
133 133
134 } // namespace 134 } // namespace
135 135
136 class WebIDBCursorImplTest : public testing::Test { 136 class WebIDBCursorImplTest : public testing::Test {
137 public: 137 public:
138 WebIDBCursorImplTest() { 138 WebIDBCursorImplTest() {
139 null_key_.assignNull(); 139 null_key_.assignNull();
140 thread_safe_sender_ = new ThreadSafeSender( 140 thread_safe_sender_ = new ThreadSafeSender(
141 base::ThreadTaskRunnerHandle::Get(), new MockSyncMessageFilter); 141 base::ThreadTaskRunnerHandle::Get(), new MockSyncMessageFilter);
142 dispatcher_ = 142 dispatcher_ = base::MakeUnique<MockDispatcher>(thread_safe_sender_.get());
143 base::WrapUnique(new MockDispatcher(thread_safe_sender_.get()));
144 } 143 }
145 144
146 protected: 145 protected:
147 base::MessageLoop message_loop_; 146 base::MessageLoop message_loop_;
148 WebIDBKey null_key_; 147 WebIDBKey null_key_;
149 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 148 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
150 std::unique_ptr<MockDispatcher> dispatcher_; 149 std::unique_ptr<MockDispatcher> dispatcher_;
151 150
152 private: 151 private:
153 DISALLOW_COPY_AND_ASSIGN(WebIDBCursorImplTest); 152 DISALLOW_COPY_AND_ASSIGN(WebIDBCursorImplTest);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // The real dispatcher would call cursor->CachedContinue(), so do that: 331 // The real dispatcher would call cursor->CachedContinue(), so do that:
333 MockContinueCallbacks callbacks; 332 MockContinueCallbacks callbacks;
334 cursor.CachedContinue(&callbacks); 333 cursor.CachedContinue(&callbacks);
335 334
336 // Now the cursor should have reset the rest of the cache. 335 // Now the cursor should have reset the rest of the cache.
337 EXPECT_EQ(1, dispatcher_->reset_calls()); 336 EXPECT_EQ(1, dispatcher_->reset_calls());
338 EXPECT_EQ(1, dispatcher_->last_used_count()); 337 EXPECT_EQ(1, dispatcher_->last_used_count());
339 } 338 }
340 339
341 } // namespace content 340 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_shared_bitmap_manager.cc ('k') | content/child/push_messaging/push_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698