summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_compositor.h
blob: 6287e6dcd97c1aa5d25f5c9e138fd57d65e15709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2014 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.

#ifndef PAPPI_TESTS_TEST_COMPOSITOR_H_
#define PAPPI_TESTS_TEST_COMPOSITOR_H_

#include <set>
#include <string>

#include "ppapi/cpp/compositor.h"
#include "ppapi/cpp/compositor_layer.h"
#include "ppapi/cpp/graphics_3d.h"
#include "ppapi/lib/gl/include/GLES2/gl2.h"
#include "ppapi/tests/test_case.h"

class TestCompositor : public TestCase {
 public:
  TestCompositor(TestingInstance* instance) : TestCase(instance) {}

  // TestCase implementation.
  virtual bool Init();
  virtual void RunTests(const std::string& filter);

 private:
  // Various tests.
  std::string TestRelease();
  std::string TestReleaseWithoutCommit();
  std::string TestCommitTwoTimesWithoutChange();
  std::string TestGeneral();

  std::string TestReleaseUnbound();
  std::string TestReleaseWithoutCommitUnbound();
  std::string TestCommitTwoTimesWithoutChangeUnbound();
  std::string TestGeneralUnbound();

  std::string TestBindUnbind();

  std::string TestReleaseInternal(bool bind);
  std::string TestReleaseWithoutCommitInternal(bool bind);
  std::string TestCommitTwoTimesWithoutChangeInternal(bool bind);
  std::string TestGeneralInternal(bool bind);

  // Helper functions
  std::string CreateTexture(uint32_t* texture);
  std::string ReleaseTexture(uint32_t texture);
  std::string CreateImage(pp::ImageData* image);
  std::string SetColorLayer(pp::CompositorLayer layer, int32_t result);

};

#endif  // PAPPI_TESTS_TEST_COMPOSItor_H_