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

Side by Side Diff: chromeos/network/network_state_handler_unittest.cc

Issue 15233002: Add NetworkStateHandler::RequestUpdateForNetwork (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add request call for NetworkConfigurationHandler::CreateConfiguration Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_state_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 // No default network updates for signal strength changes. 340 // No default network updates for signal strength changes.
341 DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( 341 DBusThreadManager::Get()->GetShillServiceClient()->SetProperty(
342 dbus::ObjectPath(wifi1), 342 dbus::ObjectPath(wifi1),
343 flimflam::kSignalStrengthProperty, base::FundamentalValue(32), 343 flimflam::kSignalStrengthProperty, base::FundamentalValue(32),
344 base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); 344 base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
345 message_loop_.RunUntilIdle(); 345 message_loop_.RunUntilIdle();
346 EXPECT_EQ(3u, test_observer_->default_network_change_count()); 346 EXPECT_EQ(3u, test_observer_->default_network_change_count());
347 } 347 }
348 348
349 TEST_F(NetworkStateHandlerTest, RequestUpdate) {
350 // Request an update for kShillManagerClientStubDefaultWireless.
351 EXPECT_EQ(1, test_observer_->PropertyUpdatesForService(
352 kShillManagerClientStubDefaultWireless));
353 EXPECT_TRUE(network_state_handler_->RequestUpdateForNetwork(
354 kShillManagerClientStubDefaultWireless));
355 message_loop_.RunUntilIdle();
356 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(
357 kShillManagerClientStubDefaultWireless));
358
359 // Request an update for all networks.
360 network_state_handler_->RequestUpdateForAllNetworks();
361 message_loop_.RunUntilIdle();
362 // kShillManagerClientStubDefaultWireless should now have 3 updates
363 EXPECT_EQ(3, test_observer_->PropertyUpdatesForService(
364 kShillManagerClientStubDefaultWireless));
365 // Other networks should have 2 updates (inital + request).
366 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(
367 kShillManagerClientStubDefaultService));
368 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(
369 kShillManagerClientStubWireless2));
370 EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(
371 kShillManagerClientStubCellular));
372 }
373
349 } // namespace chromeos 374 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_state_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698