chromium/remoting/protocol/ice_transport_unittest.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/protocol/ice_transport.h"

#include <memory>
#include <utility>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/webrtc/thread_wrapper.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/fake_authenticator.h"
#include "remoting/protocol/message_channel_factory.h"
#include "remoting/protocol/message_pipe.h"
#include "remoting/protocol/transport_context.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h"

_;

namespace remoting::protocol {

namespace {

// Send 100 messages 1024 bytes each. UDP messages are sent with 10ms delay
// between messages (about 1 second for 100 messages).
const int kMessageSize =;
const int kMessages =;
const char kChannelName[] =;

ACTION_P2(QuitRunLoopOnCounter, run_loop, counter) {}

class MockChannelCreatedCallback {};

class TestTransportEventHandler : public IceTransport::EventHandler {};

}  // namespace

class IceTransportTest : public testing::Test {};

// crbug.com/1224862: Tests are flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_DataStream
#else
#define MAYBE_DataStream
#endif
TEST_F(IceTransportTest, MAYBE_DataStream) {}

// crbug.com/1224862: Tests are flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_MuxDataStream
#else
#define MAYBE_MuxDataStream
#endif
TEST_F(IceTransportTest, MAYBE_MuxDataStream) {}

// crbug.com/1224862: Tests are flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_FailedChannelAuth
#else
#define MAYBE_FailedChannelAuth
#endif
TEST_F(IceTransportTest, MAYBE_FailedChannelAuth) {}

// Verify that channels are never marked connected if connection cannot be
// established.
TEST_F(IceTransportTest, TestBrokenTransport) {}

TEST_F(IceTransportTest, TestCancelChannelCreation) {}

// crbug.com/1224862: Tests are flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_TestDelayedSignaling
#else
#define MAYBE_TestDelayedSignaling
#endif
// Verify that we can still connect even when there is a delay in signaling
// messages delivery.
TEST_F(IceTransportTest, MAYBE_TestDelayedSignaling) {}

}  // namespace remoting::protocol