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

Unified Diff: chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc

Issue 1014053002: Provide warning message for setParameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Print only when there is a warning and fix unittest error Created 5 years, 9 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
Index: chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc
diff --git a/chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc b/chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc
index 6c3f47697e240e39704e765b136f84950ad20d2d..98d75dc949c53d2569f05acd4bc0be88f720a806 100644
--- a/chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc
+++ b/chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc
@@ -48,6 +48,7 @@ class ShillThirdPartyVpnDriverClientTest : public ShillClientUnittestBase {
void TearDown() override { ShillClientUnittestBase::TearDown(); }
MOCK_METHOD0(MockSuccess, void());
+ MOCK_METHOD1(MockSuccessWithWarning, void(const std::string& warning));
static void Failure(const std::string& error_name,
const std::string& error_message) {
ADD_FAILURE() << error_name << ": " << error_message;
@@ -124,13 +125,15 @@ TEST_F(ShillThirdPartyVpnDriverClientTest, PlatformSignal) {
TEST_F(ShillThirdPartyVpnDriverClientTest, SetParameters) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
+ dbus::MessageWriter writer(response.get());
+ writer.AppendString(std::string());
pneubeck (no reviews) 2015/03/19 09:22:39 you could use a nonempty string and test the resul
base::DictionaryValue parameters;
const std::string kAddress("1.1.1.1");
parameters.SetStringWithoutPathExpansion(
shill::kAddressParameterThirdPartyVpn, kAddress);
- EXPECT_CALL(*this, MockSuccess()).Times(1);
+ EXPECT_CALL(*this, MockSuccessWithWarning(_)).Times(1);
PrepareForMethodCall(
shill::kSetParametersFunction,
@@ -139,7 +142,7 @@ TEST_F(ShillThirdPartyVpnDriverClientTest, SetParameters) {
client_->SetParameters(
kExampleIPConfigPath, parameters,
- base::Bind(&ShillThirdPartyVpnDriverClientTest::MockSuccess,
+ base::Bind(&ShillThirdPartyVpnDriverClientTest::MockSuccessWithWarning,
base::Unretained(this)),
base::Bind(&Failure));
« no previous file with comments | « chromeos/dbus/shill_third_party_vpn_driver_client.cc ('k') | extensions/browser/api/vpn_provider/vpn_provider_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698