New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 776589 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug
Proj-Servicification

Blocked on:
issue 803434

Blocking:
issue 598073
issue 756642
issue 769401



Sign in to add a comment

Many browser tests fail with network service because of using net::URLRequestFilter.

Project Member Reported by yzshen@chromium.org, Oct 19 2017

Issue description

Since the network service lives in a separate process, net::URLRequestFilter is not able to intercept requests.

We probably need to provide an interceptor interface for testing purpose and convert those tests to use that interface.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 20 2017

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

commit e54520533b7d2fae1996e078b6eef5a5137d596c
Author: Yuzhu Shen <yzshen@chromium.org>
Date: Fri Oct 20 05:01:55 2017

Network service: update the browser test filter.

Add bug link for tests using net::URLRequestFilter (directly or indirectly).

BUG= 776589 
TBR=jam@chromium.org

Change-Id: I3f75f84a81dd1fc129179d94757fbe33d49ef8b8
Reviewed-on: https://chromium-review.googlesource.com/729051
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510345}
[modify] https://crrev.com/e54520533b7d2fae1996e078b6eef5a5137d596c/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Comment 2 by mmenke@chromium.org, Oct 20 2017

A lot of tests, though probably not all, may be able to use the EmbeddedTestServer server instead (Which provides more functionality than the SpawnedTestServer, which was all that was available when a lot of those tests were written).

Comment 3 by yzshen@chromium.org, Oct 20 2017

Thanks for the information, Matt!

Agreed that using EmbeddedTestServer should work for quite a lot of them.

One thing to consider is that it would be nice if we could minimize the amount changes. Currently there are a few hundreds of failing tests using this class (directly or indirectly).

Another idea is to provide a registration API to ask the network service to hand over the URLLoader request and URLLoaderClient pointer for given URLs, and then the tests can do whatever they want with that request. On top of that we could build some helper class to make it look similar to net::URLRequestFilter.

Maybe it makes sense to look at a few examples and see how big the change would be with both solutions.

 

Comment 4 by mmenke@chromium.org, Oct 20 2017

The nice thing about switching to embedded test server is that it makes the tests robust against the network API - they no longer depend on it at all, just the embedded test server API.

I think the more relevant count is there are about 30 tests fixtures with failing tests.  I'm not sure that switching a test fixture over to using a MockURLLoader would be substantially simpler than just moving it over to the embedded test server.

Test that just use URLRequestMockHTTPJob::GetMockURL, for instance (Like browser_encoding_browsertest.cc), can trivially be switched over to the embedded test server - it support the same mock header format as URLRequestMockHTTPJob does.  Things that need to actually inject custom errors and responses may be more problematic.

Comment 5 by dougt@chromium.org, Oct 20 2017

Blocking: 756642

Comment 6 by yzshen@chromium.org, Oct 20 2017

Thanks Matt!

Then I think we could start with switching those easy ones, and add support for the other approach only when needed.

Comment 7 by dougt@chromium.org, Oct 20 2017

Blocking: 598073
Project Member

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

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

commit 6ccfd56b6026ff542e4bc4076e8a8e7a9cae0b41
Author: Yuzhu Shen <yzshen@chromium.org>
Date: Fri Oct 27 16:38:18 2017

Change PolicyTest.*URLBlacklist* to use EmbeddedTestServer.

Before this CL, they relies on net::URLRequestFilter which doesn't work
with network service.

BUG= 776589 

Change-Id: I5427a80dbbe9f021762d85dcf641f8b195fd5e61
Reviewed-on: https://chromium-review.googlesource.com/738641
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512203}
[modify] https://crrev.com/6ccfd56b6026ff542e4bc4076e8a8e7a9cae0b41/chrome/browser/policy/policy_browsertest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 29 2017

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

commit 0595cb6cdaddc81e8abaa4636c0c4a15300176f0
Author: Matt Menke <mmenke@chromium.org>
Date: Sun Oct 29 22:40:30 2017

Make SavePageTests pass when using the network service.

In particular, switch them to using the EmbeddedTestServer from
URLRequestFilter, which required them to be in the same process
as the network stack.

Bug:  776589 
Change-Id: I4fd64fa427adedfd383dee8f86c21c4955d7f3eb
Reviewed-on: https://chromium-review.googlesource.com/731523
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512422}
[modify] https://crrev.com/0595cb6cdaddc81e8abaa4636c0c4a15300176f0/chrome/browser/download/save_page_browsertest.cc
[modify] https://crrev.com/0595cb6cdaddc81e8abaa4636c0c4a15300176f0/chrome/test/data/save_page/b.saved1.htm
[modify] https://crrev.com/0595cb6cdaddc81e8abaa4636c0c4a15300176f0/chrome/test/data/save_page/b.saved2.htm
[modify] https://crrev.com/0595cb6cdaddc81e8abaa4636c0c4a15300176f0/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 1 2017

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

commit 67e7103a27d838ae424de756465bdf62340416bd
Author: Matt Menke <mmenke@chromium.org>
Date: Wed Nov 01 15:09:18 2017

Make BrowserEncodingBrowsertests pass when using the network service.

In particular, switch them to using the EmbeddedTestServer from
URLRequestFilter, which required them to be in the same process
as the network stack.

