// Copyright 2026 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This is a very simple mojom file meant for testing our rust mojom bindings. // It is not intended to be a thoughough test of mojom itself; it just exists // so that we have some messages we can send to test remotes/receivers with. module bindings_unittests.mojom; struct TwoInts { uint8 a; uint16 b; }; interface MathService { Add(uint32 a, uint32 b) => (uint32 ret); // So many different sizes! I guess we don't have to worry about overflow. AddTwoInts(TwoInts ns) => (uint32 ret); }; interface HandleService { // Sends three message pipe handles and one untyped handle. PassHandles(handle h1, handle h2, handle h3, handle h4); }; struct TypemappedStruct { int32 a; }; interface TypemapService { Echo(TypemappedStruct s) => (TypemappedStruct s); }; interface AssociatedSender { // Sends one end of a pipe to be held (and bound) by the receiver SendRemote(pending_associated_remote remote); SendReceiver(pending_associated_receiver receiver); // Requests that the receiver create a pipe, hold/bind one end, and send the other to us RequestRemote() => (pending_associated_remote remote); RequestReceiver() => (pending_associated_receiver receiver); ClearActiveEndpoints(); };