Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_ | |
| 6 #define PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 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" | |
| 17 | |
| 18 // This is a special TestCase whose purpose is *not* to test the correctness of | |
| 19 // the PPAPI's. Instead, this is a simulated Flash plugin, used to place the | |
|
raymes
2014/10/24 00:51:08
nit: PPAPI's->Pepper APIs
miu
2014/10/24 21:20:09
Done.
| |
| 20 // browser window and other UI elements into Flash Fullscreen mode for layout, | |
| 21 // event, focus, etc. testing. See | |
| 22 // chrome/browser/ui/fullscreen/flash_fullscreen_interactive_browsertest.cc. | |
| 23 // | |
| 24 // At start, this simulated Flash plugin will enter fullscreen and paint a green | |
| 25 // color fill. From there, it will respond to mouse clicks or key presses by | |
| 26 // toggling its fill color between red and blue. The browser test reads these | |
| 27 // color changes to detect the desired behavior. | |
| 28 class TestFlashFullscreenForBrowserUI : public TestCase { | |
| 29 public: | |
| 30 explicit TestFlashFullscreenForBrowserUI(TestingInstance* instance); | |
| 31 virtual ~TestFlashFullscreenForBrowserUI(); | |
| 32 | |
| 33 // TestCase implementation. | |
| 34 virtual bool Init() override; | |
| 35 virtual void RunTests(const std::string& filter) override; | |
| 36 virtual void DidChangeView(const pp::View& view) override; | |
| 37 virtual bool HandleInputEvent(const pp::InputEvent& event) override; | |
| 38 | |
| 39 private: | |
| 40 std::string TestEnterFullscreen(); | |
| 41 void Paint(int32_t last_compositor_result); | |
| 42 | |
| 43 pp::FlashFullscreen screen_mode_; | |
| 44 NestedEvent view_change_event_; | |
| 45 | |
| 46 pp::Compositor compositor_; | |
| 47 pp::Size layer_size_; | |
| 48 pp::CompositorLayer color_layer_; | |
| 49 | |
| 50 int num_trigger_events_; | |
| 51 | |
| 52 pp::CompletionCallbackFactory<TestFlashFullscreenForBrowserUI> | |
| 53 callback_factory_; | |
| 54 }; | |
| 55 | |
| 56 #endif // PPAPI_TESTS_TEST_FLASH_FULLSCREEN_FOR_BROWSER_UI_H_ | |
| OLD | NEW |