#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <iomanip>
#include <ostream>
#include <string>
#include <utility>
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
template <>
struct TypeConverter<int32_t, sample::BarPtr> { … };
}
namespace sample {
namespace {
bool g_dump_message_as_hex = …;
bool g_dump_message_as_text = …;
FooPtr MakeFoo() { … }
void CheckFoo(const Foo& foo) { … }
void PrintSpacer(int depth) { … }
void Print(int depth, const char* name, bool value) { … }
void Print(int depth, const char* name, int32_t value) { … }
void Print(int depth, const char* name, uint8_t value) { … }
template <typename H>
void Print(int depth,
const char* name,
const mojo::ScopedHandleBase<H>& value) { … }
void Print(int depth, const char* name, const std::string& str) { … }
void Print(int depth, const char* name, const BarPtr& bar) { … }
template <typename T>
void Print(int depth, const char* name, const std::vector<T>& array) { … }
template <typename T>
void Print(int depth,
const char* name,
const std::optional<std::vector<T>>& array) { … }
void Print(int depth, const char* name, const FooPtr& foo) { … }
void DumpHex(const uint8_t* bytes, size_t num_bytes) { … }
class ServiceImpl : public Service { … };
class ServiceProxyImpl : public ServiceProxy { … };
class SimpleMessageReceiver : public mojo::MessageReceiverWithResponder { … };
BindingsSampleTest;
TEST_P(BindingsSampleTest, Basic) { … }
TEST_P(BindingsSampleTest, DefaultValues) { … }
INSTANTIATE_MOJO_BINDINGS_TEST_SUITE_P(…);
}
}