chromium/mojo/public/cpp/bindings/tests/default_construct_unittest.cc

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

#include <utility>

#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/default_construct_unittest.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace mojo::test::default_construct {

class TestInterface : public mojom::TestInterface {};

class DefaultConstructTest : public ::testing::Test {};

TEST_F(DefaultConstructTest, Echo) {}

TEST_F(DefaultConstructTest, Map) {}

TEST_F(DefaultConstructTest, Array) {}

TEST_F(DefaultConstructTest, FixedArray) {}

// Ensures that a non-typemapped type with a field typemapped to a type without
// a public default constructor initializes that field using
// `mojo::internal::DefaultConstructTraits::Create()` (crbug.com/1385587). Note
// that the generated Mojo code wouldn't even compile without the accompanying
// fix, so this test just covers the runtime behavior.
TEST_F(DefaultConstructTest, TypeWithPrivatelyDefaultConstructibleField) {}

TEST(DefaultConstructOptionalTest, InitializedToNullopt) {}

}  // namespace mojo::test::default_construct