| OLD | NEW |
| 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/api/cast_channel/cast_socket_service.h" | 5 #include "components/cast_channel/cast_socket_service.h" |
| 6 #include "components/cast_channel/cast_test_util.h" |
| 6 #include "content/public/test/test_browser_thread_bundle.h" | 7 #include "content/public/test/test_browser_thread_bundle.h" |
| 7 #include "extensions/browser/api/cast_channel/cast_test_util.h" | |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 using testing::_; | 11 using testing::_; |
| 12 using testing::SaveArg; | 12 using testing::SaveArg; |
| 13 | 13 |
| 14 namespace extensions { | |
| 15 namespace api { | |
| 16 namespace cast_channel { | 14 namespace cast_channel { |
| 17 | 15 |
| 18 class CastSocketServiceTest : public testing::Test { | 16 class CastSocketServiceTest : public testing::Test { |
| 19 public: | 17 public: |
| 20 CastSocketServiceTest() | 18 CastSocketServiceTest() |
| 21 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 19 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
| 22 cast_socket_service_(new CastSocketService()) {} | 20 cast_socket_service_(new CastSocketService()) {} |
| 23 | 21 |
| 24 protected: | 22 protected: |
| 25 content::TestBrowserThreadBundle thread_bundle_; | 23 content::TestBrowserThreadBundle thread_bundle_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 EXPECT_CALL(*mock_socket, set_id(_)); | 66 EXPECT_CALL(*mock_socket, set_id(_)); |
| 69 | 67 |
| 70 auto* mock_socket_ptr = mock_socket.get(); | 68 auto* mock_socket_ptr = mock_socket.get(); |
| 71 channel_id = cast_socket_service_->AddSocket(std::move(mock_socket)); | 69 channel_id = cast_socket_service_->AddSocket(std::move(mock_socket)); |
| 72 EXPECT_EQ(mock_socket_ptr, cast_socket_service_->GetSocket(channel_id)); | 70 EXPECT_EQ(mock_socket_ptr, cast_socket_service_->GetSocket(channel_id)); |
| 73 socket = cast_socket_service_->RemoveSocket(channel_id); | 71 socket = cast_socket_service_->RemoveSocket(channel_id); |
| 74 EXPECT_TRUE(socket); | 72 EXPECT_TRUE(socket); |
| 75 } | 73 } |
| 76 | 74 |
| 77 } // namespace cast_channel | 75 } // namespace cast_channel |
| 78 } // namespace api | |
| 79 } // namespace extensions | |
| OLD | NEW |