summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorkaliamoorthi <kaliamoorthi@chromium.org>2015-03-19 03:09:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-19 10:10:23 +0000
commite5ad31358cc693c737cf34268b4abd520994bfc3 (patch)
tree8730595d6c9fe102f099b139640d865ff360df9d /chromeos
parentd642544d7ac9987fb728c0251ae2587ec3b07bc5 (diff)
downloadchromium_src-e5ad31358cc693c737cf34268b4abd520994bfc3.zip
chromium_src-e5ad31358cc693c737cf34268b4abd520994bfc3.tar.gz
chromium_src-e5ad31358cc693c737cf34268b4abd520994bfc3.tar.bz2
Provide warning message for setParameters
This CL adds warning message for setParameters API of vpnProvider. The vpnProvider extension API is further filled to stable channel from dev channel. BUG=467911 TBR=stevenjb Review URL: https://codereview.chromium.org/1014053002 Cr-Commit-Position: refs/heads/master@{#321325}
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc5
-rw-r--r--chromeos/dbus/fake_shill_third_party_vpn_driver_client.h2
-rw-r--r--chromeos/dbus/shill_third_party_vpn_driver_client.cc7
-rw-r--r--chromeos/dbus/shill_third_party_vpn_driver_client.h2
-rw-r--r--chromeos/dbus/shill_third_party_vpn_driver_client_unittest.cc7
5 files changed, 14 insertions, 9 deletions
diff --git a/chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc b/chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc
index 90d6ebda..b5e45b9 100644
--- a/chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc
+++ b/chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc
@@ -42,9 +42,10 @@ void FakeShillThirdPartyVpnDriverClient::RemoveShillThirdPartyVpnObserver(
void FakeShillThirdPartyVpnDriverClient::SetParameters(
const std::string& object_path_value,
const base::DictionaryValue& parameters,
- const base::Closure& callback,
+ const ShillClientHelper::StringCallback& callback,
const ShillClientHelper::ErrorCallback& error_callback) {
- base::MessageLoop::current()->PostTask(FROM_HERE, callback);
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, std::string()));
}
void FakeShillThirdPartyVpnDriverClient::UpdateConnectionState(
diff --git a/chromeos/dbus/fake_shill_third_party_vpn_driver_client.h b/chromeos/dbus/fake_shill_third_party_vpn_driver_client.h
index f4dae5c..18a3f21 100644
--- a/chromeos/dbus/fake_shill_third_party_vpn_driver_client.h
+++ b/chromeos/dbus/fake_shill_third_party_vpn_driver_client.h
@@ -33,7 +33,7 @@ class CHROMEOS_EXPORT FakeShillThirdPartyVpnDriverClient
void SetParameters(
const std::string& object_path_value,
const base::DictionaryValue& parameters,
- const base::Closure& callback,
+ const ShillClientHelper::StringCallback& callback,
const ShillClientHelper::ErrorCallback& error_callback) override;
void UpdateConnectionState(
const std::string& object_path_value,
diff --git a/chromeos/dbus/shill_third_party_vpn_driver_client.cc b/chromeos/dbus/shill_third_party_vpn_driver_client.cc
index a1a761c..7a28325 100644
--- a/chromeos/dbus/shill_third_party_vpn_driver_client.cc
+++ b/chromeos/dbus/shill_third_party_vpn_driver_client.cc
@@ -44,7 +44,7 @@ class ShillThirdPartyVpnDriverClientImpl
void SetParameters(
const std::string& object_path_value,
const base::DictionaryValue& parameters,
- const base::Closure& callback,
+ const ShillClientHelper::StringCallback& callback,
const ShillClientHelper::ErrorCallback& error_callback) override;
void UpdateConnectionState(
@@ -200,7 +200,7 @@ void ShillThirdPartyVpnDriverClientImpl::DeleteHelper(
void ShillThirdPartyVpnDriverClientImpl::SetParameters(
const std::string& object_path_value,
const base::DictionaryValue& parameters,
- const base::Closure& callback,
+ const ShillClientHelper::StringCallback& callback,
const ShillClientHelper::ErrorCallback& error_callback) {
dbus::MethodCall method_call(shill::kFlimflamThirdPartyVpnInterface,
shill::kSetParametersFunction);
@@ -226,7 +226,8 @@ void ShillThirdPartyVpnDriverClientImpl::SetParameters(
}
writer.CloseContainer(&array_writer);
GetHelper(object_path_value)
- ->CallVoidMethodWithErrorCallback(&method_call, callback, error_callback);
+ ->CallStringMethodWithErrorCallback(&method_call, callback,
+ error_callback);
}
void ShillThirdPartyVpnDriverClientImpl::UpdateConnectionState(
diff --git a/chromeos/dbus/shill_third_party_vpn_driver_client.h b/chromeos/dbus/shill_third_party_vpn_driver_client.h
index ac4738c..d75fab9 100644
--- a/chromeos/dbus/shill_third_party_vpn_driver_client.h
+++ b/chromeos/dbus/shill_third_party_vpn_driver_client.h
@@ -56,7 +56,7 @@ class CHROMEOS_EXPORT ShillThirdPartyVpnDriverClient : public DBusClient {
virtual void SetParameters(
const std::string& object_path_value,
const base::DictionaryValue& parameters,
- const base::Closure& callback,
+ const ShillClientHelper::StringCallback& callback,
const ShillClientHelper::ErrorCallback& error_callback) = 0;
// Calls UpdateConnectionState method.
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 6c3f476..3c07702 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("deadbeef"));
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(std::string("deadbeef"))).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));