aboutsummaryrefslogtreecommitdiff
path: root/cast/common
diff options
context:
space:
mode:
authorRyan Keane <rwkeane@google.com>2020-06-18 21:44:26 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-19 05:32:00 +0000
commitdd945dd1c033e9d46b4fa0616cd7413d65e320eb (patch)
tree0372da3e29bc26f7b3a70cfa0ddba22a6a21feae /cast/common
parent1bc307d92b9d79958deeab2a9ea55344f88d4a9e (diff)
downloadopenscreen-dd945dd1c033e9d46b4fa0616cd7413d65e320eb.tar.gz
Discovery: Add support for non-cyclic SRV pointers
This CL implements the swap from dns_data to dns_data_graph, as added in CL: https://chromium-review.googlesource.com/c/openscreen/+/2223690 After the completion of this CL, support for Address records with domain different from that of the SRV record pointing to them will be supported. See documentation at the top of dns_data_graph.h for further details about this hierarchy. NOTE: After this change, the querier will maintain support for multiple address and SRV records as called out in b/158533685 and b/158532090. Bug: b/157683753 Change-Id: I898cb9b98e4808ce7b49e616d42922f29dcfe73a Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2246313 Commit-Queue: Ryan Keane <rwkeane@google.com> Reviewed-by: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast/common')
-rw-r--r--cast/common/discovery/e2e_test/tests.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/cast/common/discovery/e2e_test/tests.cc b/cast/common/discovery/e2e_test/tests.cc
index 90f5f824..e05d7eb8 100644
--- a/cast/common/discovery/e2e_test/tests.cc
+++ b/cast/common/discovery/e2e_test/tests.cc
@@ -26,6 +26,9 @@ namespace openscreen {
namespace cast {
namespace {
+// Maximum amount of time needed for a query to be received.
+constexpr seconds kMaxQueryDuration{3};
+
// Total wait time = 4 seconds.
constexpr milliseconds kWaitLoopSleepTime(500);
constexpr int kMaxWaitLoopIterations = 8;
@@ -251,6 +254,9 @@ class DiscoveryE2ETest : public testing::Test {
});
}
+ // TODO(issuetracker.google.com/159256503): Change this to use a polling
+ // method to wait until the service disappears rather than immediately failing
+ // if it exists, so waits throughout this file can be removed.
void CheckNotPublishedService(ServiceInfo service_info,
std::atomic_bool* has_been_seen) {
OSP_DCHECK(dnssd_service_.get());
@@ -497,8 +503,9 @@ TEST_F(DiscoveryE2ETest, ValidateRecordsOnlyReceivedWhenQueryRunning) {
CheckNotPublishedService(instance, &found);
WaitUntilSeen(false, &found);
- // Restart discovery and ensure that only the updated record is returned.
StartDiscovery();
+ std::this_thread::sleep_for(kMaxQueryDuration);
+
OSP_LOG << "Service discovery in progress...";
found = false;
CheckNotPublishedService(updated_instance, &found);
@@ -523,7 +530,6 @@ TEST_F(DiscoveryE2ETest, ValidateRefreshFlow) {
auto discovery_config = GetConfigSettings();
discovery_config.new_record_announcement_count = 0;
discovery_config.new_query_announcement_count = 2;
- constexpr seconds kMaxQueryDuration{3};
SetUpService(discovery_config);
auto instance = GetInfo(1);