Bug:  776589 
Change-Id: I5d4d363d47149a11ccb38b5c18d8c57c377b58b4
Reviewed-on: https://chromium-review.googlesource.com/730888
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513128}
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/browser/browser_encoding_browsertest.cc
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_EUC-KR_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_GBK_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8-I_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html
[modify] https://crrev.com/67e7103a27d838ae424de756465bdf62340416bd/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Comment 11 by jam@chromium.org, Nov 3 2017

Cc: jam@chromium.org
just saw this, +1 to comments 4 & 6. I was looking at failing SSL interstitial tests in SafeBrowsingBlockingPageBrowserTest that used this pattern.

Comment 12 by jam@chromium.org, Nov 3 2017

(btw to clarify, I'm not planning on looking at any other tests other than the SB ones)
Project Member

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

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

commit c7c1e28239c9a4a906067226e000aa7a54448009
Author: John Abd-El-Malek <jam@chromium.org>
Date: Sat Nov 04 02:38:51 2017

Fix SafeBrowsingBlockingPageBrowserTest tests with network service that were using URLRequestMockHTTPJob::GetMockURL.

Most were were fixed by converting to using test server. A small number depended on 2 fixes from https://chromium-review.googlesource.com/c/chromium/src/+/751685 (fixing SSL interstitials, and classifying frame requests correctly as main/subframe).

BUG= 776589 

Change-Id: I3d2f64ce517e0bbd86c515b5ea9925145091d4a6
Reviewed-on: https://chromium-review.googlesource.com/754297
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514019}
[modify] https://crrev.com/c7c1e28239c9a4a906067226e000aa7a54448009/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
[modify] https://crrev.com/c7c1e28239c9a4a906067226e000aa7a54448009/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

I will take a look at other failing tests that can be fixed by replacing URLRequestMockHTTPJob::GetMockURL().
Components: -Internals>Network>Service Internals>Services>Network
Apologies, applied the wrong component in bulk.
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 7 2017

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

commit 3ec06a12371335b2423d502e614fc47181cfd938
Author: Jun Cai <juncai@chromium.org>
Date: Tue Nov 07 21:01:43 2017

NetworkService: Fix some browser tests that were using URLRequestMockHTTPJob::GetMockUrl

This CL fixes some browser tests by using test server instead of
URLRequestMockHTTPJob::GetMockUrl().

Bug:  776589 
Change-Id: I6b84173cdbf5904393ea8bcd4d0c92729c873387
Reviewed-on: https://chromium-review.googlesource.com/755522
Commit-Queue: Jun Cai <juncai@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514578}
[modify] https://crrev.com/3ec06a12371335b2423d502e614fc47181cfd938/chrome/browser/lifetime/browser_close_manager_browsertest.cc
[modify] https://crrev.com/3ec06a12371335b2423d502e614fc47181cfd938/chrome/browser/net/dns_probe_browsertest.cc
[modify] https://crrev.com/3ec06a12371335b2423d502e614fc47181cfd938/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/3ec06a12371335b2423d502e614fc47181cfd938/chrome/browser/unload_browsertest.cc
[modify] https://crrev.com/3ec06a12371335b2423d502e614fc47181cfd938/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 10 2017

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

commit aa2486918bbb95f045f7027fa103b2ed4e6e02ac
Author: Jun Cai <juncai@chromium.org>
Date: Fri Nov 10 20:10:51 2017

NetworkService: Fix some policy browser test that was using URLRequestMockHTTPJob::GetMockUrl

This CL fixes some policy browser test by using test server instead of
URLRequestMockHTTPJob::GetMockUrl().

Bug:  776589 
Change-Id: I5e0171d7de3756a4773f0e50be5d18e92a9d9403
Reviewed-on: https://chromium-review.googlesource.com/762117
Commit-Queue: Jun Cai <juncai@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515655}
[modify] https://crrev.com/aa2486918bbb95f045f7027fa103b2ed4e6e02ac/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/aa2486918bbb95f045f7027fa103b2ed4e6e02ac/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 18 by bugdroid1@chromium.org, Nov 17 2017

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

commit f6c24adb89d5c8aa0741da20484adcac4cd30e1b
Author: Jun Cai <juncai@chromium.org>
Date: Fri Nov 17 20:54:29 2017

NetworkService: Fix some ErrorPageTest that was using URLRequestMockHTTPJob::GetMockUrl

This CL fixes some ErrorPageTest by using test server instead of
URLRequestMockHTTPJob::GetMockUrl().

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I4c14d6e6f15b2435eb6bd3ca22afe3ad6b7a8a11
Reviewed-on: https://chromium-review.googlesource.com/772872
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Commit-Queue: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517548}
[modify] https://crrev.com/f6c24adb89d5c8aa0741da20484adcac4cd30e1b/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/f6c24adb89d5c8aa0741da20484adcac4cd30e1b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Comment 19 by jam@chromium.org, Nov 20 2017

Owner: juncai@chromium.org
Status: Assigned (was: Untriaged)
Status: Started (was: Assigned)

Comment 21 by jam@chromium.org, Nov 21 2017

 Issue 779236  has been merged into this issue.
Project Member

