New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 808157 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Refactor ServiceDiscoveryDeviceLister to make it mockable in testing

Project Member Reported by justincarlson@chromium.org, Feb 1 2018

Issue description

Split ServiceDiscoveryDeviceLister into an interface and independent implementation, to make it mockable/fakeable for testing.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b20a43419792c22999993ea01fca4b8fce468ab1

commit b20a43419792c22999993ea01fca4b8fce468ab1
Author: Justin Carlson <justincarlson@chromium.org>
Date: Fri Feb 02 21:02:16 2018

Refactor ServiceDiscoveryDeviceLister.

This change does two things.  First, it splits out the implementation
of ServiceDiscoveryDeviceLister from the interface, which will allow
users of the API to mock/fake it for testing.

Second, it adds a service_type parameter to
ServiceDiscoveryDeviceLister::Delegate::OnDeviceCacheFlushed.  This
allows users of the class that want to manage multiple service types
with a single Delegate to disambiguate which service is being flushed.
The other Delegate functions already pass in the service description
so don't need any additional information for this use.

Also fixup callsites for all users of this API.

Bug:  808157 
Change-Id: I9cf4b23692f54c66e0224e06df1769f750f846b3
Reviewed-on: https://chromium-review.googlesource.com/898184
Commit-Queue: Justin Carlson <justincarlson@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Gene Gutnik <gene@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Sean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534146}
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/chromeos/printing/zeroconf_printer_detector.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/devtools/device/cast_device_provider.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/devtools/device/cast_device_provider.h
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/devtools/device/cast_device_provider_unittest.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/local_discovery/service_discovery_device_lister.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/local_discovery/service_discovery_device_lister.h
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/printing/cloud_print/privet_device_lister_impl.cc
[modify] https://crrev.com/b20a43419792c22999993ea01fca4b8fce468ab1/chrome/browser/printing/cloud_print/privet_device_lister_impl.h

Status: Fixed (was: Assigned)

Sign in to add a comment