From 65e39b7046a29aa299f06285441b62bcf1e4df01 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 7 Aug 2019 22:45:47 +0200 Subject: Move v8/build into this repository. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we need to patch some files, we don't let depot_tools manage these files anymore. build.git commit a0b2e3b2708bcf81ec00ac1738b586bcc5e04eea --- deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl | 142 ++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl (limited to 'deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl') diff --git a/deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl b/deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl new file mode 100644 index 0000000000..18770650fb --- /dev/null +++ b/deps/v8/build/fuchsia/fidlgen_js/test/simple.fidl @@ -0,0 +1,142 @@ +// Copyright 2018 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. + +library fidljstest; + +enum Blorp : int8 { + ALPHA = 1; + BETA = 2; + GAMMA = 0x48; +}; + +// A struct of basic types, some with defaults and some without to test various +// paths of the generator. +struct BasicStruct { + bool b; + int8 i8; + int16 i16 = 18; + int32 i32; + uint8 u8; + uint16 u16; + uint32 u32 = 4000000000; +}; + +const uint64 ARRRR_SIZE = 32; + +struct StuffAndThings { + int32 count; + string id; + vector a_vector; + BasicStruct basic; + string later_string; + array:ARRRR_SIZE arrrr; + vector? nullable_vector_of_string0; + vector? nullable_vector_of_string1; + vector vector_of_blorp; +}; + +struct StructWithBool { + bool some_bool = false; +}; + +struct StructWithUint { + uint32 num; +}; + +struct LargerStructWithArray { + array:32 components; +}; + +union UnionOfStructs { + StructWithBool swb; + StructWithUint swu; + LargerStructWithArray lswa; +}; + +struct StructOfMultipleUnions { + UnionOfStructs initial; + UnionOfStructs? optional; + UnionOfStructs trailing; +}; + +const int64 NO_TIMESTAMP = 0x7fffffffffffffff; +const int64 ANOTHER_COPY = NO_TIMESTAMP; +const string SOME_STRING = "a 你好 thing\" containing ' quotes"; + +struct VariousDefaults { + Blorp blorp_defaulting_to_beta = BETA; + int64 int64_defaulting_to_no_timestamp = NO_TIMESTAMP; + int64 int64_defaulting_to_const = 0x7fffffffffffff11; + string string_with_default = "stuff"; +}; + +struct VectorsOfPrimitives { + vector v_bool; + vector v_uint8; + vector v_uint16; + vector v_uint32; + vector v_uint64; + vector v_int8; + vector v_int16; + vector v_int32; + vector v_int64; + vector v_float32; + vector v_float64; +}; + +struct VectorOfHandleToVMO { + vector> vmos; +}; + +// This is a compile-only test for gen.py to ensure that the size of +// AfterPreviousReference is available before the vector +// is compiled in this struct. +struct LaterReference { + vector? later; +}; + +struct AfterPreviousReference { + int32 an_int; +}; + +protocol AnotherInterface { + TimesTwo(int32 a) -> (int32 b); +}; + +protocol Testola { + DoSomething(); + + PrintInt(int32 num); + + PrintMsg(string msg); + + VariousArgs(Blorp blorp, string:32 msg, vector stuff); + + WithResponse(int32 a, int32 b) -> (int32 sum); + + SendAStruct(BasicStruct basic); + + NestedStructsWithResponse(BasicStruct basic) -> (StuffAndThings resp); + + PassHandles(handle job) -> (handle process); + + ReceiveUnions(StructOfMultipleUnions somu); + + SendUnions() -> (StructOfMultipleUnions somu); + + SendVectorsOfString(vector unsized, + vector nullable, + vector max_strlen); + + VectorOfStruct(vector stuff) + -> (vector result); + + PassVectorOfPrimitives(VectorsOfPrimitives input) + -> (VectorsOfPrimitives output); + + PassVectorOfVMO(VectorOfHandleToVMO input) + -> (VectorOfHandleToVMO output); + + GetAnother(request another); +}; -- cgit v1.2.3