OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" | 9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 } // namespace | 381 } // namespace |
382 | 382 |
383 // Check that an element in a cross-process subframe can enter and exit | 383 // Check that an element in a cross-process subframe can enter and exit |
384 // fullscreen. The test will verify that: | 384 // fullscreen. The test will verify that: |
385 // - the subframe is properly resized | 385 // - the subframe is properly resized |
386 // - the WebContents properly enters/exits fullscreen. | 386 // - the WebContents properly enters/exits fullscreen. |
387 // - document.webkitFullscreenElement is correctly updated in both frames. | 387 // - document.webkitFullscreenElement is correctly updated in both frames. |
388 // - fullscreenchange events fire in both frames. | 388 // - fullscreenchange events fire in both frames. |
389 // - fullscreen CSS is applied correctly in both frames. | 389 // - fullscreen CSS is applied correctly in both frames. |
| 390 // |
| 391 // Flaky on Windows: https://crbug.com/647311 |
| 392 #if defined(OS_WIN) |
| 393 #define MAYBE_FullscreenElementInSubframe DISABLED_FullscreenElementInSubframe |
| 394 #else |
| 395 #define MAYBE_FullscreenElementInSubframe FullscreenElementInSubframe |
| 396 #endif |
390 IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, | 397 IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, |
391 FullscreenElementInSubframe) { | 398 MAYBE_FullscreenElementInSubframe) { |
392 // Start on a page with one subframe (id "child-0") that has | 399 // Start on a page with one subframe (id "child-0") that has |
393 // "allowfullscreen" enabled. | 400 // "allowfullscreen" enabled. |
394 GURL main_url(embedded_test_server()->GetURL( | 401 GURL main_url(embedded_test_server()->GetURL( |
395 "a.com", "/page_with_allowfullscreen_frame.html")); | 402 "a.com", "/page_with_allowfullscreen_frame.html")); |
396 ui_test_utils::NavigateToURL(browser(), main_url); | 403 ui_test_utils::NavigateToURL(browser(), main_url); |
397 content::WebContents* web_contents = | 404 content::WebContents* web_contents = |
398 browser()->tab_strip_model()->GetActiveWebContents(); | 405 browser()->tab_strip_model()->GetActiveWebContents(); |
399 | 406 |
400 // Navigate the subframe cross-site to a page with a fullscreenable <div>. | 407 // Navigate the subframe cross-site to a page with a fullscreenable <div>. |
401 GURL frame_url( | 408 GURL frame_url( |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 "document.pointerLockElement)", | 770 "document.pointerLockElement)", |
764 &mouse_locked)); | 771 &mouse_locked)); |
765 EXPECT_TRUE(mouse_locked); | 772 EXPECT_TRUE(mouse_locked); |
766 EXPECT_TRUE(main_frame->GetView()->IsMouseLocked()); | 773 EXPECT_TRUE(main_frame->GetView()->IsMouseLocked()); |
767 | 774 |
768 EXPECT_TRUE(ExecuteScript(main_frame, | 775 EXPECT_TRUE(ExecuteScript(main_frame, |
769 "document.querySelector('iframe').parentNode." | 776 "document.querySelector('iframe').parentNode." |
770 "removeChild(document.querySelector('iframe'))")); | 777 "removeChild(document.querySelector('iframe'))")); |
771 EXPECT_FALSE(main_frame->GetView()->IsMouseLocked()); | 778 EXPECT_FALSE(main_frame->GetView()->IsMouseLocked()); |
772 } | 779 } |
OLD | NEW |