OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/network/network_state_handler.h" | 5 #include "chromeos/network/network_state_handler.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 TEST_F(NetworkStateHandlerTest, RequestUpdate) { | 470 TEST_F(NetworkStateHandlerTest, RequestUpdate) { |
471 // Request an update for kShillManagerClientStubDefaultWireless. | 471 // Request an update for kShillManagerClientStubDefaultWireless. |
472 EXPECT_EQ(1, test_observer_->PropertyUpdatesForService( | 472 EXPECT_EQ(1, test_observer_->PropertyUpdatesForService( |
473 kShillManagerClientStubDefaultWireless)); | 473 kShillManagerClientStubDefaultWireless)); |
474 network_state_handler_->RequestUpdateForNetwork( | 474 network_state_handler_->RequestUpdateForNetwork( |
475 kShillManagerClientStubDefaultWireless); | 475 kShillManagerClientStubDefaultWireless); |
476 message_loop_.RunUntilIdle(); | 476 message_loop_.RunUntilIdle(); |
477 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService( | 477 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService( |
478 kShillManagerClientStubDefaultWireless)); | 478 kShillManagerClientStubDefaultWireless)); |
479 | |
480 // Request an update for all networks. | |
481 network_state_handler_->RequestUpdateForAllNetworks(); | |
482 message_loop_.RunUntilIdle(); | |
483 // kShillManagerClientStubDefaultWireless should now have 3 updates | |
484 EXPECT_EQ(3, test_observer_->PropertyUpdatesForService( | |
485 kShillManagerClientStubDefaultWireless)); | |
486 // Other networks should have 2 updates (inital + request). | |
487 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService( | |
488 kShillManagerClientStubDefaultService)); | |
489 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService( | |
490 kShillManagerClientStubWireless2)); | |
491 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService( | |
492 kShillManagerClientStubCellular)); | |
493 } | 479 } |
494 | 480 |
495 } // namespace chromeos | 481 } // namespace chromeos |
OLD | NEW |