Android: Remove unneeded Compositor::SetNeedsRedraw()
[chromium-blink-merge.git] / ppapi / tests / test_fullscreen.h
blobbfe2e27ac7f3b9589b62b6a4e20a4486322df7e1
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_
8 #include <string>
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"
17 namespace pp {
18 class InputEvent;
19 } // namespace pp
21 struct ColorPremul { uint32_t A, R, G, B; }; // Use premultipled Alpha.
23 class TestFullscreen : public TestCase {
24 public:
25 explicit TestFullscreen(TestingInstance* instance);
27 // TestCase implementation.
28 virtual bool Init();
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();
35 private:
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);
46 bool GotError();
47 std::string Error();
49 std::string error_;
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_;
58 bool normal_pending_;
59 pp::Graphics2D graphics2d_;
61 NestedEvent fullscreen_event_;
62 NestedEvent normal_event_;
65 #endif // PAPPI_TESTS_TEST_FULLSCREEN_H_