chromium/components/cronet/native/engine_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "cronet_c.h"

#include "base/test/gtest_util.h"
#include "build/build_config.h"
#include "components/cronet/native/engine.h"
#include "components/cronet/native/generated/cronet.idl_impl_struct.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cronet {

namespace {

// Fake sent byte count for metrics testing.
constexpr int64_t kSentByteCount =;

// App implementation of Cronet_Executor methods.
void TestExecutor_Execute(Cronet_ExecutorPtr self, Cronet_RunnablePtr command) {}

// Context for TestRequestInfoListener_OnRequestFinished().
TestOnRequestFinishedClientContext;

// App implementation of Cronet_RequestFinishedInfoListener methods.
//
// Expects a client context of type TestOnRequestFinishedClientContext -- will
// increment this value.
void TestRequestInfoListener_OnRequestFinished(
    Cronet_RequestFinishedInfoListenerPtr self,
    Cronet_RequestFinishedInfoPtr request_info,
    Cronet_UrlResponseInfoPtr url_response_info,
    Cronet_ErrorPtr error) {}

TEST(EngineUnitTest, HasNoRequestFinishedInfoListener) {}

TEST(EngineUnitTest, HasRequestFinishedInfoListener) {}

TEST(EngineUnitTest, RequestFinishedInfoListeners) {}

TEST(EngineUnitTest, AddNullRequestFinishedInfoListener) {}

TEST(EngineUnitTest, AddNullRequestFinishedInfoExecutor) {}

TEST(EngineUnitTest, AddNullRequestFinishedInfoListenerAndExecutor) {}

TEST(EngineUnitTest, AddListenerTwice) {}

TEST(EngineUnitTest, RemoveNonexistentListener) {}

TEST(EngineUnitTest, RemoveNonexistentListenerWithAddedListener) {}

TEST(EngineUnitTest, RemoveNullListener) {}

}  // namespace
}  // namespace cronet