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

Side by Side Diff: extensions/browser/load_monitoring_extension_host_queue_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/load_monitoring_extension_host_queue.h" 5 #include "extensions/browser/load_monitoring_extension_host_queue.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <vector> 10 #include <vector>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue()), 63 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue()),
64 base::TimeDelta(), // no delay, easier to test 64 base::TimeDelta(), // no delay, easier to test
65 base::Bind(&LoadMonitoringExtensionHostQueueTest::Finished, 65 base::Bind(&LoadMonitoringExtensionHostQueueTest::Finished,
66 base::Unretained(this)))); 66 base::Unretained(this))));
67 } 67 }
68 68
69 protected: 69 protected:
70 // Creates a new DeferredStartRenderHost. Ownership is held by this class, 70 // Creates a new DeferredStartRenderHost. Ownership is held by this class,
71 // not passed to caller. 71 // not passed to caller.
72 StubDeferredStartRenderHost* CreateHost() { 72 StubDeferredStartRenderHost* CreateHost() {
73 stubs_.push_back(base::WrapUnique(new StubDeferredStartRenderHost())); 73 stubs_.push_back(base::MakeUnique<StubDeferredStartRenderHost>());
74 return stubs_.back().get(); 74 return stubs_.back().get();
75 } 75 }
76 76
77 // Our single LoadMonitoringExtensionHostQueue instance. 77 // Our single LoadMonitoringExtensionHostQueue instance.
78 LoadMonitoringExtensionHostQueue* queue() { return queue_.get(); } 78 LoadMonitoringExtensionHostQueue* queue() { return queue_.get(); }
79 79
80 // Returns true if the queue has finished monitoring. 80 // Returns true if the queue has finished monitoring.
81 bool finished() const { return finished_; } 81 bool finished() const { return finished_; }
82 82
83 // These are available after the queue has finished (in which case finished() 83 // These are available after the queue has finished (in which case finished()
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 queue()->Remove(host3); 348 queue()->Remove(host3);
349 queue()->Remove(host4); 349 queue()->Remove(host4);
350 350
351 EXPECT_FALSE(host1->IsObservedBy(queue())); 351 EXPECT_FALSE(host1->IsObservedBy(queue()));
352 EXPECT_FALSE(host2->IsObservedBy(queue())); 352 EXPECT_FALSE(host2->IsObservedBy(queue()));
353 EXPECT_FALSE(host3->IsObservedBy(queue())); 353 EXPECT_FALSE(host3->IsObservedBy(queue()));
354 EXPECT_FALSE(host4->IsObservedBy(queue())); 354 EXPECT_FALSE(host4->IsObservedBy(queue()));
355 } 355 }
356 356
357 } // namespace extensions 357 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/lazy_background_task_queue_unittest.cc ('k') | extensions/browser/mojo/stash_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698