[PresentationAPI] Update PresentationDispatcher to use availability URL.
[chromium-blink-merge.git] / ppapi / tests / test_flash_fullscreen_for_browser_ui.h
blob0ae374178e84aed9efaeb69f3b0a1b1c1bd4ac0f
1 // Copyright 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.
5 #ifndef PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_
6 #define PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_
8 #include <string>
10 #include "ppapi/cpp/compositor.h"
11 #include "ppapi/cpp/compositor_layer.h"
12 #include "ppapi/cpp/private/flash_fullscreen.h"
13 #include "ppapi/cpp/size.h"
14 #include "ppapi/tests/test_case.h"
15 #include "ppapi/tests/test_utils.h"
16 #include "ppapi/utility/completion_callback_factory.h"
18 // This is a special TestCase whose purpose is *not* to test the correctness of
19 // the Pepper APIs. Instead, this is a simulated Flash plugin, used to place
20 // the browser window and other UI elements into Flash Fullscreen mode for
21 // layout, event, focus, etc. testing. See
22 // chrome/browser/ui/exclusive_access/
23 // flash_fullscreen_interactive_browsertest.cc.
25 // At start, this simulated Flash plugin will enter fullscreen and paint a green
26 // color fill. From there, it will respond to mouse clicks or key presses by
27 // toggling its fill color between red and blue. The browser test reads these
28 // color changes to detect the desired behavior.
29 class TestFlashFullscreenForBrowserUI : public TestCase {
30 public:
31 explicit TestFlashFullscreenForBrowserUI(TestingInstance* instance);
32 ~TestFlashFullscreenForBrowserUI() override;
34 // TestCase implementation.
35 bool Init() override;
36 void RunTests(const std::string& filter) override;
37 void DidChangeView(const pp::View& view) override;
38 bool HandleInputEvent(const pp::InputEvent& event) override;
40 private:
41 std::string TestEnterFullscreen();
42 void Paint(int32_t last_compositor_result);
44 pp::FlashFullscreen screen_mode_;
45 NestedEvent view_change_event_;
47 pp::Compositor compositor_;
48 pp::Size layer_size_;
49 pp::CompositorLayer color_layer_;
51 int num_trigger_events_;
53 pp::CompletionCallbackFactory<TestFlashFullscreenForBrowserUI>
54 callback_factory_;
57 #endif // PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_