Chromium Code Reviews| Index: chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc |
| diff --git a/chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc b/chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c475a327642e41609e345f067c9c2ad4658e484c |
| --- /dev/null |
| +++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" |
| +#include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" |
| +#include "chrome/browser/net/nqe/ui_network_quality_estimator_service_test_util.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/test/base/in_process_browser_test.h" |
| +#include "content/public/test/browser_test.h" |
| +#include "net/nqe/network_quality_estimator.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +class Profile; |
| + |
| +class UINetworkQualityEstimatorServiceBrowserTest |
|
mmenke
2016/07/20 17:11:33
I'd suggest putting all this in an anonymous names
RyanSturm
2016/07/20 17:37:38
Done.
|
| + : public InProcessBrowserTest { |
| + public: |
| + UINetworkQualityEstimatorServiceBrowserTest() {} |
| +}; |
|
mmenke
2016/07/20 17:11:33
could just replace this with "using UINetworkQuali
RyanSturm
2016/07/20 17:37:38
Done.
|
| + |
| +IN_PROC_BROWSER_TEST_F(UINetworkQualityEstimatorServiceBrowserTest, |
| + VerifyNQEState) { |
| + // Verifies that NQE notifying EffectiveConnectionTypeObservers causes the |
| + // UINetworkQualityEstimatorService to receive an updated |
| + // EffectiveConnectionType. |
| + Profile* profile = ProfileManager::GetActiveUserProfile(); |
| + chrome_browser_net::UINetworkQualityEstimatorService* nqe_service = |
| + chrome_browser_net::UINetworkQualityEstimatorServiceFactory:: |
| + GetForProfile(profile); |
| + |
| + chrome_browser_net::test_util::OverrideEffectiveConnectionTypeAndWait( |
| + net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_OFFLINE); |
| + EXPECT_EQ(net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_OFFLINE, |
| + nqe_service->GetEffectiveConnectionType()); |
| + |
| + chrome_browser_net::test_util::OverrideEffectiveConnectionTypeAndWait( |
| + net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_SLOW_2G); |
| + EXPECT_EQ(net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_SLOW_2G, |
| + nqe_service->GetEffectiveConnectionType()); |
| +} |