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

Unified Diff: remoting/host/client_session_unittest.cc

Issue 2627433003: Remove ScopedVector from remoting/. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session_unittest.cc
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 920f3da6d948fd62cc5ea526e8a875640b9dafd9..c4d3a3feba659d2290f8dd794d15c45cbd0e6a61 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -127,9 +127,8 @@ class ClientSessionTest : public testing::Test {
// require it.
base::RunLoop run_loop_;
- // HostExtensions to pass when creating the ClientSession. Caller retains
- // ownership of the HostExtensions themselves.
- std::vector<HostExtension*> extensions_;
+ // HostExtensions to pass when creating the ClientSession.
+ std::vector<std::unique_ptr<HostExtension>> extensions_;
// ClientSession instance under test.
std::unique_ptr<ClientSession> client_session_;
@@ -383,12 +382,12 @@ TEST_F(ClientSessionTest, ClampMouseEvents) {
// HostExtensionSessionManager unit-tests.
TEST_F(ClientSessionTest, Extensions) {
// Configure fake extensions for testing.
- FakeExtension extension1("ext1", "cap1");
- extensions_.push_back(&extension1);
- FakeExtension extension2("ext2", "");
- extensions_.push_back(&extension2);
- FakeExtension extension3("ext3", "cap3");
- extensions_.push_back(&extension3);
+ extensions_.push_back(base::MakeUnique<FakeExtension>("ext1", "cap1"));
+ extensions_.push_back(base::MakeUnique<FakeExtension>("ext2", std::string()));
+ extensions_.push_back(base::MakeUnique<FakeExtension>("ext3", "cap3"));
+ FakeExtension* extension1 = static_cast<FakeExtension*>(extensions_[0].get());
+ FakeExtension* extension2 = static_cast<FakeExtension*>(extensions_[1].get());
+ FakeExtension* extension3 = static_cast<FakeExtension*>(extensions_[2].get());
// Verify that the ClientSession reports the correct capabilities.
EXPECT_CALL(client_stub_, SetCapabilities(EqCapabilities("cap1 cap3")));
@@ -420,15 +419,15 @@ TEST_F(ClientSessionTest, Extensions) {
base::RunLoop().RunUntilIdle();
// ext1 was instantiated and sent a message, and did not wrap anything.
- EXPECT_TRUE(extension1.was_instantiated());
- EXPECT_TRUE(extension1.has_handled_message());
+ EXPECT_TRUE(extension1->was_instantiated());
+ EXPECT_TRUE(extension1->has_handled_message());
// ext2 was instantiated but not sent a message, and wrapped video encoder.
- EXPECT_TRUE(extension2.was_instantiated());
- EXPECT_FALSE(extension2.has_handled_message());
+ EXPECT_TRUE(extension2->was_instantiated());
+ EXPECT_FALSE(extension2->has_handled_message());
// ext3 was sent a message but not instantiated.
- EXPECT_FALSE(extension3.was_instantiated());
+ EXPECT_FALSE(extension3->was_instantiated());
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698