Commit 5b60c588 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Fix the network quality browser test

Initialize the value of a variable to avoid triggering
use of uninitialized variable error

Bug: 819244
Change-Id: Ida4ccc55c872ebaeb54d41c35f237e6930c8aa7b
TBR: xunjieli@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/1117932
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571032}
parent fed0e8ec
...@@ -51,6 +51,8 @@ class TestNetworkQualityObserver ...@@ -51,6 +51,8 @@ class TestNetworkQualityObserver
public: public:
explicit TestNetworkQualityObserver(NetworkQualityTracker* tracker) explicit TestNetworkQualityObserver(NetworkQualityTracker* tracker)
: num_notifications_(0), : num_notifications_(0),
run_loop_wait_effective_connection_type_(
net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN),
run_loop_(std::make_unique<base::RunLoop>()), run_loop_(std::make_unique<base::RunLoop>()),
tracker_(tracker), tracker_(tracker),
effective_connection_type_(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { effective_connection_type_(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {
...@@ -81,6 +83,8 @@ class TestNetworkQualityObserver ...@@ -81,6 +83,8 @@ class TestNetworkQualityObserver
net::EffectiveConnectionType run_loop_wait_effective_connection_type) { net::EffectiveConnectionType run_loop_wait_effective_connection_type) {
if (effective_connection_type_ == run_loop_wait_effective_connection_type) if (effective_connection_type_ == run_loop_wait_effective_connection_type)
return; return;
ASSERT_NE(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN,
run_loop_wait_effective_connection_type);
run_loop_wait_effective_connection_type_ = run_loop_wait_effective_connection_type_ =
run_loop_wait_effective_connection_type; run_loop_wait_effective_connection_type;
run_loop_->Run(); run_loop_->Run();
......
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