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

Unified Diff: chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc

Issue 2103323007: Exposing NQE on the Browser UI thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d8e421a618461db2f41ccb7e3b895ca0654c729a
--- /dev/null
+++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc
@@ -0,0 +1,38 @@
+// 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 "net/nqe/network_quality_estimator.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class UINetworkQualityEstimatorServiceBrowserTest
+ : public InProcessBrowserTest {
+ public:
+ UINetworkQualityEstimatorServiceBrowserTest() {}
+};
+
+IN_PROC_BROWSER_TEST_F(UINetworkQualityEstimatorServiceBrowserTest,
tbansal1 2016/07/20 03:32:35 #include content/public/test/browser_test.h for th
RyanSturm 2016/07/20 16:36:46 Done.
+ VerifyNQEState) {
+ // Verifies that NQE notifying EffectiveConnectionTypeObservers causes the
+ // UINetworkQualityEstimatorService to receive an updated
+ // EffectiveConnectionType.
+ Profile* profile = ProfileManager::GetActiveUserProfile();
tbansal1 2016/07/20 03:32:35 Forward declare Profile.
RyanSturm 2016/07/20 16:36:46 Done.
+ 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->GetType());
+
+ chrome_browser_net::test_util::OverrideEffectiveConnectionTypeAndWait(
+ net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_SLOW_2G);
+ EXPECT_EQ(net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_SLOW_2G,
+ nqe_service->GetType());
+}

Powered by Google App Engine
This is Rietveld 408576698