| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 | 923 |
| 924 // The precise amount of scroll for the first view position update is not | 924 // The precise amount of scroll for the first view position update is not |
| 925 // deterministic, so this simply verifies that the OOPIF moved from its | 925 // deterministic, so this simply verifies that the OOPIF moved from its |
| 926 // earlier position. | 926 // earlier position. |
| 927 gfx::Rect update_rect = filter->last_rect(); | 927 gfx::Rect update_rect = filter->last_rect(); |
| 928 EXPECT_LT(update_rect.y(), bounds.y() - rwhv_root->GetViewBounds().y()); | 928 EXPECT_LT(update_rect.y(), bounds.y() - rwhv_root->GetViewBounds().y()); |
| 929 } | 929 } |
| 930 | 930 |
| 931 // Test that scrolling a nested out-of-process iframe bubbles unused scroll | 931 // Test that scrolling a nested out-of-process iframe bubbles unused scroll |
| 932 // delta to a parent frame. | 932 // delta to a parent frame. |
| 933 #if defined(OS_ANDROID) |
| 933 // Browser process hit testing is not implemented on Android. | 934 // Browser process hit testing is not implemented on Android. |
| 934 // https://crbug.com/491334 | 935 // https://crbug.com/491334 |
| 935 // Flaky https://crbug.com/627238. | 936 #define MAYBE_ScrollBubblingFromOOPIFTest DISABLED_ScrollBubblingFromOOPIFTest |
| 937 #else |
| 938 #define MAYBE_ScrollBubblingFromOOPIFTest ScrollBubblingFromOOPIFTest |
| 939 #endif |
| 936 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 940 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| 937 DISABLED_ScrollBubblingFromOOPIFTest) { | 941 MAYBE_ScrollBubblingFromOOPIFTest) { |
| 938 GURL main_url(embedded_test_server()->GetURL( | 942 GURL main_url(embedded_test_server()->GetURL( |
| 939 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 943 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
| 940 NavigateToURL(shell(), main_url); | 944 NavigateToURL(shell(), main_url); |
| 941 | 945 |
| 942 // It is safe to obtain the root frame tree node here, as it doesn't change. | 946 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 943 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 947 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) |
| 944 ->GetFrameTree() | 948 ->GetFrameTree() |
| 945 ->root(); | 949 ->root(); |
| 946 ASSERT_EQ(1U, root->child_count()); | 950 ASSERT_EQ(1U, root->child_count()); |
| 947 | 951 |
| 948 FrameTreeNode* parent_iframe_node = root->child_at(0); | 952 FrameTreeNode* parent_iframe_node = root->child_at(0); |
| 949 | 953 |
| 950 // This test uses the position of the nested iframe within the parent iframe | 954 // This test uses the position of the nested iframe within the parent iframe |
| 951 // to infer the scroll position of the parent. FrameRectChangedMessageFilter | 955 // to infer the scroll position of the parent. FrameRectChangedMessageFilter |
| 952 // catches updates to the position in order to avoid busy waiting. | 956 // catches updates to the position in order to avoid busy waiting. |
| 953 // It gets created early to catch the initial rects from the navigation. | 957 // It gets created early to catch the initial rects from the navigation. |
| 954 scoped_refptr<FrameRectChangedMessageFilter> filter = | 958 scoped_refptr<FrameRectChangedMessageFilter> filter = |
| 955 new FrameRectChangedMessageFilter(); | 959 new FrameRectChangedMessageFilter(); |
| 956 parent_iframe_node->current_frame_host()->GetProcess()->AddFilter( | 960 parent_iframe_node->current_frame_host()->GetProcess()->AddFilter( |
| 957 filter.get()); | 961 filter.get()); |
| 958 | 962 |
| 959 GURL site_url(embedded_test_server()->GetURL( | 963 GURL site_url(embedded_test_server()->GetURL( |
| 960 "b.com", "/frame_tree/page_with_positioned_frame.html")); | 964 "b.com", "/frame_tree/page_with_positioned_frame.html")); |
| 961 NavigateFrameToURL(parent_iframe_node, site_url); | 965 NavigateFrameToURL(parent_iframe_node, site_url); |
| 962 | 966 |
| 963 // Navigate the nested frame to a page large enough to have scrollbars. | 967 // Navigate the nested frame to a page large enough to have scrollbars. |
| 964 FrameTreeNode* nested_iframe_node = parent_iframe_node->child_at(0); | 968 FrameTreeNode* nested_iframe_node = parent_iframe_node->child_at(0); |
| 965 GURL nested_site_url(embedded_test_server()->GetURL( | 969 GURL nested_site_url(embedded_test_server()->GetURL( |
| 966 "baz.com", "/tall_page.html")); | 970 "baz.com", "/tall_page.html")); |
| 967 NavigateFrameToURL(nested_iframe_node, nested_site_url); | 971 NavigateFrameToURL(nested_iframe_node, nested_site_url); |
| 968 | 972 |
| 969 EXPECT_EQ( | 973 EXPECT_EQ( |
| 970 " Site A ------------ proxies for B C\n" | 974 " Site A ------------ proxies for B C\n" |
| 971 " +--Site B ------- proxies for A C\n" | 975 " +--Site B ------- proxies for A C\n" |
| 972 " +--Site C -- proxies for A B\n" | 976 " +--Site C -- proxies for A B\n" |
| 973 "Where A = http://a.com/\n" | 977 "Where A = http://a.com/\n" |
| (...skipping 6528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7502 | 7506 |
| 7503 shell()->web_contents()->WasShown(); | 7507 shell()->web_contents()->WasShown(); |
| 7504 | 7508 |
| 7505 EXPECT_TRUE(ExecuteScriptAndExtractInt( | 7509 EXPECT_TRUE(ExecuteScriptAndExtractInt( |
| 7506 root->child_at(0)->current_frame_host(), | 7510 root->child_at(0)->current_frame_host(), |
| 7507 "window.domAutomationController.send(event_fired);", &event_fired)); | 7511 "window.domAutomationController.send(event_fired);", &event_fired)); |
| 7508 EXPECT_EQ(2, event_fired); | 7512 EXPECT_EQ(2, event_fired); |
| 7509 } | 7513 } |
| 7510 | 7514 |
| 7511 } // namespace content | 7515 } // namespace content |
| OLD | NEW |