chromium/third_party/blink/renderer/core/testing/sim/sim_request.h

// 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.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_SIM_SIM_REQUEST_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_SIM_SIM_REQUEST_H_

#include <optional>

#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

class SimNetwork;
class StaticDataNavigationBodyLoader;
class URLLoaderClient;

// Simulates a single request for a resource from the server. Requires a
// SimNetwork to have been created first. Use the Write(), Finish() and
// Complete() methods to simulate the response from the server.
// Note that all requests must be finished.
class SimRequestBase {};

// This request can be used as a main resource request for navigation.
// It does not allow starting asynchronously, because that's not how
// navigations work in reality.
// TODO(dgozman): rename this to SimNavigationRequest or something.
class SimRequest final : public SimRequestBase {};

// This request can be started asynchronously, suited for simulating
// delayed load of subresources.
class SimSubresourceRequest final : public SimRequestBase {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_SIM_SIM_REQUEST_H_