chromium/content/browser/webrtc/webrtc_internals_unittest.cc

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

#include "content/browser/webrtc/webrtc_internals.h"

#include <memory>
#include <string>
#include <string_view>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "content/browser/webrtc/webrtc_internals_connections_observer.h"
#include "content/browser/webrtc/webrtc_internals_ui_observer.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {

namespace {

const GlobalRenderFrameHostId kFrameId =;
const int kLid =;
const int kPid =;
const int kRequestId =;
const char kRtcConfiguration[] =;
const char kUrl[] =;
const char* const kWakeLockConnectingValues[] =;
const char* const kWakeLockDisconnectingValues[] =;
const char kAudioConstraint[] =;
const char kVideoConstraint[] =;

const char kStreamId[] =;
const char kAudioTrackInfo[] =;
const char kVideoTrackInfo[] =;
const char kGetUserMediaError[] =;
const char kGetUserMediaErrorMessage[] =;

class MockWebRtcInternalsProxy : public WebRTCInternalsUIObserver {};

class MockWakeLock : public device::mojom::WakeLock {};

class TestWebRtcConnectionsObserver
    : public WebRtcInternalsConnectionsObserver {};

}  // namespace

// Derived class for testing only.  Allows the tests to have their own instance
// for testing and control the period for which WebRTCInternals will bulk up
// updates (changes down from 500ms to 1ms).
class WebRTCInternalsForTest : public WebRTCInternals {};

class WebRtcInternalsTest : public testing::Test {};

TEST_F(WebRtcInternalsTest, AddRemoveObserver) {}

TEST_F(WebRtcInternalsTest, EnsureNoLogWhenNoObserver) {}

TEST_F(WebRtcInternalsTest, EnsureLogIsRemovedWhenObserverIsRemoved) {}

TEST_F(WebRtcInternalsTest, SendAddPeerConnectionUpdate) {}

TEST_F(WebRtcInternalsTest, SendRemovePeerConnectionUpdate) {}

TEST_F(WebRtcInternalsTest, SendUpdatePeerConnectionUpdate) {}

TEST_F(WebRtcInternalsTest, AddGetUserMedia) {}

TEST_F(WebRtcInternalsTest, UpdateGetUserMediaSuccess) {}

TEST_F(WebRtcInternalsTest, UpdateGetUserMediaError) {}

TEST_F(WebRtcInternalsTest, AddGetDisplayMedia) {}

TEST_F(WebRtcInternalsTest, UpdateGetDisplayMediaSuccess) {}

TEST_F(WebRtcInternalsTest, UpdateGetDisplayMediaError) {}

TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) {}

TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetDisplayMedia) {}

TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) {}

TEST_F(WebRtcInternalsTest, OnAddStandardStats) {}

TEST_F(WebRtcInternalsTest, OnAddLegacyStats) {}

TEST_F(WebRtcInternalsTest, AudioDebugRecordingsFileSelectionCanceled) {}

TEST_F(WebRtcInternalsTest, WakeLockCreateRemove) {}

TEST_F(WebRtcInternalsTest, WakeLockConnecting) {}

TEST_F(WebRtcInternalsTest, WakeLockConnectingSequence) {}

TEST_F(WebRtcInternalsTest, WakeLockDisconnecting) {}

TEST_F(WebRtcInternalsTest, WakeLockDisconnectingSequence) {}

TEST_F(WebRtcInternalsTest, WakeLockReconnect) {}

TEST_F(WebRtcInternalsTest, WakeLockMultplePeerConnections) {}

TEST_F(WebRtcInternalsTest, TestWebRtcConnectionsObserver) {}

// TODO(eladalon): Add tests that WebRtcEventLogger::Enable/Disable is
// correctly called. https://crbug.com/775415

}  // namespace content