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

Side by Side Diff: extensions/browser/mojo/keep_alive_impl_unittest.cc

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
« no previous file with comments | « extensions/browser/mock_extension_system.cc ('k') | extensions/browser/mojo/stash_backend.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/mojo/keep_alive_impl.h" 5 #include "extensions/browser/mojo/keep_alive_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 const Extension* extension() { return extension_.get(); } 67 const Extension* extension() { return extension_.get(); }
68 68
69 int GetKeepAliveCount() { 69 int GetKeepAliveCount() {
70 return ProcessManager::Get(browser_context()) 70 return ProcessManager::Get(browser_context())
71 ->GetLazyKeepaliveCount(extension()); 71 ->GetLazyKeepaliveCount(extension());
72 } 72 }
73 73
74 private: 74 private:
75 scoped_ptr<base::MessageLoop> message_loop_; 75 std::unique_ptr<base::MessageLoop> message_loop_;
76 scoped_ptr<content::NotificationService> notification_service_; 76 std::unique_ptr<content::NotificationService> notification_service_;
77 scoped_refptr<const Extension> extension_; 77 scoped_refptr<const Extension> extension_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(KeepAliveTest); 79 DISALLOW_COPY_AND_ASSIGN(KeepAliveTest);
80 }; 80 };
81 81
82 TEST_F(KeepAliveTest, Basic) { 82 TEST_F(KeepAliveTest, Basic) {
83 mojo::InterfacePtr<KeepAlive> keep_alive; 83 mojo::InterfacePtr<KeepAlive> keep_alive;
84 CreateKeepAlive(mojo::GetProxy(&keep_alive)); 84 CreateKeepAlive(mojo::GetProxy(&keep_alive));
85 EXPECT_EQ(1, GetKeepAliveCount()); 85 EXPECT_EQ(1, GetKeepAliveCount());
86 86
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // ProcessManager and so the keep-alive count should remain unchanged. 160 // ProcessManager and so the keep-alive count should remain unchanged.
161 EXPECT_EQ(1, GetKeepAliveCount()); 161 EXPECT_EQ(1, GetKeepAliveCount());
162 162
163 // Wait for |keep_alive| to disconnect. 163 // Wait for |keep_alive| to disconnect.
164 base::RunLoop run_loop; 164 base::RunLoop run_loop;
165 keep_alive.set_connection_error_handler(run_loop.QuitClosure()); 165 keep_alive.set_connection_error_handler(run_loop.QuitClosure());
166 run_loop.Run(); 166 run_loop.Run();
167 } 167 }
168 168
169 } // namespace extensions 169 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/mock_extension_system.cc ('k') | extensions/browser/mojo/stash_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698