Comment 22 by bugdroid1@chromium.org, Nov 27 2017

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

commit a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Nov 27 15:54:14 2017

Fix most NoStatePrefetchBrowserTest tests with network service.

The tests use a net::URLRequestInterceptor which doesn't work with the network service since net/ is running in a different process. Instead, count the requests at the embedded test server level.

This fixes most of the tests; a few remaining ones check the load flags of the request. These will be converted in a followup once we have a way to intercept resource requests with the network service.

BUG= 776589 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ia5cb60b6c926743864b40f54ebc6691b755ab1bd
Reviewed-on: https://chromium-review.googlesource.com/790151
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519310}
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/browser/prerender/prerender_test_utils.cc
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/browser/prerender/prerender_test_utils.h
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/test/data/prerender/prefetch_meta_csp.html
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/test/data/prerender/prefetch_response_csp.html
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/chrome/test/data/prerender/prefetch_response_csp.html.mock-http-headers
[modify] https://crrev.com/a18f9780c274ea7dc9a12b15c0d1f5b7e8076cb0/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 23 by bugdroid1@chromium.org, Nov 27 2017

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

commit a4bb87fb66e8ef6d20f3836d514017528909d5c9
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Nov 27 21:32:19 2017

Add a helper class for intercepting URLLoader requests.

This allows test to monitor and intercept:
-frame requests (for now only with network service, until non-NS code path starts using URLLoader)
-subresources requests (both with and without network service)

Bug:  776589 
Change-Id: I34a7e4ce57b966109bd421beac6eeab26481a2f7
Reviewed-on: https://chromium-review.googlesource.com/789355
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519412}
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/appcache/appcache_subresource_url_factory.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/appcache/appcache_update_job.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/appcache/appcache_update_job_unittest.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/appcache/appcache_update_url_loader_request.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/download/resource_downloader.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/frame_host/render_frame_host_impl.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/loader/navigation_url_loader_network_service.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/loader/resource_message_filter.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/loader/resource_message_filter.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/service_worker/service_worker_fetch_dispatcher.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/service_worker/service_worker_script_url_loader.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/service_worker/service_worker_script_url_loader_factory.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/service_worker/service_worker_script_url_loader_unittest.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/service_worker/service_worker_url_loader_job_unittest.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/storage_partition_impl.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/storage_partition_impl.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/url_loader_factory_getter.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/browser/url_loader_factory_getter.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/public/browser/storage_partition.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/public/test/test_storage_partition.cc
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/public/test/test_storage_partition.h
[add] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/public/test/url_loader_interceptor.cc
[add] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/public/test/url_loader_interceptor.h
[modify] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/test/BUILD.gn
[add] https://crrev.com/a4bb87fb66e8ef6d20f3836d514017528909d5c9/content/test/url_loader_interceptor_test.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Nov 30 2017

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

commit f1db9abbadef0922a21fe5c36756a9249efe872f
Author: John Abd-El-Malek <jam@chromium.org>
Date: Thu Nov 30 17:49:04 2017

Add a unit test to ensure that if RESOURCE_TYPE_PREFETCH is specified in content::ResourceRequest, it's translated into the proper net:: flag on URLRequest.

The test is for the network service case. The old navigation code path has this covered already in RequestDataResourceDispatcherHostBrowserTest.LinkRelPrefetch.

The motivation is to convert a few prefetch browser tests from checking the URLLRequest object (which won't work with network service) to instead look at the ResourceRequest object.

Also de-duplicate BuildLoadFlagsForRequest.

BUG= 776589 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I29a66944d17a7e99b2bacbcb0766fa1b1174bd57
Reviewed-on: https://chromium-review.googlesource.com/797926
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520594}
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/browser/loader/resource_dispatcher_host_impl.cc
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/browser/loader/resource_dispatcher_host_impl.h
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/browser/loader/resource_loader_unittest.cc
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/common/loader_util.cc
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/common/loader_util.h
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/network/url_loader.cc
[modify] https://crrev.com/f1db9abbadef0922a21fe5c36756a9249efe872f/content/network/url_loader_unittest.cc

Project Member

Comment 25 by bugdroid1@chromium.org, Nov 30 2017

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

commit f3c2fcc4fc70f492c39bef2db07a4f501fbafd1a
Author: Yuzhu Shen <yzshen@chromium.org>
Date: Thu Nov 30 20:30:22 2017

Change PolicyTest.ExtensionInstallBlacklistSharedModules to use EmbeddedTestServer.

It currently uses URLRequestMockHTTPJob::GetMockUrl(), which is not compatible with network service.

BUG= 776589 

Change-Id: Ie6c46e1376c735b9885ce7d267001fbe2c3e6a09
Reviewed-on: https://chromium-review.googlesource.com/762184
Commit-Queue: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520665}
[modify] https://crrev.com/f3c2fcc4fc70f492c39bef2db07a4f501fbafd1a/chrome/browser/policy/policy_browsertest.cc
[delete] https://crrev.com/3f930c464d5a6e348ba4cd82f41f36539f3f7d9b/chrome/test/data/extensions/policy_shared_module/update.xml
[add] https://crrev.com/f3c2fcc4fc70f492c39bef2db07a4f501fbafd1a/chrome/test/data/extensions/policy_shared_module/update_template.xml

