Commit e378a8f4 authored by Alexandr Ilin's avatar Alexandr Ilin Committed by Commit Bot

Enable SpeculativePreconnect Field Trial Testing

The predictors::kSpeculativePreconnectFeature is explicitly disabled in
net::Predictor browser tests because the LoadingPredictor if enabled
intercepts all prefetch and preconnect coming from a renderer.

WarmupManagerTest.testPreconnect() was expecting two connections to be
opened but it's not the case for the LoadingPredictor, it opens only
one connection.

Bug: 699080
Change-Id: I73537c3a59818793e41c5741762fe675a4efa97f
Reviewed-on: https://chromium-review.googlesource.com/754837Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515502}
parent 7953fb16
......@@ -202,9 +202,9 @@ public class WarmupManagerTest {
public void testPreconnect() throws Exception {
EmbeddedTestServer server = new EmbeddedTestServer();
try {
// The predictor prepares 2 connections when asked to preconnect. Initializes the
// semaphore to be unlocked after 2 connections.
final Semaphore connectionsSemaphore = new Semaphore(1 - 2);
// The predictor prepares 1 connection when asked to preconnect. Initializes the
// semaphore to be unlocked after 1 connection.
final Semaphore connectionsSemaphore = new Semaphore(0);
// Cannot use EmbeddedTestServer#createAndStartServer(), as we need to add the
// connection listener.
......@@ -224,7 +224,7 @@ public class WarmupManagerTest {
if (!connectionsSemaphore.tryAcquire(5, TimeUnit.SECONDS)) {
// Starts at -1.
int actualConnections = connectionsSemaphore.availablePermits() + 1;
Assert.fail("Expected 2 connections, got " + actualConnections);
Assert.fail("Expected 1 connection, got " + actualConnections);
}
} finally {
server.stopAndDestroyServer();
......
......@@ -30,6 +30,7 @@
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/predictors/loading_predictor_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
......@@ -514,7 +515,9 @@ class PredictorBrowserTest : public InProcessBrowserTest {
Predictor::kMaxSpeculativeResolveQueueDelayMs + 300);
rule_based_resolver_proc_->AddRuleWithLatency("delay.google.com",
"127.0.0.1", 1000 * 60);
scoped_feature_list_.InitAndEnableFeature(features::kPreconnectMore);
scoped_feature_list_.InitWithFeatures(
{features::kPreconnectMore},
{predictors::kSpeculativePreconnectFeature});
}
~PredictorBrowserTest() override {}
......
......@@ -3427,6 +3427,27 @@
]
}
],
"SpeculativePreconnectValidation": [
{
"platforms": [
"win",
"mac",
"linux",
"android"
],
"experiments": [
{
"name": "Preconnect2",
"params": {
"mode": "preconnect"
},
"enable_features": [
"SpeculativePreconnect"
]
}
]
}
],
"StabilityDebugging": [
{
"platforms": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment