chromium/third_party/blink/renderer/platform/media/resource_multi_buffer_data_provider_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.

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

#include "third_party/blink/renderer/platform/media/resource_multi_buffer_data_provider.h"

#include <stdint.h>

#include <algorithm>
#include <string>
#include <utility>

#include "base/containers/contains.h"
#include "base/containers/heap_array.h"
#include "base/format_macros.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "media/base/media_log.h"
#include "media/base/seekable_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_network_state_notifier.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/renderer/platform/media/testing/mock_resource_fetch_context.h"
#include "third_party/blink/renderer/platform/media/testing/mock_web_associated_url_loader.h"
#include "third_party/blink/renderer/platform/media/url_index.h"

namespace blink {

_;
Invoke;
NiceMock;
Truly;

const char kHttpUrl[] =;
const char kHttpRedirect[] =;
const char kEtag[] =;

const int kDataSize =;
const int kHttpOK =;
const int kHttpPartialContent =;

enum NetworkState {};

// Predicate that checks the Accept-Encoding request header.
static bool CorrectAcceptEncoding(const WebURLRequest& request) {}

class ResourceMultiBufferDataProviderTest : public testing::Test {};

TEST_F(ResourceMultiBufferDataProviderTest, StartStop) {}

// Tests that a bad HTTP response is recived, e.g. file not found.
TEST_F(ResourceMultiBufferDataProviderTest, BadHttpResponse) {}

// Tests that partial content is requested but not fulfilled.
TEST_F(ResourceMultiBufferDataProviderTest, NotPartialResponse) {}

// Tests that a 200 response is received.
TEST_F(ResourceMultiBufferDataProviderTest, FullResponse) {}

// Tests that a partial content response is received.
TEST_F(ResourceMultiBufferDataProviderTest, PartialResponse) {}

TEST_F(ResourceMultiBufferDataProviderTest, PartialResponse_Chunked) {}

TEST_F(ResourceMultiBufferDataProviderTest, PartialResponse_NoAcceptRanges) {}

TEST_F(ResourceMultiBufferDataProviderTest,
       PartialResponse_ChunkedNoAcceptRanges) {}

// Tests that an invalid partial response is received.
TEST_F(ResourceMultiBufferDataProviderTest, InvalidPartialResponse) {}

TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) {}

// Tests partial response after a redirect.
TEST_F(ResourceMultiBufferDataProviderTest, TestRedirectedPartialResponse) {}

}  // namespace blink