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

Unified Diff: chromeos/network/network_state_handler_unittest.cc

Issue 14137017: Add TechnologyState to NetworkStateHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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
« no previous file with comments | « chromeos/network/network_state_handler.cc ('k') | chromeos/network/shill_property_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler_unittest.cc
diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc
index 685d913fe957e03b4589840849a94815281026da..1d9ce157c8f827b7b0656e4f137a44ce0b819cd5 100644
--- a/chromeos/network/network_state_handler_unittest.cc
+++ b/chromeos/network/network_state_handler_unittest.cc
@@ -216,13 +216,21 @@ TEST_F(NetworkStateHandlerTest, TechnologyChanged) {
message_loop_.RunUntilIdle();
EXPECT_EQ(1u, test_observer_->manager_changed_count());
// Enable a technology.
- EXPECT_FALSE(network_state_handler_->TechnologyEnabled(flimflam::kTypeWimax));
+ EXPECT_NE(NetworkStateHandler::TECHNOLOGY_ENABLED,
+ network_state_handler_->GetTechnologyState(flimflam::kTypeWimax));
network_state_handler_->SetTechnologyEnabled(
flimflam::kTypeWimax, true, network_handler::ErrorCallback());
- message_loop_.RunUntilIdle();
- // Ensure we get a manager changed callback when we change a property.
+ // The technology state should immediately change to ENABLING and we should
+ // receive a manager changed callback.
EXPECT_EQ(2u, test_observer_->manager_changed_count());
- EXPECT_TRUE(network_state_handler_->TechnologyEnabled(flimflam::kTypeWimax));
+ EXPECT_EQ(NetworkStateHandler::TECHNOLOGY_ENABLING,
+ network_state_handler_->GetTechnologyState(flimflam::kTypeWimax));
+ message_loop_.RunUntilIdle();
+ // Ensure we receive another manager changed callbacks when the technology
+ // becomes enabled.
+ EXPECT_EQ(3u, test_observer_->manager_changed_count());
+ EXPECT_EQ(NetworkStateHandler::TECHNOLOGY_ENABLED,
+ network_state_handler_->GetTechnologyState(flimflam::kTypeWimax));
}
TEST_F(NetworkStateHandlerTest, ServicePropertyChanged) {
« no previous file with comments | « chromeos/network/network_state_handler.cc ('k') | chromeos/network/shill_property_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698