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

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

Issue 24150004: Refactor the setup of Shill*Stubs' default environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed some includes. Created 7 years, 3 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/dbus/shill_stub_helper.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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
11 #include "chromeos/dbus/mock_dbus_thread_manager.h" 11 #include "chromeos/dbus/mock_dbus_thread_manager.h"
12 #include "chromeos/dbus/mock_shill_manager_client.h" 12 #include "chromeos/dbus/mock_shill_manager_client.h"
13 #include "chromeos/dbus/mock_shill_profile_client.h" 13 #include "chromeos/dbus/mock_shill_profile_client.h"
14 #include "chromeos/dbus/mock_shill_service_client.h" 14 #include "chromeos/dbus/mock_shill_service_client.h"
15 #include "chromeos/dbus/shill_profile_client_stub.h" 15 #include "chromeos/dbus/shill_stub_helper.h"
16 #include "chromeos/network/network_configuration_handler.h" 16 #include "chromeos/network/network_configuration_handler.h"
17 #include "chromeos/network/network_state.h" 17 #include "chromeos/network/network_state.h"
18 #include "chromeos/network/network_state_handler.h" 18 #include "chromeos/network/network_state_handler.h"
19 #include "chromeos/network/network_state_handler_observer.h" 19 #include "chromeos/network/network_state_handler_observer.h"
20 #include "testing/gmock/include/gmock/gmock.h" 20 #include "testing/gmock/include/gmock/gmock.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 #include "third_party/cros_system_api/dbus/service_constants.h" 22 #include "third_party/cros_system_api/dbus/service_constants.h"
23 23
24 using ::testing::_; 24 using ::testing::_;
25 using ::testing::Invoke; 25 using ::testing::Invoke;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 flimflam::kSSIDProperty, service_path); 585 flimflam::kSSIDProperty, service_path);
586 properties.SetStringWithoutPathExpansion( 586 properties.SetStringWithoutPathExpansion(
587 flimflam::kNameProperty, service_path); 587 flimflam::kNameProperty, service_path);
588 properties.SetStringWithoutPathExpansion( 588 properties.SetStringWithoutPathExpansion(
589 flimflam::kGuidProperty, service_path); 589 flimflam::kGuidProperty, service_path);
590 properties.SetStringWithoutPathExpansion( 590 properties.SetStringWithoutPathExpansion(
591 flimflam::kTypeProperty, flimflam::kTypeWifi); 591 flimflam::kTypeProperty, flimflam::kTypeWifi);
592 properties.SetStringWithoutPathExpansion( 592 properties.SetStringWithoutPathExpansion(
593 flimflam::kStateProperty, flimflam::kStateIdle); 593 flimflam::kStateProperty, flimflam::kStateIdle);
594 properties.SetStringWithoutPathExpansion( 594 properties.SetStringWithoutPathExpansion(
595 flimflam::kProfileProperty, ShillProfileClientStub::kSharedProfilePath); 595 flimflam::kProfileProperty, shill_stub_helper::kSharedProfilePath);
596 596
597 network_configuration_handler_->CreateConfiguration( 597 network_configuration_handler_->CreateConfiguration(
598 properties, 598 properties,
599 base::Bind( 599 base::Bind(
600 &NetworkConfigurationHandlerStubTest::CreateConfigurationCallback, 600 &NetworkConfigurationHandlerStubTest::CreateConfigurationCallback,
601 base::Unretained(this)), 601 base::Unretained(this)),
602 base::Bind(&ErrorCallback, false, service_path)); 602 base::Bind(&ErrorCallback, false, service_path));
603 message_loop_.RunUntilIdle(); 603 message_loop_.RunUntilIdle();
604 604
605 EXPECT_FALSE(create_service_path_.empty()); 605 EXPECT_FALSE(create_service_path_.empty());
606 606
607 std::string ssid; 607 std::string ssid;
608 EXPECT_TRUE(GetServiceStringProperty( 608 EXPECT_TRUE(GetServiceStringProperty(
609 create_service_path_, flimflam::kSSIDProperty, &ssid)); 609 create_service_path_, flimflam::kSSIDProperty, &ssid));
610 std::string actual_profile; 610 std::string actual_profile;
611 EXPECT_EQ(service_path, ssid); 611 EXPECT_EQ(service_path, ssid);
612 612
613 EXPECT_TRUE(GetServiceStringProperty( 613 EXPECT_TRUE(GetServiceStringProperty(
614 create_service_path_, flimflam::kProfileProperty, &actual_profile)); 614 create_service_path_, flimflam::kProfileProperty, &actual_profile));
615 EXPECT_EQ(ShillProfileClientStub::kSharedProfilePath, actual_profile); 615 EXPECT_EQ(shill_stub_helper::kSharedProfilePath, actual_profile);
616 } 616 }
617 617
618 } // namespace chromeos 618 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_stub_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698