Commit 34b5e4d8 authored by jam's avatar jam Committed by Commit bot

Fix host resolver being initialized after network requests arrive to the network service.

This regressed in r472101 wich made the network service pointer get initialized in non-test code earlier.

BUG=720374

Review-Url: https://codereview.chromium.org/2895353002
Cr-Commit-Position: refs/heads/master@{#473774}
parent e17728ae
......@@ -13,5 +13,6 @@ struct Rule {
interface NetworkServiceTest {
// Adds the given host resolver rules in the process where the network
// service is running.
AddRules(array<Rule> rules);
[Sync]
AddRules(array<Rule> rules) => ();
};
......@@ -90,11 +90,13 @@ class NetworkServiceTestImpl : public mojom::NetworkServiceTest {
~NetworkServiceTestImpl() override = default;
// mojom::NetworkServiceTest implementation.
void AddRules(std::vector<mojom::RulePtr> rules) override {
void AddRules(std::vector<mojom::RulePtr> rules,
AddRulesCallback callback) override {
for (const auto& rule : rules) {
test_host_resolver_.host_resolver()->AddRule(rule->host_pattern,
rule->replacement);
}
std::move(callback).Run();
}
private:
......
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