| 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 | 20 |
| 23 protected: | 21 protected: |
| 24 content::TestBrowserThreadBundle thread_bundle_; | 22 content::TestBrowserThreadBundle thread_bundle_; |
| 25 CastSocketService cast_socket_service_; | 23 CastSocketService cast_socket_service_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 EXPECT_CALL(*mock_socket, set_id(_)); | 68 EXPECT_CALL(*mock_socket, set_id(_)); |
| 71 | 69 |
| 72 auto* mock_socket_ptr = mock_socket.get(); | 70 auto* mock_socket_ptr = mock_socket.get(); |
| 73 channel_id = registry->AddSocket(std::move(mock_socket)); | 71 channel_id = registry->AddSocket(std::move(mock_socket)); |
| 74 EXPECT_EQ(mock_socket_ptr, registry->GetSocket(channel_id)); | 72 EXPECT_EQ(mock_socket_ptr, registry->GetSocket(channel_id)); |
| 75 socket = registry->RemoveSocket(channel_id); | 73 socket = registry->RemoveSocket(channel_id); |
| 76 EXPECT_TRUE(socket); | 74 EXPECT_TRUE(socket); |
| 77 } | 75 } |
| 78 | 76 |
| 79 } // namespace cast_channel | 77 } // namespace cast_channel |
| 80 } // namespace api | |
| 81 } // namespace extensions | |
| OLD | NEW |