chromium/cc/trees/layer_tree_host_unittest_proxy.cc

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

#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/layer_tree_test.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/proxy_impl.h"
#include "cc/trees/proxy_main.h"
#include "cc/trees/single_thread_proxy.h"

namespace cc {

class LayerTreeHostProxyTest : public LayerTreeTest {};

class LayerTreeHostProxyTestSetNeedsCommit : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestSetNeedsCommit);

class LayerTreeHostProxyTestSetNeedsAnimate : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestSetNeedsAnimate);

class LayerTreeHostProxyTestSetNeedsUpdateLayers
    : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestSetNeedsUpdateLayers);

class LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating
    : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating);

class LayerTreeHostProxyTestSetNeedsCommitWhileAnimating
    : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestSetNeedsCommitWhileAnimating);

class LayerTreeHostProxyTestCommitWaitsForActivation
    : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestCommitWaitsForActivation);

// Test for a corner case of main frame before activation (MFBA) and commit
// waits for activation. If a commit (with wait for activation flag set)
// is ready before the activation for a previous commit then the activation
// should not signal the completion event of the second commit.
class LayerTreeHostProxyTestCommitWaitsForActivationMFBA
    : public LayerTreeHostProxyTest {};

MULTI_THREAD_TEST_F(LayerTreeHostProxyTestCommitWaitsForActivationMFBA);

// Tests that SingleThreadProxy correctly reports pending animations when
// requested from the impl-side.
class LayerTreeHostProxyTestImplFrameCausesAnimatePending
    : public LayerTreeHostProxyTest {};

SINGLE_THREAD_TEST_F(LayerTreeHostProxyTestImplFrameCausesAnimatePending);

// Test that the SingleThreadProxy correctly records and clears commit requests
// from the impl-side.
class LayerTreeHostProxyTestNeedsCommitFromImpl
    : public LayerTreeHostProxyTest {};

SINGLE_THREAD_TEST_F(LayerTreeHostProxyTestNeedsCommitFromImpl);

// Test that a commit is correctly delayed but is not lost when turning
// invisible, and after turning visible, the commit is executed.
// This is a regression test for https://crbug.com/890008
class LayerTreeHostProxyTestDelayedCommitDueToVisibility
    : public LayerTreeHostProxyTest {};

SINGLE_AND_MULTI_THREAD_TEST_F(
    LayerTreeHostProxyTestDelayedCommitDueToVisibility);

}  // namespace cc