diff options
author | btolsch <btolsch@chromium.org> | 2020-02-26 15:50:20 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-27 00:39:26 +0000 |
commit | 9931e7a88ec31d7ffe83d829d00ddae55ea109d3 (patch) | |
tree | b8c3eca414bf299ce80dc42376fb63f54800cbec /cast/sender/testing/test_helpers.h | |
parent | 8cb56963d0742d6422b130895f2e9768f0808e54 (diff) | |
download | openscreen-9931e7a88ec31d7ffe83d829d00ddae55ea109d3.tar.gz |
Add CastPlatformClient for handling sender requests
This change adds a new class for handling request/response sequences
initiated by a Cast sender. It will initially be used for app
availability requests and is modelled after Chrome's CastMessageHandler.
Bug: openscreen:60
Change-Id: Iba5ae0ee343e23a2c0214b5b17a2b59dca2cbe99
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2044149
Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Diffstat (limited to 'cast/sender/testing/test_helpers.h')
-rw-r--r-- | cast/sender/testing/test_helpers.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cast/sender/testing/test_helpers.h b/cast/sender/testing/test_helpers.h new file mode 100644 index 00000000..c9a68c20 --- /dev/null +++ b/cast/sender/testing/test_helpers.h @@ -0,0 +1,43 @@ +// Copyright 2020 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 CAST_SENDER_TESTING_TEST_HELPERS_H_ +#define CAST_SENDER_TESTING_TEST_HELPERS_H_ + +#include <cstdint> +#include <string> + +#include "cast/sender/channel/message_util.h" + +namespace cast { +namespace channel { +class CastMessage; +} // namespace channel +} // namespace cast + +namespace openscreen { +namespace cast { + +void VerifyAppAvailabilityRequest(const ::cast::channel::CastMessage& message, + const std::string& expected_app_id, + int* request_id_out, + std::string* sender_id_out); +void VerifyAppAvailabilityRequest(const ::cast::channel::CastMessage& message, + std::string* app_id_out, + int* request_id_out, + std::string* sender_id_out); + +::cast::channel::CastMessage CreateAppAvailableResponseChecked( + int request_id, + const std::string& sender_id, + const std::string& app_id); +::cast::channel::CastMessage CreateAppUnavailableResponseChecked( + int request_id, + const std::string& sender_id, + const std::string& app_id); + +} // namespace cast +} // namespace openscreen + +#endif // CAST_SENDER_TESTING_TEST_HELPERS_H_ |