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

Unified Diff: net/nqe/network_quality_estimator_test_util.h

Issue 2486033002: NQE: Use ResponseHeaders to get the HTTP status code (Closed)
Patch Set: cleanup Created 4 years, 1 month 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
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_test_util.h
diff --git a/net/nqe/network_quality_estimator_test_util.h b/net/nqe/network_quality_estimator_test_util.h
index fb268f2394e582d52727ce18493ded27be38799c..b71b521e16f03d6bb06926900cc854d95a387213 100644
--- a/net/nqe/network_quality_estimator_test_util.h
+++ b/net/nqe/network_quality_estimator_test_util.h
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
+#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/time/time.h"
@@ -57,13 +58,13 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
NetworkChangeNotifier::ConnectionType new_connection_type,
const std::string& network_id);
- // Called by the embedded server when an HTTP request is received.
- std::unique_ptr<test_server::HttpResponse> HandleRequest(
- const test_server::HttpRequest& request);
-
// Returns a GURL hosted at the embedded test server.
const GURL GetEchoURL() const;
+ // Returns a GURL hosted at the embedded test server which contains redirect
+ // to another HTTPS URL.
+ const GURL GetRedirectURL() const;
+
void set_effective_connection_type(EffectiveConnectionType type) {
// Callers should not set effective connection type along with the
// lower-layer metrics.
@@ -180,6 +181,11 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
using NetworkQualityEstimator::OnConnectionTypeChanged;
private:
+ class LocalHttpTestServer : public EmbeddedTestServer {
+ public:
+ explicit LocalHttpTestServer(const base::FilePath& document_root);
+ };
+
// NetworkQualityEstimator implementation that returns the overridden
// network
// id (instead of invoking platform APIs).
@@ -217,7 +223,7 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
double rand_double_;
- EmbeddedTestServer embedded_test_server_;
+ LocalHttpTestServer embedded_test_server_;
DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator);
};
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698