1 // Copyright (c) 2012 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.
5 #ifndef PAPPI_TESTS_TEST_FULLSCREEN_H_
6 #define PAPPI_TESTS_TEST_FULLSCREEN_H_
10 #include "ppapi/cpp/fullscreen.h"
11 #include "ppapi/cpp/graphics_2d.h"
12 #include "ppapi/cpp/rect.h"
13 #include "ppapi/cpp/size.h"
14 #include "ppapi/tests/test_case.h"
15 #include "ppapi/tests/test_utils.h"
21 struct ColorPremul
{ uint32_t A
, R
, G
, B
; }; // Use premultipled Alpha.
23 class TestFullscreen
: public TestCase
{
25 explicit TestFullscreen(TestingInstance
* instance
);
27 // TestCase implementation.
29 virtual void RunTests(const std::string
& filter
);
30 virtual bool HandleInputEvent(const pp::InputEvent
& event
);
31 virtual void DidChangeView(const pp::View
& view
);
33 void CheckPluginPaint();
36 std::string
TestGetScreenSize();
37 std::string
TestNormalToFullscreenToNormal();
39 void SimulateUserGesture();
40 void FailFullscreenTest(const std::string
& error
);
41 void FailNormalTest(const std::string
& error
);
42 void PassFullscreenTest();
43 void PassNormalTest();
44 bool PaintPlugin(pp::Size size
, ColorPremul color
);
51 pp::Fullscreen screen_mode_
;
52 pp::Size screen_size_
;
53 pp::Rect normal_position_
;
54 pp::Size painted_size_
;
55 uint32_t painted_color_
;
57 bool fullscreen_pending_
;
59 pp::Graphics2D graphics2d_
;
61 NestedEvent fullscreen_event_
;
62 NestedEvent normal_event_
;
65 #endif // PAPPI_TESTS_TEST_FULLSCREEN_H_