Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/MockFetchContext.h

Issue 2692203008: Loading: use MockFetchContext in ImageResourceTest (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MockFetchContext_h 5 #ifndef MockFetchContext_h
6 #define MockFetchContext_h 6 #define MockFetchContext_h
7 7
8 #include "platform/loader/fetch/FetchContext.h" 8 #include "platform/loader/fetch/FetchContext.h"
9 #include "platform/loader/fetch/FetchRequest.h" 9 #include "platform/loader/fetch/FetchRequest.h"
10 #include "platform/network/ResourceTimingInfo.h" 10 #include "platform/network/ResourceTimingInfo.h"
11 #include "platform/scheduler/test/fake_web_task_runner.h" 11 #include "platform/scheduler/test/fake_web_task_runner.h"
12 #include "wtf/PtrUtil.h" 12 #include "wtf/PtrUtil.h"
13 13
14 #include <memory> 14 #include <memory>
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class KURL; 18 class KURL;
19 class ResourceRequest; 19 class ResourceRequest;
20 class WebTaskRunner; 20 class WebTaskRunner;
21 struct ResourceLoaderOptions; 21 struct ResourceLoaderOptions;
22 22
23 // Mocked FetchContext for testing. 23 // Mocked FetchContext for testing.
24 // TODO(toyoshim): Use this class by other unit tests that currently have own
25 // mocked FetchContext respectively.
26 class MockFetchContext : public FetchContext { 24 class MockFetchContext : public FetchContext {
27 public: 25 public:
28 enum LoadPolicy { 26 enum LoadPolicy {
29 kShouldLoadNewResource, 27 kShouldLoadNewResource,
30 kShouldNotLoadNewResource, 28 kShouldNotLoadNewResource,
31 }; 29 };
32 // TODO(toyoshim): Disallow to pass nullptr for |taskRunner|, and force to use 30 // TODO(toyoshim): Disallow to pass nullptr for |taskRunner|, and force to use
33 // FetchTestingPlatformSupport's WebTaskRunner. Probably, MockFetchContext 31 // FetchTestingPlatformSupport's WebTaskRunner. Probably, MockFetchContext
34 // would be available only through the FetchTestingPlatformSupport in the 32 // would be available only through the FetchTestingPlatformSupport in the
35 // future. 33 // future.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 enum LoadPolicy m_loadPolicy; 78 enum LoadPolicy m_loadPolicy;
81 CachePolicy m_policy; 79 CachePolicy m_policy;
82 RefPtr<WebTaskRunner> m_runner; 80 RefPtr<WebTaskRunner> m_runner;
83 bool m_complete; 81 bool m_complete;
84 long long m_transferSize; 82 long long m_transferSize;
85 }; 83 };
86 84
87 } // namespace blink 85 } // namespace blink
88 86
89 #endif 87 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698