Commit 0eb3aee7 authored by Dmitry Lapin's avatar Dmitry Lapin Committed by Commit Bot

Fix for flacky tests

The device/emulator may return different signal strengths, but the
tests are designed for constant strengths. When receiving different
signal strength tests are failing.
Made the signal strength in the tests to be constant.
In particular, these tests:
NetworkQualitiesPrefManager.WriteAndReadWithMultipleNetworkIDs
NetworkQualityEstimatorTest.CacheObserver
NetworkQualityEstimatorTest.TestTCPSocketRTT

R=tbansal@chromium.org, ryansturm@chromium.org
Bug:
TEST=tests was failing on emulator
"system-images;android-25;google_apis;x86"

Change-Id: I6fd1b4da633218659b6f4558634c97a86e336a26
Reviewed-on: https://chromium-review.googlesource.com/c/1341543Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609471}
parent bff8e646
......@@ -348,6 +348,10 @@ nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID()
INT32_MIN);
}
int32_t TestNetworkQualityEstimator::GetCurrentSignalStrength() const {
return INT32_MIN;
}
TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer(
const base::FilePath& document_root) {
AddDefaultHandlers(document_root);
......
......@@ -243,9 +243,9 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
base::TimeDelta rtt) override;
// NetworkQualityEstimator implementation that returns the overridden
// network
// id (instead of invoking platform APIs).
// network id and signal strength (instead of invoking platform APIs).
nqe::internal::NetworkID GetCurrentNetworkID() const override;
int32_t GetCurrentSignalStrength() const override;
// Net log provided to network quality estimator.
std::unique_ptr<net::BoundTestNetLog> net_log_;
......
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