Project Member

Comment 26 by bugdroid1@chromium.org, Dec 4 2017

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

commit a1e25a3a5ce910f109f3251e602a81282457c3a2
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Dec 04 23:21:08 2017

Switch SitePerProcessBrowserTest tests to use the new URLLoaderInterceptor helper.

BUG= 776589 

Change-Id: I51507a0dee08bcaa6531dee4dcf9b03d264de103
Reviewed-on: https://chromium-review.googlesource.com/806928
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521498}
[modify] https://crrev.com/a1e25a3a5ce910f109f3251e602a81282457c3a2/content/browser/site_per_process_browsertest.cc

Project Member

Comment 27 by bugdroid1@chromium.org, Dec 5 2017

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

commit 50a638deb671706e853c0192635a1c28de3064a7
Author: Jun Cai <juncai@chromium.org>
Date: Tue Dec 05 18:23:11 2017

NetworkService: Fix NewTabPageInterceptorTest.NoInterception by using https test server

This CL fixes the NewTabPageInterceptorTest.NoInterception browser test
for network service by using https embedded test server instead of
URLRequestMockHTTPJob::GetMockHttpsUrl().

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I4d1f911ec4db21a2f086c09d3d6a99e41ad75230
Reviewed-on: https://chromium-review.googlesource.com/802079
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521751}
[modify] https://crrev.com/50a638deb671706e853c0192635a1c28de3064a7/chrome/browser/ui/search/new_tab_page_interceptor_browsertest.cc
[modify] https://crrev.com/50a638deb671706e853c0192635a1c28de3064a7/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 29 by bugdroid1@chromium.org, Dec 5 2017

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

commit 1ed4b967488aa3018ef61b7feb477bc9a944e773
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue Dec 05 20:50:11 2017

Remove support for calling URLLoaderFactoryGetter::SetNetworkFactoryForTesting on the UI thread.

This isn't needed anymore with URLLoaderInterceptor.

Bug:  776589 
Change-Id: Ic2a7dd35175e052be7874bc0105e2f758bca26a9
Reviewed-on: https://chromium-review.googlesource.com/809533
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521822}
[modify] https://crrev.com/1ed4b967488aa3018ef61b7feb477bc9a944e773/content/browser/url_loader_factory_getter.cc
[modify] https://crrev.com/1ed4b967488aa3018ef61b7feb477bc9a944e773/content/browser/url_loader_factory_getter.h

Project Member

Comment 30 by bugdroid1@chromium.org, Dec 6 2017

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

commit 1e94411f2696c93588b401d3cf368824636aa053
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed Dec 06 16:58:32 2017

Convert referrer tests to work with the network service.

This is done by switching from net::URLRequestMockHTTPJob to using
net::test_server::EmbeddedTestServer.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I8cf56477956ac64c70ba65221a1c248f39ff7944
Reviewed-on: https://chromium-review.googlesource.com/810205
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522110}
[modify] https://crrev.com/1e94411f2696c93588b401d3cf368824636aa053/chrome/browser/referrer_policy_browsertest.cc
[delete] https://crrev.com/c3db22be0cdd161ec137b081f34775bd8fd84c3e/chrome/test/data/referrer_policy/redirect-to-http-log
[delete] https://crrev.com/c3db22be0cdd161ec137b081f34775bd8fd84c3e/chrome/test/data/referrer_policy/redirect-to-http-log.mock-http-headers
[delete] https://crrev.com/c3db22be0cdd161ec137b081f34775bd8fd84c3e/chrome/test/data/referrer_policy/redirect-to-https-log
[delete] https://crrev.com/c3db22be0cdd161ec137b081f34775bd8fd84c3e/chrome/test/data/referrer_policy/redirect-to-https-log.mock-http-headers
[modify] https://crrev.com/1e94411f2696c93588b401d3cf368824636aa053/chrome/test/data/referrer_policy/referrer-policy-iframe.html
[modify] https://crrev.com/1e94411f2696c93588b401d3cf368824636aa053/chrome/test/data/referrer_policy/referrer-policy-start.html
[modify] https://crrev.com/1e94411f2696c93588b401d3cf368824636aa053/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 31 by bugdroid1@chromium.org, Dec 8 2017

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

commit 6ff290c0d48fce62513bc23bff1e79cba37e3a03
Author: Doug Turner <dougt@chromium.org>
Date: Fri Dec 08 02:00:24 2017

Move link doctor interceptor logic into ErrorPageTest.

This Cl is going to make it easier to port the ErrorPageTests from using
the URLRequestInterceptor to URLLoaderInterceptor.

BUG= 776589 

Change-Id: Ide56e8ccd218aba43338be497537c55064366457
Reviewed-on: https://chromium-review.googlesource.com/813018
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522676}
[modify] https://crrev.com/6ff290c0d48fce62513bc23bff1e79cba37e3a03/chrome/browser/net/errorpage_browsertest.cc

Project Member

Comment 32 by bugdroid1@chromium.org, Dec 12 2017

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

commit a796fa5605119535041802efe09b9e98099273d1
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue Dec 12 17:12:32 2017

Fix session restore with network service.

