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

Issue 2549093008: Loading: Use MockResource in ResourceFetcherTest.cpp (Closed)

Created:
4 years ago by Takashi Toyoshima
Modified:
4 years ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews+fetch_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Loading: Use MockResource in ResourceFetcherTest.cpp Now tests in ResourceFetcherTest.cpp use ImageResource for testing, but ImageResource will be moved to core/loader/resource/, and core/fetch should not have a dependency to the core/loader/. This patch introduces MockResource and uses it in several tests in ResourceFetcherTest.cpp. BUG=655920 TEST=webkit_unit_tests --gtest_filter='ResourceFetcherTest.*' Committed: https://crrev.com/ab9d0bcb41c77781cf482f4937686cc604b41112 Cr-Commit-Position: refs/heads/master@{#438456}

Patch Set 1 #

Patch Set 2 : MockResource.* #

Patch Set 3 : cleanup #

Total comments: 6

Patch Set 4 : review https://codereview.chromium.org/2549093008/#msg4 #

Patch Set 5 : Use Resource::Mock type, and run cl format #

Total comments: 2

Patch Set 6 : review #18 #

Total comments: 1

Patch Set 7 : [rebase] #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -56 lines) Patch
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/fetch/MockResource.h View 1 2 3 4 5 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/fetch/MockResource.cpp View 1 2 3 4 1 chunk +41 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 4 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp View 1 2 3 4 5 6 18 chunks +62 lines, -54 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 37 (21 generated)
Takashi Toyoshima
ptal
4 years ago (2016-12-07 11:54:31 UTC) #3
yhirano
> This patch introduces MockResource and use it in several tests in ResourceFetcherTest.cpp. s/use/uses/ https://codereview.chromium.org/2549093008/diff/40001/third_party/WebKit/Source/core/fetch/MockResource.cpp ...
4 years ago (2016-12-08 07:57:52 UTC) #4
Takashi Toyoshima
https://codereview.chromium.org/2549093008/diff/40001/third_party/WebKit/Source/core/fetch/MockResource.cpp File third_party/WebKit/Source/core/fetch/MockResource.cpp (right): https://codereview.chromium.org/2549093008/diff/40001/third_party/WebKit/Source/core/fetch/MockResource.cpp#newcode27 third_party/WebKit/Source/core/fetch/MockResource.cpp:27: Resource::Type m_type; On 2016/12/08 07:57:52, yhirano wrote: > You ...
4 years ago (2016-12-09 05:31:54 UTC) #10
yhirano
lgtm
4 years ago (2016-12-09 05:39:41 UTC) #11
hiroshige
Am I understanding below of the intent of this CL correctly? MockResource is a 'generic' ...
4 years ago (2016-12-11 19:11:13 UTC) #12
Takashi Toyoshima
Yep, you understand my intention correctly. I discussed with yhirano@ offline. So, how about adding ...
4 years ago (2016-12-13 06:26:36 UTC) #13
Takashi Toyoshima
+tkent for BUILD.gn
4 years ago (2016-12-13 06:57:27 UTC) #15
hiroshige
> adding new Resource::Type lgtm, provided it is fine with toyoshim@ and yhirano@. I am ...
4 years ago (2016-12-13 08:47:46 UTC) #18
Takashi Toyoshima
Thanks. One additional pros of this approach is that this change teaches me which code ...
4 years ago (2016-12-13 12:23:45 UTC) #21
Takashi Toyoshima
https://codereview.chromium.org/2549093008/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2549093008/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode1560 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:1560: case Resource::Mock: Note: I could not catch this at ...
4 years ago (2016-12-13 12:27:49 UTC) #22
tkent
lgtm
4 years ago (2016-12-13 23:15:20 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2549093008/100001
4 years ago (2016-12-14 03:57:09 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/122545) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years ago (2016-12-14 03:58:54 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2549093008/120001
4 years ago (2016-12-14 05:29:19 UTC) #32
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years ago (2016-12-14 07:39:54 UTC) #35
commit-bot: I haz the power
4 years ago (2016-12-14 07:41:45 UTC) #37
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/ab9d0bcb41c77781cf482f4937686cc604b41112
Cr-Commit-Position: refs/heads/master@{#438456}

Powered by Google App Engine
This is Rietveld 408576698