summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/loader/testing/fetch_testing_platform_support.h
blob: 10e4c61c53236004b8999aef75823de6aa7af679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2017 The Chromium Authors. All rights reserved.
// 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_PLATFORM_LOADER_TESTING_FETCH_TESTING_PLATFORM_SUPPORT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_TESTING_FETCH_TESTING_PLATFORM_SUPPORT_H_

#include <memory>
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h"

namespace blink {

class MockFetchContext;

class FetchTestingPlatformSupport
    : public TestingPlatformSupportWithMockScheduler {
 public:
  FetchTestingPlatformSupport();
  ~FetchTestingPlatformSupport() override;

  MockFetchContext* Context();

  // Platform:
  WebURLLoaderMockFactory* GetURLLoaderMockFactory() override;
  std::unique_ptr<WebURLLoaderFactory> CreateDefaultURLLoaderFactory() override;

 private:
  class FetchTestingWebURLLoaderMockFactory;

  Persistent<MockFetchContext> context_;
  std::unique_ptr<WebURLLoaderMockFactory> url_loader_mock_factory_;

  DISALLOW_COPY_AND_ASSIGN(FetchTestingPlatformSupport);
};

}  // namespace blink

#endif