• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PAPPI_TESTS_TEST_COMPOSITOR_H_
6 #define PAPPI_TESTS_TEST_COMPOSITOR_H_
7 
8 #include <set>
9 #include <string>
10 
11 #include "ppapi/cpp/compositor.h"
12 #include "ppapi/cpp/compositor_layer.h"
13 #include "ppapi/cpp/graphics_3d.h"
14 #include "ppapi/lib/gl/include/GLES2/gl2.h"
15 #include "ppapi/tests/test_case.h"
16 
17 class TestCompositor : public TestCase {
18  public:
TestCompositor(TestingInstance * instance)19   TestCompositor(TestingInstance* instance) : TestCase(instance) {}
20 
21   // TestCase implementation.
22   virtual bool Init();
23   virtual void RunTests(const std::string& filter);
24 
25  private:
26   // Various tests.
27   std::string TestRelease();
28   std::string TestReleaseWithoutCommit();
29   std::string TestCommitTwoTimesWithoutChange();
30   std::string TestGeneral();
31 
32   std::string TestReleaseUnbound();
33   std::string TestReleaseWithoutCommitUnbound();
34   std::string TestCommitTwoTimesWithoutChangeUnbound();
35   std::string TestGeneralUnbound();
36 
37   std::string TestBindUnbind();
38 
39   std::string TestReleaseInternal(bool bind);
40   std::string TestReleaseWithoutCommitInternal(bool bind);
41   std::string TestCommitTwoTimesWithoutChangeInternal(bool bind);
42   std::string TestGeneralInternal(bool bind);
43 
44   // Helper functions
45   std::string CreateTexture(uint32_t* texture);
46   std::string ReleaseTexture(uint32_t texture);
47   std::string CreateImage(pp::ImageData* image);
48   std::string SetColorLayer(pp::CompositorLayer layer, int32_t result);
49 
50 };
51 
52 #endif  // PAPPI_TESTS_TEST_COMPOSItor_H_
53