diff options
author | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 20:34:18 +0000 |
---|---|---|
committer | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 20:34:18 +0000 |
commit | d690ba464ab9b62373eb6b88435054d79f93a02e (patch) | |
tree | e010ce3b5d8cca5d6e7e03446d5742a7c4439929 /chromeos/dbus/shill_manager_client_unittest.cc | |
parent | 2a74ed6cca3901234dad1294487a6ccd7b0710c9 (diff) | |
download | chromium_src-d690ba464ab9b62373eb6b88435054d79f93a02e.zip chromium_src-d690ba464ab9b62373eb6b88435054d79f93a02e.tar.gz chromium_src-d690ba464ab9b62373eb6b88435054d79f93a02e.tar.bz2 |
This converts the Shill clients to allow propagation of shill errors
back from the function calls. The existing implentation completely ignores most shill errors, and the javascript implementation will want to be able to receive them to aid in diagnosis.
BUG=chromium:147620,chromium:146616
TEST=Ran unit tests, ran on device.
Review URL: https://chromiumcodereview.appspot.com/10949030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/shill_manager_client_unittest.cc')
-rw-r--r-- | chromeos/dbus/shill_manager_client_unittest.cc | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/chromeos/dbus/shill_manager_client_unittest.cc b/chromeos/dbus/shill_manager_client_unittest.cc index e101bf2..b80d8d9 100644 --- a/chromeos/dbus/shill_manager_client_unittest.cc +++ b/chromeos/dbus/shill_manager_client_unittest.cc @@ -221,9 +221,15 @@ TEST_F(ShillManagerClientTest, SetProperty) { &value), response.get()); // Call method. + MockClosure mock_closure; + MockErrorCallback mock_error_callback; client_->SetProperty(flimflam::kCheckPortalListProperty, value, - base::Bind(&ExpectNoResultValue)); + mock_closure.GetCallback(), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_closure, Run()).Times(1); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } @@ -236,7 +242,14 @@ TEST_F(ShillManagerClientTest, RequestScan) { base::Bind(&ExpectStringArgument, flimflam::kTypeWifi), response.get()); // Call method. - client_->RequestScan(flimflam::kTypeWifi, base::Bind(&ExpectNoResultValue)); + MockClosure mock_closure; + MockErrorCallback mock_error_callback; + client_->RequestScan(flimflam::kTypeWifi, + mock_closure.GetCallback(), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_closure, Run()).Times(1); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } @@ -249,8 +262,14 @@ TEST_F(ShillManagerClientTest, EnableTechnology) { base::Bind(&ExpectStringArgument, flimflam::kTypeWifi), response.get()); // Call method. + MockClosure mock_closure; + MockErrorCallback mock_error_callback; client_->EnableTechnology(flimflam::kTypeWifi, - base::Bind(&ExpectNoResultValue)); + mock_closure.GetCallback(), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_closure, Run()).Times(1); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } @@ -263,8 +282,14 @@ TEST_F(ShillManagerClientTest, DisableTechnology) { base::Bind(&ExpectStringArgument, flimflam::kTypeWifi), response.get()); // Call method. + MockClosure mock_closure; + MockErrorCallback mock_error_callback; client_->DisableTechnology(flimflam::kTypeWifi, - base::Bind(&ExpectNoResultValue)); + mock_closure.GetCallback(), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_closure, Run()).Times(1); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } @@ -279,7 +304,14 @@ TEST_F(ShillManagerClientTest, ConfigureService) { base::Bind(&ExpectDictionaryValueArgument, arg.get()), response.get()); // Call method. - client_->ConfigureService(*arg, base::Bind(&ExpectNoResultValue)); + MockClosure mock_closure; + MockErrorCallback mock_error_callback; + client_->ConfigureService(*arg, + mock_closure.GetCallback(), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_closure, Run()).Times(1); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } @@ -297,7 +329,13 @@ TEST_F(ShillManagerClientTest, GetService) { base::Bind(&ExpectDictionaryValueArgument, arg.get()), response.get()); // Call method. - client_->GetService(*arg, base::Bind(&ExpectObjectPathResult, object_path)); + MockErrorCallback mock_error_callback; + client_->GetService(*arg, + base::Bind(&ExpectObjectPathResultWithoutStatus, + object_path), + mock_error_callback.GetCallback()); + EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); + // Run the message loop. message_loop_.RunAllPending(); } |