1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CAST_STREAMING_TESTING_SIMPLE_SOCKET_SUBSCRIBER_H_ 6 #define CAST_STREAMING_TESTING_SIMPLE_SOCKET_SUBSCRIBER_H_ 7 8 #include "cast/streaming/environment.h" 9 #include "gtest/gtest.h" 10 11 namespace openscreen { 12 namespace cast { 13 14 class SimpleSubscriber : public Environment::SocketSubscriber { OnSocketReady()15 void OnSocketReady() {} OnSocketInvalid(Error error)16 void OnSocketInvalid(Error error) { ASSERT_TRUE(error.ok()) << error; } 17 }; 18 19 } // namespace cast 20 } // namespace openscreen 21 22 #endif // CAST_STREAMING_TESTING_SIMPLE_SOCKET_SUBSCRIBER_H_ 23