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

Issue 1881463003: Add a browsertest suite for net predictor (Closed)

Created:
4 years, 8 months ago by Charlie Harrison
Modified:
4 years, 7 months ago
Reviewers:
mmenke
CC:
cbentzel+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55 Cr-Commit-Position: refs/heads/master@{#393682}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Test overhaul #

Patch Set 4 : Add a "forgetting" test + fix typo #

Total comments: 53

Patch Set 5 : mmenke@ review #

Total comments: 35

Patch Set 6 : Add synchronization RunLoops (hope to fix Win7 errors) #

Patch Set 7 : Fix really silly hang add dead simple preconnect tests #

Patch Set 8 : Add locks around {set_}preconnect_enabled() #

Patch Set 9 : Refactor, disable preconnect + intercept request for determinism #

Total comments: 54

Patch Set 10 : Responded to minor comments #

Patch Set 11 : Kill sockets on both ends #

Total comments: 77

Patch Set 12 : Responded to mmenke@, simplified things (always block requests, etc) #

Total comments: 16

Patch Set 13 : mmenke@ review #

Patch Set 14 : EXPECT that we get the right number of accepted connections after waiting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+928 lines, -37 lines) Patch
M chrome/browser/net/predictor.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +20 lines, -8 lines 0 comments Download
M chrome/browser/net/predictor.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +17 lines, -5 lines 0 comments Download
M chrome/browser/net/predictor_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +794 lines, -25 lines 0 comments Download
A + chrome/test/data/predictor/empty.js View 1 2 3 4 5 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/predictor/empty.js.mock-http-headers View 1 2 1 chunk +1 line, -1 line 0 comments Download
A + chrome/test/data/predictor/empty1.js View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/predictor/empty1.js.mock-http-headers View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/predictor/empty2.js View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/predictor/empty2.js.mock-http-headers View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/predictor/fetch_cross_site.js View 1 2 3 4 5 6 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/test/data/predictor/predictor_cross_site.html View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/predictor/predictor_cross_site_no_referrer.html View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/test/data/predictor/predictor_cross_site_subframe_nav.html View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M net/test/embedded_test_server/embedded_test_server.h View 1 2 3 4 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M net/test/embedded_test_server/embedded_test_server.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -1 line 0 comments Download
M net/test/embedded_test_server/embedded_test_server_connection_listener.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/test/embedded_test_server/embedded_test_server_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 44 (7 generated)
Charlie Harrison
Hey Matt, here's the initial batch of browser tests for the predictor. Some notes: - ...
4 years, 8 months ago (2016-04-13 17:16:11 UTC) #4
mmenke
Probably won't get back to you until tomorrow. https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc#newcode319 chrome/browser/net/predictor_browsertest.cc:319: target_test_server()->GetURL("/favicon.ico"))); ...
4 years, 8 months ago (2016-04-13 17:50:24 UTC) #5
Charlie Harrison
https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc#newcode319 chrome/browser/net/predictor_browsertest.cc:319: target_test_server()->GetURL("/favicon.ico"))); On 2016/04/13 at 17:50:23, mmenke wrote: > Do ...
4 years, 8 months ago (2016-04-13 18:16:00 UTC) #6
Charlie Harrison
I talked with Steven about this and we came to a few tentative solutions to ...
4 years, 8 months ago (2016-04-13 23:50:10 UTC) #7
mmenke
Some comments on your test fixture - still want to dig through all the test ...
4 years, 8 months ago (2016-04-15 15:44:03 UTC) #8
mmenke
https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor_browsertest.cc#newcode388 chrome/browser/net/predictor_browsertest.cc:388: int num_non_cors, Oh...The fact that non_cors does not mean ...
4 years, 8 months ago (2016-04-15 20:27:17 UTC) #9
Charlie Harrison
I tried to address all comments (except the set_preconnect_enabled_for_test). Otherwise this is ready for another ...
4 years, 8 months ago (2016-04-20 12:36:43 UTC) #10
Charlie Harrison
Apologies this patch is getting pretty huge.
4 years, 8 months ago (2016-04-20 12:37:03 UTC) #11
Charlie Harrison
I added a WaitForConnectionsAccepted(size_t num_sockets) method to the connection listener in the hope that it ...
4 years, 8 months ago (2016-04-22 16:21:02 UTC) #12
mmenke
Some more comments on the test fixture. https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor.h File chrome/browser/net/predictor.h (right): https://codereview.chromium.org/1881463003/diff/60001/chrome/browser/net/predictor.h#newcode315 chrome/browser/net/predictor.h:315: } On ...
4 years, 8 months ago (2016-04-22 16:29:26 UTC) #13
Charlie Harrison
Matt, can you take another look? https://codereview.chromium.org/1881463003/diff/80001/chrome/browser/net/predictor.h File chrome/browser/net/predictor.h (right): https://codereview.chromium.org/1881463003/diff/80001/chrome/browser/net/predictor.h#newcode80 chrome/browser/net/predictor.h:80: const GURL& target_url) ...
4 years, 7 months ago (2016-04-28 16:29:52 UTC) #14
Charlie Harrison
Actually, looks like the win failures are still occurring. I must have mistaken the "trigger ...
4 years, 7 months ago (2016-04-28 19:08:42 UTC) #15
mmenke
On 2016/04/28 19:08:42, csharrison wrote: > Actually, looks like the win failures are still occurring. ...
4 years, 7 months ago (2016-04-29 15:19:14 UTC) #16
Charlie Harrison
Look at those nice green bots :) So, I mentioned briefly what I've done to ...
4 years, 7 months ago (2016-05-02 19:11:23 UTC) #17
mmenke
Despite my slowness (And my many comments). I'm pretty happy with this in its current ...
4 years, 7 months ago (2016-05-06 19:54:02 UTC) #18
mmenke
On 2016/05/06 19:54:02, mmenke wrote: > Despite my slowness (And my many comments). I'm pretty ...
4 years, 7 months ago (2016-05-06 19:55:39 UTC) #19
Charlie Harrison
The current patchset keeps the predictor disabling behavior. I'm nervous enabling preconnect, waiting until the ...
4 years, 7 months ago (2016-05-09 19:47:05 UTC) #20
mmenke
On 2016/05/09 19:47:05, csharrison wrote: > The current patchset keeps the predictor disabling behavior. > ...
4 years, 7 months ago (2016-05-11 16:37:10 UTC) #21
mmenke
On 2016/05/11 16:37:10, mmenke wrote: > On 2016/05/09 19:47:05, csharrison wrote: > > The current ...
4 years, 7 months ago (2016-05-11 16:37:48 UTC) #22
mmenke
On 2016/05/11 16:37:48, mmenke wrote: > On 2016/05/11 16:37:10, mmenke wrote: > > On 2016/05/09 ...
4 years, 7 months ago (2016-05-11 16:38:14 UTC) #23
Charlie Harrison
Punted on the tests, but I've fixed the tests to work on Windows again by ...
4 years, 7 months ago (2016-05-12 14:09:21 UTC) #24
mmenke
Didn't quite make it through all the tests https://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/predictor.h File chrome/browser/net/predictor.h (right): https://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/predictor.h#newcode305 chrome/browser/net/predictor.h:305: bool ...
4 years, 7 months ago (2016-05-12 16:30:25 UTC) #25
Charlie Harrison
Responded to initial comments. Thanks for such a detailed review :) https://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/predictor.h File chrome/browser/net/predictor.h (right): ...
4 years, 7 months ago (2016-05-12 20:17:08 UTC) #26
mmenke
ttps://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/pre... File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/pre... chrome/browser/net/predictor_browsertest.cc:793: IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, SubframeInitiatesPreconnects) { On 2016/05/12 20:17:05, csharrison wrote: > ...
4 years, 7 months ago (2016-05-12 20:33:39 UTC) #27
Charlie Harrison
On 2016/05/12 20:33:39, mmenke wrote: > ttps://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/pre... > File chrome/browser/net/predictor_browsertest.cc (right): > > https://codereview.chromium.org/1881463003/diff/200001/chrome/browser/net/pre... > ...
4 years, 7 months ago (2016-05-12 20:42:40 UTC) #28
mmenke
LGTM https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc#newcode8 chrome/browser/net/predictor_browsertest.cc:8: #include <memory> nit: blank line between C and ...
4 years, 7 months ago (2016-05-13 20:57:46 UTC) #29
Charlie Harrison
Thanks! Let me know specifically regarding the WaitForAcceptedConnectionsOnUI change. https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc#newcode8 chrome/browser/net/predictor_browsertest.cc:8: ...
4 years, 7 months ago (2016-05-13 21:27:54 UTC) #30
mmenke
https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc#newcode669 chrome/browser/net/predictor_browsertest.cc:669: connection_listener_->WaitForAcceptedConnectionsOnUI(1u); On 2016/05/13 21:27:53, csharrison wrote: > On 2016/05/13 ...
4 years, 7 months ago (2016-05-13 21:30:40 UTC) #31
mmenke
On 2016/05/13 21:30:40, mmenke wrote: > https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc > File chrome/browser/net/predictor_browsertest.cc (right): > > https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc#newcode669 > ...
4 years, 7 months ago (2016-05-13 21:33:05 UTC) #32
Charlie Harrison
Thanks for the clarification https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc File chrome/browser/net/predictor_browsertest.cc (right): https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc#newcode669 chrome/browser/net/predictor_browsertest.cc:669: connection_listener_->WaitForAcceptedConnectionsOnUI(1u); On 2016/05/13 at 21:30:40, ...
4 years, 7 months ago (2016-05-13 21:40:39 UTC) #33
mmenke
On 2016/05/13 21:40:39, csharrison wrote: > Thanks for the clarification > > https://codereview.chromium.org/1881463003/diff/220001/chrome/browser/net/predictor_browsertest.cc > File ...
4 years, 7 months ago (2016-05-13 21:42:12 UTC) #34
Charlie Harrison
On 2016/05/13 at 21:42:12, mmenke wrote: > On 2016/05/13 21:40:39, csharrison wrote: > > Thanks ...
4 years, 7 months ago (2016-05-13 21:43:30 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1881463003/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1881463003/260001
4 years, 7 months ago (2016-05-13 21:44:28 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/5476)
4 years, 7 months ago (2016-05-13 22:15:33 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1881463003/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1881463003/260001
4 years, 7 months ago (2016-05-13 22:42:28 UTC) #41
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 7 months ago (2016-05-13 23:25:52 UTC) #42
commit-bot: I haz the power
4 years, 7 months ago (2016-05-13 23:26:39 UTC) #44
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/a7b1611d80ee455b77a8144a4afcb2248b854a55
Cr-Commit-Position: refs/heads/master@{#393682}

Powered by Google App Engine
This is Rietveld 408576698