OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 // A BrowserTest that opens a test page that launches a simulated fullscreen | 50 // A BrowserTest that opens a test page that launches a simulated fullscreen |
51 // Flash plugin. The plugin responds to mouse clicks and key presses by | 51 // Flash plugin. The plugin responds to mouse clicks and key presses by |
52 // changing color. Once launched, the browser UI can be tested to confirm the | 52 // changing color. Once launched, the browser UI can be tested to confirm the |
53 // desired interactive behaviors. | 53 // desired interactive behaviors. |
54 class FlashFullscreenInteractiveBrowserTest : public OutOfProcessPPAPITest { | 54 class FlashFullscreenInteractiveBrowserTest : public OutOfProcessPPAPITest { |
55 public: | 55 public: |
56 FlashFullscreenInteractiveBrowserTest() {} | 56 FlashFullscreenInteractiveBrowserTest() {} |
57 virtual ~FlashFullscreenInteractiveBrowserTest() {} | 57 ~FlashFullscreenInteractiveBrowserTest() override {} |
58 | 58 |
59 protected: | 59 protected: |
60 content::WebContents* GetActiveWebContents() const { | 60 content::WebContents* GetActiveWebContents() const { |
61 return browser()->tab_strip_model()->GetActiveWebContents(); | 61 return browser()->tab_strip_model()->GetActiveWebContents(); |
62 } | 62 } |
63 | 63 |
64 // A simple way to convince libcontent and the browser UI that a tab is being | 64 // A simple way to convince libcontent and the browser UI that a tab is being |
65 // screen captured. During tab capture, Flash fullscreen remains embedded | 65 // screen captured. During tab capture, Flash fullscreen remains embedded |
66 // within the tab content area of a non-fullscreened browser window. | 66 // within the tab content area of a non-fullscreened browser window. |
67 void StartFakingTabCapture() { | 67 void StartFakingTabCapture() { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorRED)); | 339 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorRED)); |
340 PressSpacebar(); | 340 PressSpacebar(); |
341 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorBLUE)); | 341 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorBLUE)); |
342 | 342 |
343 // Test that the Escape key is handled as an exit fullscreen command while the | 343 // Test that the Escape key is handled as an exit fullscreen command while the |
344 // Flash widget has the focus. | 344 // Flash widget has the focus. |
345 EXPECT_TRUE(ObserveFlashHasFocus(first_tab_contents, true)); | 345 EXPECT_TRUE(ObserveFlashHasFocus(first_tab_contents, true)); |
346 PressEscape(); | 346 PressEscape(); |
347 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); | 347 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); |
348 } | 348 } |
OLD | NEW |