| 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 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2959 navigation_observer.Wait(); | 2959 navigation_observer.Wait(); |
| 2960 EXPECT_TRUE(observer.last_navigation_succeeded()); | 2960 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 2961 EXPECT_EQ(cross_site_url, observer.last_navigation_url()); | 2961 EXPECT_EQ(cross_site_url, observer.last_navigation_url()); |
| 2962 EXPECT_EQ(0U, child->child_count()); | 2962 EXPECT_EQ(0U, child->child_count()); |
| 2963 } | 2963 } |
| 2964 } | 2964 } |
| 2965 | 2965 |
| 2966 // Verify that "scrolling" property on frame elements propagates to child frames | 2966 // Verify that "scrolling" property on frame elements propagates to child frames |
| 2967 // correctly. | 2967 // correctly. |
| 2968 // Does not work on android since android has scrollbars overlayed. | 2968 // Does not work on android since android has scrollbars overlayed. |
| 2969 #if defined(OS_ANDROID) | 2969 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 2970 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 2970 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ |
| 2971 DISABLED_FrameOwnerPropertiesPropagationScrolling | 2971 DISABLED_FrameOwnerPropertiesPropagationScrolling |
| 2972 #else | 2972 #else |
| 2973 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 2973 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ |
| 2974 FrameOwnerPropertiesPropagationScrolling | 2974 FrameOwnerPropertiesPropagationScrolling |
| 2975 #endif | 2975 #endif |
| 2976 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 2976 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| 2977 MAYBE_FrameOwnerPropertiesPropagationScrolling) { | 2977 MAYBE_FrameOwnerPropertiesPropagationScrolling) { |
| 2978 #if defined(OS_MACOSX) | 2978 #if defined(OS_MACOSX) |
| 2979 ui::test::ScopedPreferredScrollerStyle scroller_style_override(false); | 2979 ui::test::ScopedPreferredScrollerStyle scroller_style_override(false); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2992 "Where A = http://a.com/\n" | 2992 "Where A = http://a.com/\n" |
| 2993 " B = http://b.com/", | 2993 " B = http://b.com/", |
| 2994 DepictFrameTree(root)); | 2994 DepictFrameTree(root)); |
| 2995 | 2995 |
| 2996 FrameTreeNode* child = root->child_at(0); | 2996 FrameTreeNode* child = root->child_at(0); |
| 2997 | 2997 |
| 2998 // If the available client width within the iframe is smaller than the | 2998 // If the available client width within the iframe is smaller than the |
| 2999 // frame element's width, we assume there's a scrollbar. | 2999 // frame element's width, we assume there's a scrollbar. |
| 3000 // Also note that just comparing clientHeight and scrollHeight of the frame's | 3000 // Also note that just comparing clientHeight and scrollHeight of the frame's |
| 3001 // document will not work. | 3001 // document will not work. |
| 3002 // TODO(bokan): This check doesn't work if overlay scrollbars are enabled. It |
| 3003 // should be changed to something more reliable. crbug.com/662196. |
| 3002 auto has_scrollbar = [](RenderFrameHostImpl* rfh) { | 3004 auto has_scrollbar = [](RenderFrameHostImpl* rfh) { |
| 3003 int client_width; | 3005 int client_width; |
| 3004 EXPECT_TRUE(ExecuteScriptAndExtractInt(rfh, | 3006 EXPECT_TRUE(ExecuteScriptAndExtractInt(rfh, |
| 3005 "window.domAutomationController.send(document.body.clientWidth);", | 3007 "window.domAutomationController.send(document.body.clientWidth);", |
| 3006 &client_width)); | 3008 &client_width)); |
| 3007 const int kFrameElementWidth = 200; | 3009 const int kFrameElementWidth = 200; |
| 3008 return client_width < kFrameElementWidth; | 3010 return client_width < kFrameElementWidth; |
| 3009 }; | 3011 }; |
| 3010 | 3012 |
| 3011 auto set_scrolling_property = [](RenderFrameHostImpl* parent_rfh, | 3013 auto set_scrolling_property = [](RenderFrameHostImpl* parent_rfh, |
| (...skipping 5514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8526 EXPECT_TRUE(NavigateToURL(shell(), b_url)); | 8528 EXPECT_TRUE(NavigateToURL(shell(), b_url)); |
| 8527 | 8529 |
| 8528 base::string16 expected_title(base::UTF8ToUTF16("foo")); | 8530 base::string16 expected_title(base::UTF8ToUTF16("foo")); |
| 8529 TitleWatcher title_watcher(popup2->web_contents(), expected_title); | 8531 TitleWatcher title_watcher(popup2->web_contents(), expected_title); |
| 8530 EXPECT_TRUE(ExecuteScript( | 8532 EXPECT_TRUE(ExecuteScript( |
| 8531 shell(), "window.open('','popup2').postMessage('foo', '*');")); | 8533 shell(), "window.open('','popup2').postMessage('foo', '*');")); |
| 8532 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 8534 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 8533 } | 8535 } |
| 8534 | 8536 |
| 8535 } // namespace content | 8537 } // namespace content |
| OLD | NEW |