This involved:
-persisting cookies with network service
-converting the browser tests to work with the network service

Bug:  789644 ,  769401 ,  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I70320d5550e433049a910c64f055c1809aecbff1
Reviewed-on: https://chromium-review.googlesource.com/818486
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523462}
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/android_webview/browser/cookie_manager.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/net/profile_network_context_service.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/off_the_record_profile_io_data.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile_impl.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile_impl.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile_impl_io_data.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/profiles/profile_impl_io_data.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chrome/browser/sessions/better_session_restore_browsertest.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/chromecast/browser/url_request_context_factory.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/components/safe_browsing/browser/safe_browsing_url_request_context_getter.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/browser/net/quota_policy_cookie_store.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/browser/notification_service_impl.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/network/BUILD.gn
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/network/DEPS
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/network/network_context.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/public/browser/cookie_store_factory.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/public/browser/notification_service.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/public/common/network_service.mojom
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/public/test/url_loader_interceptor.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/public/test/url_loader_interceptor.h
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/content/utility/utility_main.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/headless/lib/browser/headless_url_request_context_getter.cc
[modify] https://crrev.com/a796fa5605119535041802efe09b9e98099273d1/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 33 by bugdroid1@chromium.org, Dec 18 2017

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

commit 63ff5f3abd0523a65916d92791296ac0808d5968
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Dec 18 22:14:58 2017

Make URLLoaderInterceptor work before profiles are created.

This also makes it intercept all profiles' frame requests, which is more consistent with how
it sniffs all profiles' subresources.

Bug:  776589 
Change-Id: I7b53f3f370b4d70e0335801a5b19f5b59be715a3
Reviewed-on: https://chromium-review.googlesource.com/831246
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524829}
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/chrome/browser/sessions/better_session_restore_browsertest.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/frame_host/render_frame_host_impl.h
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/loader/resource_message_filter.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/loader/resource_message_filter.h
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/notification_service_impl.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/url_loader_factory_getter.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/browser/url_loader_factory_getter.h
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/public/browser/notification_service.h
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/public/test/url_loader_interceptor.cc
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/public/test/url_loader_interceptor.h
[modify] https://crrev.com/63ff5f3abd0523a65916d92791296ac0808d5968/content/test/url_loader_interceptor_test.cc

Project Member

Comment 34 by bugdroid1@chromium.org, Dec 27 2017

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

commit ecc114a96b277381f8f3e3da71ea24a068dfb8b4
Author: Doug Turner <dougt@chromium.org>
Date: Wed Dec 27 21:31:40 2017

Refactors ErrorPageTest to be a base class.

While fixing up the NetErrorHelper to work with the network service, I needed to
add a URLLoaderInterceptor to the ErrorPageTest. This new interceptor conflicted
with subclasses of ErrorPageTest which also registers URLLoaderInterceptors.
There can only be one URLLoaderInterceptor. You can see this work here in 841532

To allow subclasses of ErrorPageTest to have their own URLLoaderInterceptor, I
refacted ErrorPageTest into two pieces:

1) The ErrorPageTest which is essentially a set of helper utility methods
2) A new test class called DNSErrorPageTest which handles most of the DNS, link
   doctor related tests.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Iba5cebd4307b7b4363ba333a9a9dc354fb4a4f9a
Reviewed-on: https://chromium-review.googlesource.com/843594
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526242}
[modify] https://crrev.com/ecc114a96b277381f8f3e3da71ea24a068dfb8b4/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/ecc114a96b277381f8f3e3da71ea24a068dfb8b4/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 35 by bugdroid1@chromium.org, Dec 29 2017

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

commit 881ea6b6f05340928a91c392c344b451b43b76a0
Author: Doug Turner <dougt@chromium.org>
Date: Fri Dec 29 02:06:17 2017

Convert ErrorPage browser tests to use embedded test server.

Bug:  776589 
Change-Id: I9daa0b7efca4d2e97cfa7d0d4aa2790cf1b69776
Reviewed-on: https://chromium-review.googlesource.com/845130
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526350}
[modify] https://crrev.com/881ea6b6f05340928a91c392c344b451b43b76a0/chrome/browser/net/errorpage_browsertest.cc

Project Member

Comment 36 by bugdroid1@chromium.org, Dec 29 2017

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

commit c92b03220ea5db6c7ad393661e6874284d403d85
Author: Doug Turner <dougt@chromium.org>
Date: Fri Dec 29 05:18:21 2017

Fixes NetErrorHelper / DNS Error handling to work with the Network Service

This CL does the following:

1) Makes use of the subresource loader that is available during a failed
   commit in the network error helper.  The failed commit is caused by the tests
   so that we can test behavior after an OnComplete() is called with an error.

2) Adds a URLLoaderInterceptor to the ErrorPageTest class which handles
   LinkDoctor, error code failure, and search queries.  This is set up before
   SetUp or SetUpOnMainThread as we want to capture url loads for the current
   renderer.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I329c59041fbf7695f5071c6cd16a441bc62271bc
