Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 1642553004: Make a test not depend on system settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/theme_helper_mac.h » ('j') | content/browser/theme_helper_mac.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "content/browser/theme_helper_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
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 ScopedPreferredScrollerStyleOveride
2018 scroller_style(blink::ScrollerStyleLegacy);
2019 #endif
2012 GURL main_url(embedded_test_server()->GetURL( 2020 GURL main_url(embedded_test_server()->GetURL(
2013 "a.com", "/frame_owner_properties_scrolling.html")); 2021 "a.com", "/frame_owner_properties_scrolling.html"));
2014 NavigateToURL(shell(), main_url); 2022 NavigateToURL(shell(), main_url);
2015 2023
2016 // It is safe to obtain the root frame tree node here, as it doesn't change. 2024 // 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()) 2025 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
2018 ->GetFrameTree() 2026 ->GetFrameTree()
2019 ->root(); 2027 ->root();
2020 ASSERT_EQ(1u, root->child_count()); 2028 ASSERT_EQ(1u, root->child_count());
2021 2029
(...skipping 2956 matching lines...) Expand 10 before | Expand all | Expand 10 after
4978 // The popup's origin should match |b_url|, since it's not sandboxed. 4986 // The popup's origin should match |b_url|, since it's not sandboxed.
4979 std::string popup_origin; 4987 std::string popup_origin;
4980 EXPECT_TRUE(ExecuteScriptAndExtractString( 4988 EXPECT_TRUE(ExecuteScriptAndExtractString(
4981 foo_root->current_frame_host(), 4989 foo_root->current_frame_host(),
4982 "domAutomationController.send(document.origin)", 4990 "domAutomationController.send(document.origin)",
4983 &popup_origin)); 4991 &popup_origin));
4984 EXPECT_EQ(b_url.GetOrigin().spec(), popup_origin + "/"); 4992 EXPECT_EQ(b_url.GetOrigin().spec(), popup_origin + "/");
4985 } 4993 }
4986 4994
4987 } // namespace content 4995 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/theme_helper_mac.h » ('j') | content/browser/theme_helper_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698