// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "services/network/proxy_config_service_mojo.h" #include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "net/proxy_resolution/proxy_config.h" #include "net/proxy_resolution/proxy_config_service.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "services/network/public/mojom/proxy_config.mojom.h" #include "testing/gtest/include/gtest/gtest.h" namespace network { namespace { // Test class for observing proxy config changes. class TestProxyConfigServiceObserver : public net::ProxyConfigService::Observer { … }; // Test fixture for notifying ProxyConfigServiceMojo of changes through the // client interface, and watching the subsequent values it emits to registered // net::ProxyConfigService::Observers. class ProxyConfigServiceMojoTest : public testing::Test { … }; // Most tests of this class are in network_context_unittests. // Makes sure that a ProxyConfigService::Observer is correctly notified of // changes when the ProxyConfig changes, and is not informed of them in the case // of "changes" that result in the same ProxyConfig as before. TEST_F(ProxyConfigServiceMojoTest, ObserveProxyChanges) { … } // Creates a URL that has length |url::kMaxURLChars + 1|. GURL CreateLargeURL() { … } // Tests what happens when ProxyConfigServiceMojo is updated to using a // ProxyConfig with a large URL. GURL does not impose size limits, however some // internals like url.mojom.Url do. TEST_F(ProxyConfigServiceMojoTest, LargePacUrlNotTruncated) { … } } // namespace } // namespace network