Reviewed-on: https://chromium-review.googlesource.com/841532
Commit-Queue: Doug Turner <dougt@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526361}
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/chrome/renderer/net/net_error_helper.cc
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/content/public/renderer/render_frame.h
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/content/renderer/fetchers/resource_fetcher_browsertest.cc
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/content/renderer/render_frame_impl.h
[modify] https://crrev.com/c92b03220ea5db6c7ad393661e6874284d403d85/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 37 by bugdroid1@chromium.org, Jan 3 2018

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

commit b6221a0af8eb24a0c16024d4e142d39cfa2682ad
Author: Doug Turner <dougt@chromium.org>
Date: Wed Jan 03 16:39:36 2018

Allow DNSErrorPageTest to use embedded test server for urlCorrection resource.

The DNSErrorPageTest::DoClickLink tests clicks on a anchor pointing at
title2.html which was handled internally by net.  This CL converts loading and
testing this resource to use the embedded test server.

There are two parts to this CL.  The first is a handling the response to
mock-link-doctor.json requests need to be modified to return an embedded server
url.  This is so that urlCorrection returns something that can be loaded by the
embedded test server.  Note that the embedded server does not run on default
ports and that we can not use relative links.

The second part of the CL is plumbing to ensure that the Expect* functions know
what url to look for.

I also moved the starting the server to one place and factored out the test
that needed to do something special (SniffSmallHttpErrorResponseAsDownload).

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I7af69dec8bc376aa2fe45a9f0c06cb6299f55440
Reviewed-on: https://chromium-review.googlesource.com/848415
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526716}
[modify] https://crrev.com/b6221a0af8eb24a0c16024d4e142d39cfa2682ad/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/b6221a0af8eb24a0c16024d4e142d39cfa2682ad/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 38 by bugdroid1@chromium.org, Jan 3 2018

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

commit 79bec1a823ded63c8ab593df318bf5b36ad1d1bf
Author: Doug Turner <dougt@chromium.org>
Date: Wed Jan 03 23:05:59 2018

Move mock.failed.request handling to the URLLoaderInterceptor::Interceptor

http://mock.failed.request is a special testing url load which allows us to
simulate error codes. The implementation is suppose to return the error code
referenced in the query part of the request to OnComplete().

This CL moves this handling from one of the ErrorPageTests to the
URLLoaderInterceptor::Interceptor class so that it can be shared.

Bug:  776589 
Change-Id: Id6da78e4a3e62b9165d2fe30876b7bbafcf0e8b0
Reviewed-on: https://chromium-review.googlesource.com/847916
Commit-Queue: Doug Turner <dougt@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526852}
[modify] https://crrev.com/79bec1a823ded63c8ab593df318bf5b36ad1d1bf/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/79bec1a823ded63c8ab593df318bf5b36ad1d1bf/content/public/test/url_loader_interceptor.cc
[modify] https://crrev.com/79bec1a823ded63c8ab593df318bf5b36ad1d1bf/content/public/test/url_loader_interceptor.h

Project Member

Comment 39 by bugdroid1@chromium.org, Jan 4 2018

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

commit 8e97e7b2d4b74e6d121fb51dd9356a40d45b95e1
Author: Doug Turner <dougt@chromium.org>
Date: Thu Jan 04 00:23:33 2018

Install URLLoaderInterceptor on ErrorPageOfflineTest

ErrorPageOfflineTestWithAllowDinosaurFalse.CheckEasterEggIsDisabled requires
http://mock.request.failed to be handled. This CL installs a default interceptor
which handles this request.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ic5b2dca7b3d46b20368094c677ea85456a39b016
Reviewed-on: https://chromium-review.googlesource.com/847917
Commit-Queue: Doug Turner <dougt@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526868}
[modify] https://crrev.com/8e97e7b2d4b74e6d121fb51dd9356a40d45b95e1/chrome/browser/net/errorpage_browsertest.cc
[modify] https://crrev.com/8e97e7b2d4b74e6d121fb51dd9356a40d45b95e1/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Comment 40 by jam@chromium.org, Jan 18 2018

Blockedon: 803434
Project Member

Comment 41 by bugdroid1@chromium.org, Jan 18 2018

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

commit fb2cfb2bf6da7568026ba547103b43b3534addff
Author: Colin Blundell <blundell@chromium.org>
Date: Thu Jan 18 18:50:09 2018

Get BrowserCloseManager browsertests to work with Network Service

The issue is that the tests were using URLRequestSlowDownloadJob,
which doesn't work with the Network Service because it uses
URLRequestInterceptor under the hood. This CL follows the pattern of
https://chromium-review.googlesource.com/c/chromium/src/+/745728 in
switching the tests to use SlowDownloadHttpResponse.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I538c12899dfa5f17b523bd46c83adf16e44c0218
Reviewed-on: https://chromium-review.googlesource.com/873375
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Xing Liu <xingliu@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530214}
[modify] https://crrev.com/fb2cfb2bf6da7568026ba547103b43b3534addff/chrome/browser/lifetime/browser_close_manager_browsertest.cc
[modify] https://crrev.com/fb2cfb2bf6da7568026ba547103b43b3534addff/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Owner: ----
Status: Available (was: Started)
Project Member

Comment 43 by bugdroid1@chromium.org, Mar 9 2018

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

commit 1ff872df37f553db433107877eb099170e395266
Author: Jay Civelli <jcivelli@google.com>
Date: Fri Mar 09 21:52:16 2018

