New issue
Advanced search Search tips

Issue 751425 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 860403



Sign in to add a comment

Remove URLLoaderMockFactory related code from content (Onion Soup)

Project Member Reported by kinuko@chromium.org, Aug 2 2017

Issue description

Update (2017/09/28 by toyoshim)

With inputs from yhirano and kinuko, I wrote a planning document for this bug.
https://docs.google.com/document/d/1sg2qgKG3uvm7AM-iztvC7TrYprnjIL8_qOCnYbaP3Bk/edit?usp=sharing

---- original description follows ----
This should probably be able to be done with following steps:

- Migrate all Blink unittests that use CreateURLLoader / GetURLLoaderMockFactory over TestingPlatformSupport or FetchTestingPlatformSupport (like what platform tests do)

- Deprecate TestBlinkPlatformSupport::GetURLLoaderMockFactory() (all test code can just use TestingPlatformSupport's one)

- Remove all the URLLoaderMockFactory related code from content and WebKit/public (e.g. Platform::GetURLLoaderMockFactory and WebURLLoaderMockFactory)
 

Comment 1 by junwei...@intel.com, Aug 15 2017

I'm interested in trying this out, but i don't exactly understand those steps.

- Migrate all Blink unittests that use CreateURLLoader / GetURLLoaderMockFactory over TestingPlatformSupport or FetchTestingPlatformSupport (like what platform tests do)

Do I understand correctly that there is no Blink unittest using CreateURLLoader? The usage of  GetURLLoaderMockFactory in unittests with  Platform::Current() such as [1], how to migrate?

- Deprecate TestBlinkPlatformSupport::GetURLLoaderMockFactory() (all test code can just use TestingPlatformSupport's one)

Has it deprecated?

- Remove all the URLLoaderMockFactory related code from content and WebKit/public (e.g. Platform::GetURLLoaderMockFactory and WebURLLoaderMockFactory)

Does it mean remove function Platform::GetURLLoaderMockFactory [2]

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/loader/DocumentLoaderTest.cpp?q=GetURLLoaderMockFactory&dr=C&l=78
[2] https://cs.chromium.org/chromium/src/third_party/WebKit/public/platform/Platform.h?dr=C&l=471

Cc: toyoshim@chromium.org
Labels: -Type-Bug Type-Task
I'm reviewing one CL that is related to this bug. The migration steps I understand are

1. Replace all Platform::Current()->GetURLLoaderMockFactory() calls with TestingPlatformSupport's GetURLLoaderMockFactory().
2. Deprecate TestBlinkPlatformSupport::GetURLLoaderMockFactory() and TestBlinkWebUnitTestSupport::GetURLLoaderMockFactory() that have been called via Platform::Current() until 1. is done.
3. Deprecate Platform::GetURLLoaderMockFactory interface.
4. Move required WebURLLoaderMockFactory functionalities into TestingPlatformSupport, and deprecate WebURLLoaderMockFactory.

All steps can be done incrementally, and contributions would be very appreciated.

Project Member

Comment 4 by bugdroid1@chromium.org, Sep 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783

commit 00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783
Author: Yeol <peary2@gmail.com>
Date: Wed Sep 13 09:58:21 2017

Replace Platform::Current() with TestingPlatformSupport to call GetURLLoaderMockFactory.

It's modified in core/frame and /platform.

Bug: 751425
Change-Id: Ibe09bbd6debbcfcbef5624f98ec486770d97698c
Reviewed-on: https://chromium-review.googlesource.com/611742
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501581}
[modify] https://crrev.com/00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783/third_party/WebKit/Source/core/frame/BrowserControlsTest.cpp
[modify] https://crrev.com/00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783/third_party/WebKit/Source/core/frame/FrameSerializerTest.cpp
[modify] https://crrev.com/00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783/third_party/WebKit/Source/core/frame/MHTMLTest.cpp
[modify] https://crrev.com/00b3e3e1f5b222b72e4f0d7e33fff59aa0eb4783/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Sep 15 2017

Description: Show this description
Owner: toyoshim@chromium.org
Status: Started (was: Available)
Let me take a tentative ownership to mark the bug status as Started.
Actual code owner is Yoel as you see in the commit logs, but only project members can be assigned to the owner by another people, IIUC.

Yoel, if you can edit the owner label by yourself, please update it to be you.
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/017b79e68acccf53f361d80168cb85daa9c4a8b4

commit 017b79e68acccf53f361d80168cb85daa9c4a8b4
Author: Kinuko Yasuda <kinuko@chromium.org>
Date: Tue Oct 24 17:46:10 2017

Always use per-frame / per-context URLLoaderFactory via WebURLLoaderFactory

Replacing CreateURLLoader() in following places with CreateURLLoaderFactory:
- WebFrameClient (e.g. RenderFrameImpl)
- WebWorkerFetchContext
- Platform

And always try to use the created URLLoaderFactory for the context (e.g.
Frame, Worker context or FetchContext).

Remaining TODOs:
- We should remove the WebURLLoaderFactoryWithMock impl in //content and all
  test harness should create its own blink::WebURLLoaderFactoryWithMock
  w/o going though Platform layer (crbug.com/751425)
- Once we finalize the MojoLoading migration WebURLLoaderFactory should be
  replaced with mojo::URLLoaderFactory
- (More code cleanup around throttles etc)

Bug:  712913 , 751425
Change-Id: I4249fd9cf5b056802dc57138e9555d5d9c00122a
Reviewed-on: https://chromium-review.googlesource.com/708074
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511202}
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/components/plugins/renderer/webview_plugin.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/components/plugins/renderer/webview_plugin.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/components/printing/renderer/print_render_frame_helper.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/ppapi_plugin/ppapi_blink_platform_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/ppapi_plugin/ppapi_blink_platform_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/loader/web_url_loader_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/loader/web_url_loader_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/render_frame_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/renderer_blink_platform_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/renderer_blink_platform_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/service_worker/service_worker_fetch_context_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/service_worker/service_worker_fetch_context_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/service_worker/worker_fetch_context_impl.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/renderer/service_worker/worker_fetch_context_impl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/test/test_blink_web_unit_test_support.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/test/test_blink_web_unit_test_support.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/test/test_render_frame.cc
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/content/test/test_render_frame.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/exported/WorkerShadowPage.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/exported/WorkerShadowPage.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/FrameTestHelpers.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/FrameTestHelpers.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/LocalFrameClient.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/loader/EmptyClients.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/BUILD.gn
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/testing/FetchTestingPlatformSupport.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/testing/FetchTestingPlatformSupport.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h
[add] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/testing/WebURLLoaderFactoryWithMock.cpp
[add] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/loader/testing/WebURLLoaderFactoryWithMock.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/Source/platform/testing/URLTestHelpers.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/BUILD.gn
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/platform/Platform.h
[add] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/platform/WebURLLoaderFactory.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/platform/WebWorkerFetchContext.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/web/WebFrameClient.h
[modify] https://crrev.com/017b79e68acccf53f361d80168cb85daa9c4a8b4/third_party/WebKit/public/web/WebLocalFrame.h

 Issue 690400  has been merged into this issue.
Blocking: 860403

Sign in to add a comment