#include <utility>
#include "base/memory/platform_shared_memory_handle.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "skia/ext/skcolorspace_primaries.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/gfx/hdr_metadata.h"
#include "ui/gfx/mojom/accelerated_widget_mojom_traits.h"
#include "ui/gfx/mojom/buffer_types_mojom_traits.h"
#include "ui/gfx/mojom/hdr_metadata.mojom.h"
#include "ui/gfx/mojom/hdr_metadata_mojom_traits.h"
#include "ui/gfx/mojom/presentation_feedback.mojom.h"
#include "ui/gfx/mojom/presentation_feedback_mojom_traits.h"
#include "ui/gfx/mojom/traits_test_service.mojom.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/selection_bound.h"
#if BUILDFLAG(IS_FUCHSIA)
#include "base/fuchsia/koid.h"
#endif
namespace gfx {
namespace {
gfx::AcceleratedWidget CastToAcceleratedWidget(int i) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
base::ScopedFD CreateValidLookingBufferHandle() { … }
#elif BUILDFLAG(IS_FUCHSIA)
zx::vmo CreateValidLookingBufferHandle() {
return base::UnsafeSharedMemoryRegion::TakeHandleForSerialization(
base::UnsafeSharedMemoryRegion::Create(1024))
.PassPlatformHandle();
}
#endif
class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { … };
}
TEST_F(StructTraitsTest, SelectionBound) { … }
TEST_F(StructTraitsTest, Transform) { … }
TEST_F(StructTraitsTest, AcceleratedWidget) { … }
TEST_F(StructTraitsTest, GpuMemoryBufferHandle) { … }
TEST_F(StructTraitsTest, NullGpuMemoryBufferHandle) { … }
TEST_F(StructTraitsTest, BufferFormat) { … }
TEST_F(StructTraitsTest, BufferUsage) { … }
TEST_F(StructTraitsTest, PresentationFeedback) { … }
TEST_F(StructTraitsTest, RRectF) { … }
TEST_F(StructTraitsTest, HDRMetadata) { … }
}