Change ClientHintsBrowserTest browser tests to use URLLoaderInterceptor

Changing the ClientHintsBrowserTest browser tests to use
URLLoaderInterceptor. This fixes 2 tests with the network service.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Icfa0f2c26723de4a1c0f815411ab39e1b016d61d
Reviewed-on: https://chromium-review.googlesource.com/956753
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542238}
[modify] https://crrev.com/1ff872df37f553db433107877eb099170e395266/chrome/browser/client_hints/client_hints_browsertest.cc
[modify] https://crrev.com/1ff872df37f553db433107877eb099170e395266/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 44 by bugdroid1@chromium.org, Mar 15 2018

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

commit 492b6c2f2246b48ef615cc7427b664ab27a727e6
Author: Jay Civelli <jcivelli@google.com>
Date: Thu Mar 15 00:23:37 2018

Fix SecurityIndicatorTest.CheckIndicatorText with the network service

This CL fixes the SecurityIndicatorTest.CheckIndicatorText with the
network service by using a URLLoaderInterceptor.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I25cecf5301b2b963a8c64cb515c45d6cdd74cf31
Reviewed-on: https://chromium-review.googlesource.com/961449
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543252}
[modify] https://crrev.com/492b6c2f2246b48ef615cc7427b664ab27a727e6/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
[modify] https://crrev.com/492b6c2f2246b48ef615cc7427b664ab27a727e6/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Project Member

Comment 45 by bugdroid1@chromium.org, May 1 2018

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

commit db3a13b32f24a916ff5dc1effd6180bfe2df8df7
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue May 01 17:52:02 2018

Allow URLLoaderInterceptor to support intercepting frame requests when network service is disabled.

This is now possible since NavigationMojoResponse is on when network service is disabled. Now tests don't need multiple paths when they need to intercept or monitor a frame request, depending on whether the network service is enabled or not. In this patch, I've simplified one test as an example. I'll do the rest in followups to keep this patch smaller.

Bug:  776589 
Change-Id: I7d1419b152072810e789560a598e14d87fb2ce19
Reviewed-on: https://chromium-review.googlesource.com/1036593
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555106}
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/browser/loader/loader_browsertest.cc
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/browser/loader/navigation_url_loader_network_service.cc
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/browser/loader/navigation_url_loader_network_service.h
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/public/test/url_loader_interceptor.cc
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/public/test/url_loader_interceptor.h
[modify] https://crrev.com/db3a13b32f24a916ff5dc1effd6180bfe2df8df7/content/test/url_loader_interceptor_test.cc

Project Member

Comment 46 by bugdroid1@chromium.org, May 1 2018

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

commit 7399972426e8841f99c890fc8736ddbea3ed6229
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue May 01 19:48:25 2018

Convert SecurityIndicatorTest.CheckIndicatorText to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

This change also:
-removes the DCHECK in PageLoadTracker::WillProcessNavigationResponse since intercepted requests won't have a request ID (since they didn't go through ResourceDispatcherHost)
-makes NavigationURLLoaderNetworkService::URLLoaderRequestController::OnReceiveResponse handle receiving a response when there's no net::URLRequest, for the same reason as above

Bug:  776589 
Change-Id: If68216f77ab08659bb65c6c37efca6ed9396a47a
Reviewed-on: https://chromium-review.googlesource.com/1037769
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555151}
[modify] https://crrev.com/7399972426e8841f99c890fc8736ddbea3ed6229/chrome/browser/page_load_metrics/page_load_tracker.cc
[modify] https://crrev.com/7399972426e8841f99c890fc8736ddbea3ed6229/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
[modify] https://crrev.com/7399972426e8841f99c890fc8736ddbea3ed6229/content/browser/loader/navigation_url_loader_network_service.cc

Project Member

Comment 47 by bugdroid1@chromium.org, May 1 2018

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

commit dbc9021e6580c8ffc29d5b4a661f2e2874d3fa91
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue May 01 22:41:58 2018

Convert ClientHintsBrowserTest to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Bug:  776589 
Change-Id: Icb2ebee8b2b4065be5a4188480350e5ce89eec41
Reviewed-on: https://chromium-review.googlesource.com/1038567
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555204}
[modify] https://crrev.com/dbc9021e6580c8ffc29d5b4a661f2e2874d3fa91/chrome/browser/client_hints/client_hints_browsertest.cc

Project Member

Comment 48 by bugdroid1@chromium.org, May 2 2018

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

commit 24f53eceafb01468402e9c20c71f085c241305a5
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed May 02 00:25:15 2018

Convert session restore tests to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Bug:  776589 
Change-Id: I6775dea367cb4e87b1ce5f61cb62590a517d217c
Reviewed-on: https://chromium-review.googlesource.com/1038564
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555247}
[modify] https://crrev.com/24f53eceafb01468402e9c20c71f085c241305a5/chrome/browser/sessions/better_session_restore_browsertest.cc

Project Member

Comment 49 by bugdroid1@chromium.org, May 2 2018

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

commit b19e3e5ed9059f0f162a3e6f6898cc61a86daaae
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed May 02 15:46:25 2018

