#include "content/browser/service_worker/service_worker_updated_script_loader.h"
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_consts.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/public/test/browser_task_environment.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "net/base/load_flags.h"
#include "net/base/test_completion_callback.h"
#include "net/http/http_util.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/network/test/test_url_loader_client.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h"
#include "url/origin.h"
namespace content {
namespace service_worker_updated_script_loader_unittest {
const char kNormalScriptURL[] = …;
class MockHTTPServer { … };
class ServiceWorkerUpdatedScriptLoaderTest
: public testing::TestWithParam<blink::mojom::ScriptType> { … };
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, FirstBlockDifferent) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, MiddleBlockDifferent) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, LastBlockDifferent) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, LastBlockDifferentCompleted) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, NewScriptLargerThanOld) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, NewScriptEmptyBody) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, CompleteFailed) { … }
TEST_P(ServiceWorkerUpdatedScriptLoaderTest, ClientConsumeNetworkLater) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}