satorux1
2013/11/05 03:55:16
Function comment is missing.
Seems to me that th
Function comment is missing.
Seems to me that this function is only used from
DBusThreadManager::InitializeWithStub(). Do you plan to use this from elsewhere?
Otherwise, would be nicer to put this in dbus_thread_manager.cc in favor of less
things to expose.
pneubeck (no reviews)
2013/11/05 10:03:04
By providing this separate function, we can do the
On 2013/11/05 03:55:16, satorux1 wrote:
> Function comment is missing.
>
> Seems to me that this function is only used from
> DBusThreadManager::InitializeWithStub(). Do you plan to use this from
elsewhere?
>
> Otherwise, would be nicer to put this in dbus_thread_manager.cc in favor of
less
> things to expose.
By providing this separate function, we can do the following in tests:
FakeDBusThreadManager* manager = new Fake...;
SetStubClients(manager);
manager->SetShillManagerClient(my_client_);
DBusThreadManager::InitializeForTesting(manager);
This isn't used in any test so far. But I think this is very important, for
example for the FakeShillManagerClient. Currently it (and some other
ShillClients) relies on a GetTestInterface() in the ShillManagerClient (!)
interface and is implemented only by the FakeShillManagerClient.
With the above pattern, we can remove these GetTestInterface() methods.
satorux1
2013/11/05 10:18:56
Oh I see. Does this have to be a function in a sep
On 2013/11/05 10:03:04, pneubeck wrote:
> On 2013/11/05 03:55:16, satorux1 wrote:
> > Function comment is missing.
> >
> > Seems to me that this function is only used from
> > DBusThreadManager::InitializeWithStub(). Do you plan to use this from
> elsewhere?
> >
> > Otherwise, would be nicer to put this in dbus_thread_manager.cc in favor of
> less
> > things to expose.
>
> By providing this separate function, we can do the following in tests:
>
> FakeDBusThreadManager* manager = new Fake...;
> SetStubClients(manager);
> manager->SetShillManagerClient(my_client_);
> DBusThreadManager::InitializeForTesting(manager);
>
> This isn't used in any test so far. But I think this is very important, for
> example for the FakeShillManagerClient. Currently it (and some other
> ShillClients) relies on a GetTestInterface() in the ShillManagerClient (!)
> interface and is implemented only by the FakeShillManagerClient.
> With the above pattern, we can remove these GetTestInterface() methods.
Oh I see. Does this have to be a function in a separate file? I thought it'd be
simpler to make it a member of FakeDBusThreadManager, like:
manager->AddFakeClients();
pneubeck (no reviews)
2013/11/05 10:58:44
Since it's used in dbus_thread_manager.cc anyways,
On 2013/11/05 10:18:56, satorux1 wrote:
> On 2013/11/05 10:03:04, pneubeck wrote:
> > On 2013/11/05 03:55:16, satorux1 wrote:
> > > Function comment is missing.
> > >
> > > Seems to me that this function is only used from
> > > DBusThreadManager::InitializeWithStub(). Do you plan to use this from
> > elsewhere?
> > >
> > > Otherwise, would be nicer to put this in dbus_thread_manager.cc in favor
of
> > less
> > > things to expose.
> >
> > By providing this separate function, we can do the following in tests:
> >
> > FakeDBusThreadManager* manager = new Fake...;
> > SetStubClients(manager);
> > manager->SetShillManagerClient(my_client_);
> > DBusThreadManager::InitializeForTesting(manager);
> >
> > This isn't used in any test so far. But I think this is very important, for
> > example for the FakeShillManagerClient. Currently it (and some other
> > ShillClients) relies on a GetTestInterface() in the ShillManagerClient (!)
> > interface and is implemented only by the FakeShillManagerClient.
> > With the above pattern, we can remove these GetTestInterface() methods.
>
> Oh I see. Does this have to be a function in a separate file? I thought it'd
be
> simpler to make it a member of FakeDBusThreadManager, like:
>
> manager->AddFakeClients();
>
Since it's used in dbus_thread_manager.cc anyways, I agree that we can make it a
static function of the Fake*Manager.
On 2013/11/05 10:58:44, pneubeck wrote:
> On 2013/11/05 10:18:56, satorux1 wrote:
> > On 2013/11/05 10:03:04, pneubeck wrote:
> > > On 2013/11/05 03:55:16, satorux1 wrote:
> > > > Function comment is missing.
> > > >
> > > > Seems to me that this function is only used from
> > > > DBusThreadManager::InitializeWithStub(). Do you plan to use this from
> > > elsewhere?
> > > >
> > > > Otherwise, would be nicer to put this in dbus_thread_manager.cc in favor
> of
> > > less
> > > > things to expose.
> > >
> > > By providing this separate function, we can do the following in tests:
> > >
> > > FakeDBusThreadManager* manager = new Fake...;
> > > SetStubClients(manager);
> > > manager->SetShillManagerClient(my_client_);
> > > DBusThreadManager::InitializeForTesting(manager);
> > >
> > > This isn't used in any test so far. But I think this is very important,
for
> > > example for the FakeShillManagerClient. Currently it (and some other
> > > ShillClients) relies on a GetTestInterface() in the ShillManagerClient (!)
> > > interface and is implemented only by the FakeShillManagerClient.
> > > With the above pattern, we can remove these GetTestInterface() methods.
> >
> > Oh I see. Does this have to be a function in a separate file? I thought it'd
> be
> > simpler to make it a member of FakeDBusThreadManager, like:
> >
> > manager->AddFakeClients();
> >
>
> Since it's used in dbus_thread_manager.cc anyways, I agree that we can make it
a
> static function of the Fake*Manager.
Issue 49773003: ChromeOS: Remove MockDBusThreadManager.
(Closed)
Created 7 years, 1 month ago by pneubeck (no reviews)
Modified 7 years, 1 month ago
Reviewers: satorux1, miket_OOO, Mike West, ramant (doing other things)
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 9