Convert error page tests to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Bug:  776589 
Change-Id: Ieae2c903860e5263aa73fc3f3521de9f53b0eb4d
Reviewed-on: https://chromium-review.googlesource.com/1038621
Reviewed-by: Doug Turner <dougt@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555401}
[modify] https://crrev.com/b19e3e5ed9059f0f162a3e6f6898cc61a86daaae/chrome/browser/net/errorpage_browsertest.cc

Project Member

Comment 50 by bugdroid1@chromium.org, May 2 2018

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

commit fa0a35a8738e737330858de9a5bba998aaee7d40
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed May 02 15:50:05 2018

Convert prerender tests to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Bug:  776589 
Change-Id: Iec439f88db2e2daddec350251dc19309a1c2bd5c
Reviewed-on: https://chromium-review.googlesource.com/1038651
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555405}
[modify] https://crrev.com/fa0a35a8738e737330858de9a5bba998aaee7d40/chrome/browser/prerender/prerender_browsertest.cc
[modify] https://crrev.com/fa0a35a8738e737330858de9a5bba998aaee7d40/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
[modify] https://crrev.com/fa0a35a8738e737330858de9a5bba998aaee7d40/chrome/browser/prerender/prerender_test_utils.cc
[modify] https://crrev.com/fa0a35a8738e737330858de9a5bba998aaee7d40/chrome/browser/prerender/prerender_test_utils.h

Project Member

Comment 51 by bugdroid1@chromium.org, May 2 2018

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

commit 64aa466cfd1965e4e51f710a3ee175ad211c8001
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed May 02 20:59:31 2018

Convert SitePerProcessBrowserTest.ProcessTransferAfterError to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Also remove the exception in BrowserTestBase::InitializeNetworkProcess which isn't needed anymore.

Bug:  776589 
Change-Id: I87d5efedba8f967dc6b5c890cede22d53e60c90c
Reviewed-on: https://chromium-review.googlesource.com/1037626
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555510}
[modify] https://crrev.com/64aa466cfd1965e4e51f710a3ee175ad211c8001/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/64aa466cfd1965e4e51f710a3ee175ad211c8001/content/public/test/browser_test_base.cc

Project Member

Comment 52 by bugdroid1@chromium.org, May 2 2018

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

commit 7ce4bde8653b60682450006329116e1d91173b98
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed May 02 22:11:12 2018

Convert CaptivePortalTests to always use URLLoaderInterceptor.

The test class now works with frame requests when the network service is disabled.

Bug:  776589 
Change-Id: Ic543037e05ba164ab6c50f3af27f841200c92626
Reviewed-on: https://chromium-review.googlesource.com/1038424
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555573}
[modify] https://crrev.com/7ce4bde8653b60682450006329116e1d91173b98/chrome/browser/captive_portal/captive_portal_browsertest.cc

Project Member

Comment 53 by bugdroid1@chromium.org, May 3 2018

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

commit 715ebfa01e340f3b68616e5c8d99c2d9a704ed3e
Author: John Abd-El-Malek <jam@chromium.org>
Date: Thu May 03 03:38:02 2018

Fix LoadImageBrowserTest.LoadImage with network service.

AKA LoadImageBrowserTest.LoadImageW on Windows.

Also remove 2 tests from the filter file that don't exist.

Bug:  776589 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ic4e0171723a52ff1cbf403af5df1510a26c868e6
Reviewed-on: https://chromium-review.googlesource.com/1040741
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555663}
[modify] https://crrev.com/715ebfa01e340f3b68616e5c8d99c2d9a704ed3e/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
[modify] https://crrev.com/715ebfa01e340f3b68616e5c8d99c2d9a704ed3e/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Comment 54 by dxie@chromium.org, May 17 2018

Labels: -Pri-3 Proj-Servicification-Canary OS-All Pri-1

Comment 55 by dxie@chromium.org, May 18 2018

Labels: -OS-All OS-Windows OS-Linux OS-Mac OS-Chrome OS-Android
Project Member

Comment 56 by bugdroid1@chromium.org, May 26 2018

Comment 57 by jam@chromium.org, Jun 7 2018

Owner: jam@chromium.org
Status: Fixed (was: Available)
URLLoaderInteceptor is available and many tests use it now.
Project Member

Comment 58 by bugdroid1@chromium.org, Aug 8

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

commit 9db74cc6b993f882d2e3ddf43370fbaed7d0e478
Author: John Abd-El-Malek <jam@chromium.org>
Date: Wed Aug 08 19:25:21 2018

Fix user gesture flag not being set on user-initiated downloads with network service enabled.

Bug:  776589 ,  715630 
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I5a9bb9c857e3ec68df8c8ef1133cb418071f1e41
Reviewed-on: https://chromium-review.googlesource.com/1167553
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581659}
[modify] https://crrev.com/9db74cc6b993f882d2e3ddf43370fbaed7d0e478/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/9db74cc6b993f882d2e3ddf43370fbaed7d0e478/components/download/internal/common/resource_downloader.cc
[modify] https://crrev.com/9db74cc6b993f882d2e3ddf43370fbaed7d0e478/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/9db74cc6b993f882d2e3ddf43370fbaed7d0e478/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Sign in to add a comment