summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus
diff options
context:
space:
mode:
authorharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 19:00:36 +0000
committerharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 19:00:36 +0000
commit5e6b0faa6bd24fc7735d56da55340586a89252df (patch)
tree81be7233927fc23fa4dfe6cb9c8c0d535b3d1fe5 /chromeos/dbus
parent7701b7d4d94c981020b4e8a6f157ffe9f0336a57 (diff)
downloadchromium_src-5e6b0faa6bd24fc7735d56da55340586a89252df.zip
chromium_src-5e6b0faa6bd24fc7735d56da55340586a89252df.tar.gz
chromium_src-5e6b0faa6bd24fc7735d56da55340586a89252df.tar.bz2
dbus: Remove MockImageBurnerClient_and_MockSystemClockClient completely
BUG=234499,234458 TEST=trybots Review URL: https://chromiumcodereview.appspot.com/15048006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus')
-rw-r--r--chromeos/dbus/mock_cros_disks_client.cc46
-rw-r--r--chromeos/dbus/mock_cros_disks_client.h66
-rw-r--r--chromeos/dbus/mock_dbus_thread_manager.cc41
-rw-r--r--chromeos/dbus/mock_dbus_thread_manager.h27
-rw-r--r--chromeos/dbus/mock_image_burner_client.cc13
-rw-r--r--chromeos/dbus/mock_image_burner_client.h31
-rw-r--r--chromeos/dbus/mock_system_clock_client.cc13
-rw-r--r--chromeos/dbus/mock_system_clock_client.h29
-rw-r--r--chromeos/dbus/mock_update_engine_client.cc13
-rw-r--r--chromeos/dbus/mock_update_engine_client.h32
10 files changed, 1 insertions, 310 deletions
diff --git a/chromeos/dbus/mock_cros_disks_client.cc b/chromeos/dbus/mock_cros_disks_client.cc
deleted file mode 100644
index c56d107..0000000
--- a/chromeos/dbus/mock_cros_disks_client.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chromeos/dbus/mock_cros_disks_client.h"
-
-using testing::_;
-using testing::Invoke;
-
-namespace chromeos {
-
-MockCrosDisksClient::MockCrosDisksClient() {
- ON_CALL(*this, SetUpConnections(_, _))
- .WillByDefault(Invoke(this,
- &MockCrosDisksClient::SetUpConnectionsInternal));
-}
-
-MockCrosDisksClient::~MockCrosDisksClient() {}
-
-bool MockCrosDisksClient::SendMountEvent(MountEventType event,
- const std::string& path) {
- if (mount_event_handler_.is_null())
- return false;
- mount_event_handler_.Run(event, path);
- return true;
-}
-
-bool MockCrosDisksClient::SendMountCompletedEvent(
- MountError error_code,
- const std::string& source_path,
- MountType mount_type,
- const std::string& mount_path) {
- if (mount_completed_handler_.is_null())
- return false;
- mount_completed_handler_.Run(error_code, source_path, mount_type, mount_path);
- return true;
-}
-
-void MockCrosDisksClient::SetUpConnectionsInternal(
- const MountEventHandler& mount_event_handler,
- const MountCompletedHandler& mount_completed_handler) {
- mount_event_handler_ = mount_event_handler;
- mount_completed_handler_ = mount_completed_handler;
-}
-
-} // namespace chromeos
diff --git a/chromeos/dbus/mock_cros_disks_client.h b/chromeos/dbus/mock_cros_disks_client.h
deleted file mode 100644
index c239fc8..0000000
--- a/chromeos/dbus/mock_cros_disks_client.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
-#define CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
-
-#include <string>
-
-#include "chromeos/dbus/cros_disks_client.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace chromeos {
-
-class MockCrosDisksClient : public CrosDisksClient {
- public:
- MockCrosDisksClient();
- virtual ~MockCrosDisksClient();
-
- MOCK_METHOD6(Mount, void(const std::string&,
- const std::string&,
- const std::string&,
- MountType,
- const MountCallback&,
- const ErrorCallback&));
- MOCK_METHOD4(Unmount, void(const std::string&,
- UnmountOptions,
- const UnmountCallback&,
- const UnmountCallback&));
- MOCK_METHOD2(EnumerateAutoMountableDevices,
- void(const EnumerateAutoMountableDevicesCallback&,
- const ErrorCallback&));
- MOCK_METHOD4(FormatDevice, void(const std::string&,
- const std::string&,
- const FormatDeviceCallback&,
- const ErrorCallback&));
- MOCK_METHOD3(GetDeviceProperties, void(const std::string&,
- const GetDevicePropertiesCallback&,
- const ErrorCallback&));
- // Warning: if this method is mocked, SendMountEvent and
- // SendMountCompletedEvent may not work.
- MOCK_METHOD2(SetUpConnections, void(const MountEventHandler&,
- const MountCompletedHandler&));
-
- // Used to simulate signals sent by cros disks layer.
- // Invokes handlers set in |SetUpConnections|.
- bool SendMountEvent(MountEventType event, const std::string& path);
- bool SendMountCompletedEvent(MountError error_code,
- const std::string& source_path,
- MountType mount_type,
- const std::string& mount_path);
-
- private:
- // Default implementation of SetupConnections.
- // Sets internal MounteEvent and MountCompleted handlers.
- void SetUpConnectionsInternal(
- const MountEventHandler& mount_event_handler,
- const MountCompletedHandler& mount_completed_handler);
-
- MountEventHandler mount_event_handler_;
- MountCompletedHandler mount_completed_handler_;
-};
-
-} // namespace chromeos
-
-#endif // CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
diff --git a/chromeos/dbus/mock_dbus_thread_manager.cc b/chromeos/dbus/mock_dbus_thread_manager.cc
index 6f2ad55..7e20b55 100644
--- a/chromeos/dbus/mock_dbus_thread_manager.cc
+++ b/chromeos/dbus/mock_dbus_thread_manager.cc
@@ -17,7 +17,6 @@
#include "chromeos/dbus/mock_bluetooth_manager_client.h"
#include "chromeos/dbus/mock_bluetooth_node_client.h"
#include "chromeos/dbus/mock_bluetooth_out_of_band_client.h"
-#include "chromeos/dbus/mock_cros_disks_client.h"
#include "chromeos/dbus/mock_cryptohome_client.h"
#include "chromeos/dbus/mock_shill_device_client.h"
#include "chromeos/dbus/mock_shill_ipconfig_client.h"
@@ -25,11 +24,8 @@
#include "chromeos/dbus/mock_shill_profile_client.h"
#include "chromeos/dbus/mock_shill_service_client.h"
#include "chromeos/dbus/mock_gsm_sms_client.h"
-#include "chromeos/dbus/mock_image_burner_client.h"
#include "chromeos/dbus/mock_power_manager_client.h"
#include "chromeos/dbus/mock_session_manager_client.h"
-#include "chromeos/dbus/mock_system_clock_client.h"
-#include "chromeos/dbus/mock_update_engine_client.h"
#include "chromeos/dbus/power_policy_controller.h"
using ::testing::AnyNumber;
@@ -62,7 +58,6 @@ MockDBusThreadManager::MockDBusThreadManager()
mock_bluetooth_manager_client_(new MockBluetoothManagerClient),
mock_bluetooth_node_client_(new MockBluetoothNodeClient),
mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient),
- mock_cros_disks_client_(new MockCrosDisksClient),
mock_cryptohome_client_(new MockCryptohomeClient),
mock_shill_device_client_(new MockShillDeviceClient),
mock_shill_ipconfig_client_(new MockShillIPConfigClient),
@@ -70,11 +65,8 @@ MockDBusThreadManager::MockDBusThreadManager()
mock_shill_profile_client_(new MockShillProfileClient),
mock_shill_service_client_(new MockShillServiceClient),
mock_gsm_sms_client_(new MockGsmSMSClient),
- mock_image_burner_client_(new MockImageBurnerClient),
mock_power_manager_client_(new MockPowerManagerClient),
- mock_session_manager_client_(new MockSessionManagerClient),
- mock_system_clock_client_(new MockSystemClockClient),
- mock_update_engine_client_(new MockUpdateEngineClient) {
+ mock_session_manager_client_(new MockSessionManagerClient) {
EXPECT_CALL(*this, GetBluetoothAdapterClient())
.WillRepeatedly(Return(mock_bluetooth_adapter_client_.get()));
EXPECT_CALL(*this, GetBluetoothDeviceClient())
@@ -87,8 +79,6 @@ MockDBusThreadManager::MockDBusThreadManager()
.WillRepeatedly(Return(mock_bluetooth_node_client_.get()));
EXPECT_CALL(*this, GetBluetoothOutOfBandClient())
.WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get()));
- EXPECT_CALL(*this, GetCrosDisksClient())
- .WillRepeatedly(Return(mock_cros_disks_client()));
EXPECT_CALL(*this, GetCryptohomeClient())
.WillRepeatedly(Return(mock_cryptohome_client()));
EXPECT_CALL(*this, GetShillDeviceClient())
@@ -103,16 +93,10 @@ MockDBusThreadManager::MockDBusThreadManager()
.WillRepeatedly(Return(mock_shill_service_client()));
EXPECT_CALL(*this, GetGsmSMSClient())
.WillRepeatedly(Return(mock_gsm_sms_client()));
- EXPECT_CALL(*this, GetImageBurnerClient())
- .WillRepeatedly(Return(mock_image_burner_client()));
EXPECT_CALL(*this, GetPowerManagerClient())
.WillRepeatedly(Return(mock_power_manager_client_.get()));
EXPECT_CALL(*this, GetSessionManagerClient())
.WillRepeatedly(Return(mock_session_manager_client_.get()));
- EXPECT_CALL(*this, GetSystemClockClient())
- .WillRepeatedly(Return(mock_system_clock_client()));
- EXPECT_CALL(*this, GetUpdateEngineClient())
- .WillRepeatedly(Return(mock_update_engine_client_.get()));
EXPECT_CALL(*this, GetSystemBus())
.WillRepeatedly(ReturnNull());
@@ -143,16 +127,6 @@ MockDBusThreadManager::MockDBusThreadManager()
.Times(AnyNumber());
EXPECT_CALL(*mock_session_manager_client_.get(), HasObserver(_))
.Times(AnyNumber());
- EXPECT_CALL(*mock_update_engine_client_.get(), AddObserver(_))
- .Times(AnyNumber());
- EXPECT_CALL(*mock_system_clock_client_.get(), AddObserver(_))
- .Times(AnyNumber());
- EXPECT_CALL(*mock_system_clock_client_.get(), RemoveObserver(_))
- .Times(AnyNumber());
- EXPECT_CALL(*mock_system_clock_client_.get(), HasObserver(_))
- .Times(AnyNumber());
- EXPECT_CALL(*mock_update_engine_client_.get(), RemoveObserver(_))
- .Times(AnyNumber());
EXPECT_CALL(*mock_bluetooth_manager_client_.get(), AddObserver(_))
.Times(AnyNumber());
EXPECT_CALL(*mock_bluetooth_manager_client_.get(), RemoveObserver(_))
@@ -178,13 +152,6 @@ MockDBusThreadManager::MockDBusThreadManager()
EXPECT_CALL(*mock_power_manager_client_.get(), RequestStatusUpdate(_))
.Times(AnyNumber());
- // Called from DiskMountManager::Initialize(), ChromeBrowserMainPartsChromeos.
- EXPECT_CALL(*mock_cros_disks_client_.get(), SetUpConnections(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*mock_cros_disks_client_.get(),
- EnumerateAutoMountableDevices(_, _))
- .Times(AnyNumber());
-
// Called from BluetoothManagerImpl ctor.
EXPECT_CALL(*mock_bluetooth_manager_client_.get(), DefaultAdapter(_))
.Times(AnyNumber());
@@ -212,12 +179,6 @@ MockDBusThreadManager::MockDBusThreadManager()
EXPECT_CALL(*mock_shill_manager_client_.get(),
RemovePropertyChangedObserver(_))
.Times(AnyNumber());
-
- // For CrOS browsertests, ChromeBrowserMainPartsChromeos::PostProfileInit()
- // creates an AutomaticRebootManager which calls the following function.
- // For unittests, this function won't get called.
- EXPECT_CALL(*mock_update_engine_client_, GetLastStatus())
- .WillRepeatedly(Return(MockUpdateEngineClient::Status()));
}
MockDBusThreadManager::~MockDBusThreadManager() {
diff --git a/chromeos/dbus/mock_dbus_thread_manager.h b/chromeos/dbus/mock_dbus_thread_manager.h
index 7976afb..e7caf68 100644
--- a/chromeos/dbus/mock_dbus_thread_manager.h
+++ b/chromeos/dbus/mock_dbus_thread_manager.h
@@ -26,7 +26,6 @@ class MockBluetoothInputClient;
class MockBluetoothManagerClient;
class MockBluetoothNodeClient;
class MockBluetoothOutOfBandClient;
-class MockCrosDisksClient;
class MockCryptohomeClient;
class MockShillDeviceClient;
class MockShillIPConfigClient;
@@ -34,18 +33,8 @@ class MockShillManagerClient;
class MockShillProfileClient;
class MockShillServiceClient;
class MockGsmSMSClient;
-class MockImageBurnerClient;
class MockPowerManagerClient;
class MockSessionManagerClient;
-class MockSystemClockClient;
-class MockUpdateEngineClient;
-class MockIBusClient;
-class MockIBusConfigClient;
-class MockIBusEngineFactoryService;
-class MockIBusEngineService;
-class MockIBusInputContextClient;
-class MockIBusPanelService;
-class PowerPolicyController;
// This class provides a mock DBusThreadManager with mock clients
// installed. You can customize the behaviors of mock clients with
@@ -127,9 +116,6 @@ class MockDBusThreadManager : public DBusThreadManager {
MockBluetoothOutOfBandClient* mock_bluetooth_out_of_band_client() {
return mock_bluetooth_out_of_band_client_.get();
}
- MockCrosDisksClient* mock_cros_disks_client() {
- return mock_cros_disks_client_.get();
- }
MockCryptohomeClient* mock_cryptohome_client() {
return mock_cryptohome_client_.get();
}
@@ -151,21 +137,12 @@ class MockDBusThreadManager : public DBusThreadManager {
MockGsmSMSClient* mock_gsm_sms_client() {
return mock_gsm_sms_client_.get();
}
- MockImageBurnerClient* mock_image_burner_client() {
- return mock_image_burner_client_.get();
- }
MockPowerManagerClient* mock_power_manager_client() {
return mock_power_manager_client_.get();
}
MockSessionManagerClient* mock_session_manager_client() {
return mock_session_manager_client_.get();
}
- MockSystemClockClient* mock_system_clock_client() {
- return mock_system_clock_client_.get();
- }
- MockUpdateEngineClient* mock_update_engine_client() {
- return mock_update_engine_client_.get();
- }
private:
// Note: Keep this before other members so they can call AddObserver() in
@@ -178,7 +155,6 @@ class MockDBusThreadManager : public DBusThreadManager {
scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_;
scoped_ptr<MockBluetoothNodeClient> mock_bluetooth_node_client_;
scoped_ptr<MockBluetoothOutOfBandClient> mock_bluetooth_out_of_band_client_;
- scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_;
scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_;
scoped_ptr<MockShillDeviceClient> mock_shill_device_client_;
scoped_ptr<MockShillIPConfigClient> mock_shill_ipconfig_client_;
@@ -186,11 +162,8 @@ class MockDBusThreadManager : public DBusThreadManager {
scoped_ptr<MockShillProfileClient> mock_shill_profile_client_;
scoped_ptr<MockShillServiceClient> mock_shill_service_client_;
scoped_ptr<MockGsmSMSClient> mock_gsm_sms_client_;
- scoped_ptr<MockImageBurnerClient> mock_image_burner_client_;
scoped_ptr<MockPowerManagerClient> mock_power_manager_client_;
scoped_ptr<MockSessionManagerClient> mock_session_manager_client_;
- scoped_ptr<MockSystemClockClient> mock_system_clock_client_;
- scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_;
scoped_ptr<PowerPolicyController> power_policy_controller_;
DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager);
diff --git a/chromeos/dbus/mock_image_burner_client.cc b/chromeos/dbus/mock_image_burner_client.cc
deleted file mode 100644
index fb95831..0000000
--- a/chromeos/dbus/mock_image_burner_client.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chromeos/dbus/mock_image_burner_client.h"
-
-namespace chromeos {
-
-MockImageBurnerClient::MockImageBurnerClient() {}
-
-MockImageBurnerClient::~MockImageBurnerClient() {}
-
-} // namespace chromeos
diff --git a/chromeos/dbus/mock_image_burner_client.h b/chromeos/dbus/mock_image_burner_client.h
deleted file mode 100644
index 63e3211..0000000
--- a/chromeos/dbus/mock_image_burner_client.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_DBUS_MOCK_IMAGE_BURNER_CLIENT_H_
-#define CHROMEOS_DBUS_MOCK_IMAGE_BURNER_CLIENT_H_
-
-#include <string>
-
-#include "chromeos/dbus/image_burner_client.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace chromeos {
-
-class MockImageBurnerClient : public ImageBurnerClient {
- public:
- MockImageBurnerClient();
- virtual ~MockImageBurnerClient();
-
- MOCK_METHOD3(BurnImage, void(const std::string&,
- const std::string&,
- const ErrorCallback&));
- MOCK_METHOD2(SetEventHandlers, void(const BurnFinishedHandler&,
- const BurnProgressUpdateHandler&));
- MOCK_METHOD0(ResetEventHandlers, void());
-
-};
-
-} // namespace chromeos
-
-#endif // CHROMEOS_DBUS_MOCK_IMAGE_BURNER_CLIENT_H_
diff --git a/chromeos/dbus/mock_system_clock_client.cc b/chromeos/dbus/mock_system_clock_client.cc
deleted file mode 100644
index 5269719..0000000
--- a/chromeos/dbus/mock_system_clock_client.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chromeos/dbus/mock_system_clock_client.h"
-
-
-namespace chromeos {
-
-MockSystemClockClient::MockSystemClockClient() {}
-MockSystemClockClient::~MockSystemClockClient() {}
-
-} // namespace chromeos
diff --git a/chromeos/dbus/mock_system_clock_client.h b/chromeos/dbus/mock_system_clock_client.h
deleted file mode 100644
index 547c385..0000000
--- a/chromeos/dbus/mock_system_clock_client.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_DBUS_MOCK_SYSTEM_CLOCK_CLIENT_H_
-#define CHROMEOS_DBUS_MOCK_SYSTEM_CLOCK_CLIENT_H_
-
-#include "chromeos/dbus/system_clock_client.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace chromeos {
-
-// SystemClockClient is used to communicate with the system clock.
-class MockSystemClockClient : public SystemClockClient {
- public:
- MockSystemClockClient();
- virtual ~MockSystemClockClient();
-
- MOCK_METHOD1(AddObserver, void(Observer*));
- MOCK_METHOD1(RemoveObserver, void(Observer*));
- MOCK_METHOD1(HasObserver, bool(Observer*));
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockSystemClockClient);
-};
-
-} // namespace chromeos
-
-#endif // CHROMEOS_DBUS_MOCK_SYSTEM_CLOCK_CLIENT_H_
diff --git a/chromeos/dbus/mock_update_engine_client.cc b/chromeos/dbus/mock_update_engine_client.cc
deleted file mode 100644
index 32ba344..0000000
--- a/chromeos/dbus/mock_update_engine_client.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chromeos/dbus/mock_update_engine_client.h"
-
-namespace chromeos {
-
-MockUpdateEngineClient::MockUpdateEngineClient() {}
-
-MockUpdateEngineClient::~MockUpdateEngineClient() {}
-
-} // namespace chromeos
diff --git a/chromeos/dbus/mock_update_engine_client.h b/chromeos/dbus/mock_update_engine_client.h
deleted file mode 100644
index 70cff66..0000000
--- a/chromeos/dbus/mock_update_engine_client.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_DBUS_MOCK_UPDATE_ENGINE_CLIENT_H_
-#define CHROMEOS_DBUS_MOCK_UPDATE_ENGINE_CLIENT_H_
-
-#include <string>
-
-#include "chromeos/dbus/update_engine_client.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace chromeos {
-
-class MockUpdateEngineClient : public UpdateEngineClient {
- public:
- MockUpdateEngineClient();
- virtual ~MockUpdateEngineClient();
-
- MOCK_METHOD1(AddObserver, void(Observer*));
- MOCK_METHOD1(RemoveObserver, void(Observer*));
- MOCK_METHOD1(HasObserver, bool(Observer*));
- MOCK_METHOD1(RequestUpdateCheck, void(const UpdateCheckCallback&));
- MOCK_METHOD0(RebootAfterUpdate, void());
- MOCK_METHOD1(SetReleaseTrack, void(const std::string&));
- MOCK_METHOD1(GetReleaseTrack, void(const GetReleaseTrackCallback&));
- MOCK_METHOD0(GetLastStatus, Status());
-};
-
-} // namespace chromeos
-
-#endif // CHROMEOS_DBUS_MOCK_UPDATE_ENGINE_CLIENT_H_