| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44 #include "content/shell/browser/shell.h" | 44 #include "content/shell/browser/shell.h" | 
| 45 #include "content/test/content_browser_test_utils_internal.h" | 45 #include "content/test/content_browser_test_utils_internal.h" | 
| 46 #include "content/test/test_frame_navigation_observer.h" | 46 #include "content/test/test_frame_navigation_observer.h" | 
| 47 #include "ipc/ipc_security_test_util.h" | 47 #include "ipc/ipc_security_test_util.h" | 
| 48 #include "net/dns/mock_host_resolver.h" | 48 #include "net/dns/mock_host_resolver.h" | 
| 49 #include "net/test/embedded_test_server/embedded_test_server.h" | 49 #include "net/test/embedded_test_server/embedded_test_server.h" | 
| 50 #include "third_party/WebKit/public/web/WebInputEvent.h" | 50 #include "third_party/WebKit/public/web/WebInputEvent.h" | 
| 51 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 51 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 
| 52 #include "ui/gfx/switches.h" | 52 #include "ui/gfx/switches.h" | 
| 53 | 53 | 
|  | 54 #if defined(OS_MACOSX) | 
|  | 55 #include "ui/base/test/scoped_preferred_scroller_style_legacy_mac.h" | 
|  | 56 #endif | 
|  | 57 | 
| 54 namespace content { | 58 namespace content { | 
| 55 | 59 | 
| 56 namespace { | 60 namespace { | 
| 57 | 61 | 
| 58 // Helper function to send a postMessage and wait for a reply message.  The | 62 // Helper function to send a postMessage and wait for a reply message.  The | 
| 59 // |post_message_script| is executed on the |sender_ftn| frame, and the sender | 63 // |post_message_script| is executed on the |sender_ftn| frame, and the sender | 
| 60 // frame is expected to post |reply_status| from the DOMAutomationController | 64 // frame is expected to post |reply_status| from the DOMAutomationController | 
| 61 // when it receives a reply. | 65 // when it receives a reply. | 
| 62 void PostMessageAndWaitForReply(FrameTreeNode* sender_ftn, | 66 void PostMessageAndWaitForReply(FrameTreeNode* sender_ftn, | 
| 63                                 const std::string& post_message_script, | 67                                 const std::string& post_message_script, | 
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2002 // Does not work on android since android has scrollbars overlayed. | 2006 // Does not work on android since android has scrollbars overlayed. | 
| 2003 #if defined(OS_ANDROID) | 2007 #if defined(OS_ANDROID) | 
| 2004 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 2008 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 
| 2005         DISABLED_FrameOwnerPropertiesPropagationScrolling | 2009         DISABLED_FrameOwnerPropertiesPropagationScrolling | 
| 2006 #else | 2010 #else | 
| 2007 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 2011 #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ | 
| 2008         FrameOwnerPropertiesPropagationScrolling | 2012         FrameOwnerPropertiesPropagationScrolling | 
| 2009 #endif | 2013 #endif | 
| 2010 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 2014 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 
| 2011                        MAYBE_FrameOwnerPropertiesPropagationScrolling) { | 2015                        MAYBE_FrameOwnerPropertiesPropagationScrolling) { | 
|  | 2016 #if defined(OS_MACOSX) | 
|  | 2017   ui::test::ScopedPreferredScrollerStyleLegacy scroller_style_override; | 
|  | 2018 #endif | 
| 2012   GURL main_url(embedded_test_server()->GetURL( | 2019   GURL main_url(embedded_test_server()->GetURL( | 
| 2013       "a.com", "/frame_owner_properties_scrolling.html")); | 2020       "a.com", "/frame_owner_properties_scrolling.html")); | 
| 2014   NavigateToURL(shell(), main_url); | 2021   NavigateToURL(shell(), main_url); | 
| 2015 | 2022 | 
| 2016   // It is safe to obtain the root frame tree node here, as it doesn't change. | 2023   // It is safe to obtain the root frame tree node here, as it doesn't change. | 
| 2017   FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 2024   FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 
| 2018                             ->GetFrameTree() | 2025                             ->GetFrameTree() | 
| 2019                             ->root(); | 2026                             ->root(); | 
| 2020   ASSERT_EQ(1u, root->child_count()); | 2027   ASSERT_EQ(1u, root->child_count()); | 
| 2021 | 2028 | 
| (...skipping 2956 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4978   // The popup's origin should match |b_url|, since it's not sandboxed. | 4985   // The popup's origin should match |b_url|, since it's not sandboxed. | 
| 4979   std::string popup_origin; | 4986   std::string popup_origin; | 
| 4980   EXPECT_TRUE(ExecuteScriptAndExtractString( | 4987   EXPECT_TRUE(ExecuteScriptAndExtractString( | 
| 4981       foo_root->current_frame_host(), | 4988       foo_root->current_frame_host(), | 
| 4982       "domAutomationController.send(document.origin)", | 4989       "domAutomationController.send(document.origin)", | 
| 4983       &popup_origin)); | 4990       &popup_origin)); | 
| 4984   EXPECT_EQ(b_url.GetOrigin().spec(), popup_origin + "/"); | 4991   EXPECT_EQ(b_url.GetOrigin().spec(), popup_origin + "/"); | 
| 4985 } | 4992 } | 
| 4986 | 4993 | 
| 4987 }  // namespace content | 4994 }  // namespace content | 
| OLD | NEW | 
|---|