#include "net/test/url_request/url_request_test_job_backed_by_file.h"
#include "base/memory/raw_ptr.h"
#include <memory>
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/filename_util.h"
#include "net/base/net_errors.h"
#include "net/test/test_with_task_environment.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/url_constants.h"
namespace net {
namespace {
class TestURLRequestTestJobBackedByFile : public URLRequestTestJobBackedByFile { … };
struct Range { … };
class URLRequestTestJobBackedByFileEventsTest : public TestWithTaskEnvironment { … };
URLRequestTestJobBackedByFileEventsTest::
URLRequestTestJobBackedByFileEventsTest()
: … { … }
void URLRequestTestJobBackedByFileEventsTest::TearDown() { … }
void URLRequestTestJobBackedByFileEventsTest::RunSuccessfulRequestWithString(
const std::string& content,
const Range* range) { … }
void URLRequestTestJobBackedByFileEventsTest::RunSuccessfulRequestWithString(
const std::string& raw_content,
const std::string& expected_content,
const base::FilePath::StringPieceType& file_extension,
const Range* range) { … }
void URLRequestTestJobBackedByFileEventsTest::RunRequestWithPath(
const base::FilePath& path,
const std::string& range,
int* open_result,
int64_t* seek_position,
bool* done_reading,
std::string* observed_content) { … }
std::string MakeContentOfSize(int size) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, ZeroByteFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, TinyFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, SmallFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, BigFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, Range) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, DecodeSvgzFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, OpenNonExistentFile) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, MultiRangeRequestNotSupported) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, RangeExceedingFileSize) { … }
TEST_F(URLRequestTestJobBackedByFileEventsTest, IgnoreRangeParsingError) { … }
}
}