chromium/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module mojo.test;

struct TestWTFCodeGeneration {
  string str;
  string? nullable_str;
  array<string> strs;
  array<string?> nullable_strs;
  array<array<int32>> arrays;
  array<bool> bools;
  array<handle<message_pipe>> handles;
  map<string, string?> str_map;
  map<int32, array<int32>> array_map;
  map<int32, handle<message_pipe>> handle_map;
  array<map<string, string?>> str_maps;
};

union TestWTFCodeGeneration2 {
  string str;
  array<string> strs;
  map<string, string?> str_map;
};

struct TestWTFStruct {
  enum NestedEnum {
    E0,
    E1,
  };
  string str;
  int32 integer;
};

struct TestWTFStructWrapper {
  TestWTFStruct nested_struct;
  array<TestWTFStruct> array_struct;
  map<TestWTFStruct, TestWTFStruct> map_struct;
};

interface TestWTF {
  enum NestedEnum {
    E0,
    E1,
  };
  EchoString(string? str) => (string? str);
  EchoStringArray(array<string?>? arr) => (array<string?>? arr);
  EchoStringMap(map<string, string?>? str_map)
      => (map<string, string?>? str_map);
};

enum TopLevelEnum {
  E0,
  E1,
};