New issue
Advanced search Search tips

Issue 602396 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Speculative preconnect / preresolve needs to be better tested

Project Member Reported by csharrison@chromium.org, Apr 11 2016

Issue description

The predictor in chrome/browser/net has very few tests. In particular, it's browser tests don't test predictive action at all (only link rel preconnect).

We should add more browsertests (and possibly more unittests) to the class before we muck around with its internals for refactoring or optimizations.


 
More test ideas:
- e2e test with sockets ending in privacy mode pools.

From mmenke@:
-Navigate to the same test URL 3 times, to make sure we
update existing preconnect information correctly.

-Do a test with two different cross-origin servers

Comment 2 by mmenke@chromium.org, May 12 2016

With navigating 3 times, would be great to have two tests:

Same number of requests both time, and one where we see fewer connections (no connects?) the second time.
Project Member

Comment 3 by bugdroid1@chromium.org, May 13 2016

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

commit a7b1611d80ee455b77a8144a4afcb2248b854a55
Author: csharrison <csharrison@chromium.org>
Date: Fri May 13 23:25:39 2016

Add a browsertest suite for net predictor

This patch adds end to end tests for the predictor. These tests span multiple
navigations, asserting that host relationships are learned, and that
subsequent navigations will preconnect accurately.

BUG=602396

Review-Url: https://codereview.chromium.org/1881463003
Cr-Commit-Position: refs/heads/master@{#393682}

[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/browser/net/predictor.cc
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/browser/net/predictor.h
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/browser/net/predictor_browsertest.cc
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty.js
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty.js.mock-http-headers
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty1.js
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty1.js.mock-http-headers
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty2.js
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/empty2.js.mock-http-headers
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/fetch_cross_site.js
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/predictor_cross_site.html
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/predictor_cross_site_no_referrer.html
[add] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/chrome/test/data/predictor/predictor_cross_site_subframe_nav.html
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/net/test/embedded_test_server/embedded_test_server.cc
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/net/test/embedded_test_server/embedded_test_server.h
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/net/test/embedded_test_server/embedded_test_server_connection_listener.h
[modify] https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55/net/test/embedded_test_server/embedded_test_server_unittest.cc

Cc: csharrison@chromium.org
Owner: ----
Status: Available (was: Started)

Comment 5 by mmenke@chromium.org, May 30 2018

Status: WontFix (was: Available)
The predictor is going away, so no need to test it better, methinks.
Labels: -Pri-2 Pri-3
Owner: alexilin@chromium.org
Status: Assigned (was: WontFix)
Summary: Speculative preconnect / preresolve needs to be better tested (was: The net predictor needs to be better tested)
Can we keep it open and rename it? I think a lot of this bug applies to the chrome/browser/predictors which looks like it has no browser tests.

My advice: Spin off "preconnect/preresolve" test utils into their own separate files (maybe in //net/test?) These can be used to do the embedded test server socket introspection that predictor tests do. This will simplify the existing predictor browser tests.

This way, it is simpler for consumers like chrome/browser/predictors to write end to end test. 

Once we have great test utilities, we can start moving tests from the predictor to chrome/browser/predictors as necessary.

Comment 7 by mmenke@chromium.org, May 30 2018

Is there a label for the new predictor?
I don't think so, I think for now it's still under Internals>Network.

I think it makes sense for networking team to own preconnect internals, but we should have a new component for the predictor since most of the lower-level preconnect/preresolve code is not under net.
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 31

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

commit 3aabac86dd6fbc15d3768b3ae7b06aea4f310b16
Author: Alexandr Ilin <alexilin@chromium.org>
Date: Fri Aug 31 19:45:55 2018

predictors: Add browsertests for the LoadingPredictor

This CL adds end to end tests for the LoadingPredictor. There are two
categories of tests:
* Web platform link rel features tests.
* Learning from past navigations tests.

Bug: 602396
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: Ic51c77f7289ec08b99341ef1d51a6fa01c64309b
Reviewed-on: https://chromium-review.googlesource.com/1185191
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588127}
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/net/network_request_metrics_browsertest.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/net/predictor_browsertest.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/loading_data_collector.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/loading_predictor.h
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/loading_predictor_browsertest.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/preconnect_manager.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/preconnect_manager.h
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/predictors/resource_prefetch_predictor.h
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/browser/ui/extensions/hosted_app_browsertest.cc
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/BUILD.gn
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/base/in_process_browser_test.cc
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/font.ttf
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/font.ttf.mock-http-headers
[modify] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/html_subresources.html
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/html_subresources.html.mock-http-headers
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/image.png
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/image.png.mock-http-headers
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/script.js
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/script.js.mock-http-headers
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/style.css
[add] https://crrev.com/3aabac86dd6fbc15d3768b3ae7b06aea4f310b16/chrome/test/data/predictors/style.css.mock-http-headers

Sign in to add a comment