| OLD | NEW | 
|    1 // Copyright 2014 The Chromium Authors. All rights reserved. |    1 // Copyright 2014 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 "content/browser/frame_host/frame_tree.h" |    6 #include "content/browser/frame_host/frame_tree.h" | 
|    7 #include "content/browser/frame_host/frame_tree_node.h" |    7 #include "content/browser/frame_host/frame_tree_node.h" | 
|    8 #include "content/browser/renderer_host/render_view_host_impl.h" |    8 #include "content/browser/renderer_host/render_view_host_impl.h" | 
|    9 #include "content/browser/web_contents/web_contents_impl.h" |    9 #include "content/browser/web_contents/web_contents_impl.h" | 
|   10 #include "content/public/browser/notification_service.h" |   10 #include "content/public/browser/notification_service.h" | 
|   11 #include "content/public/browser/notification_types.h" |   11 #include "content/public/browser/notification_types.h" | 
|   12 #include "content/public/common/content_switches.h" |   12 #include "content/public/common/content_switches.h" | 
|   13 #include "content/public/common/url_constants.h" |   13 #include "content/public/common/url_constants.h" | 
|   14 #include "content/public/test/browser_test_utils.h" |   14 #include "content/public/test/browser_test_utils.h" | 
|   15 #include "content/public/test/content_browser_test.h" |   15 #include "content/public/test/content_browser_test.h" | 
|   16 #include "content/public/test/content_browser_test_utils.h" |   16 #include "content/public/test/content_browser_test_utils.h" | 
|   17 #include "content/public/test/test_navigation_observer.h" |   17 #include "content/public/test/test_navigation_observer.h" | 
|   18 #include "content/public/test/test_utils.h" |   18 #include "content/public/test/test_utils.h" | 
|   19 #include "content/shell/browser/shell.h" |   19 #include "content/shell/browser/shell.h" | 
|   20 #include "content/test/content_browser_test_utils_internal.h" |   20 #include "content/test/content_browser_test_utils_internal.h" | 
|   21 #include "net/dns/mock_host_resolver.h" |   21 #include "net/dns/mock_host_resolver.h" | 
|   22 #include "net/test/embedded_test_server/embedded_test_server.h" |   22 #include "net/test/embedded_test_server/embedded_test_server.h" | 
|   23  |   23  | 
 |   24 // For fine-grained suppression on flaky tests. | 
 |   25 #if defined(OS_WIN) | 
 |   26 #include "base/win/windows_version.h" | 
 |   27 #endif | 
 |   28  | 
|   24 namespace content { |   29 namespace content { | 
|   25  |   30  | 
|   26 class FrameTreeBrowserTest : public ContentBrowserTest { |   31 class FrameTreeBrowserTest : public ContentBrowserTest { | 
|   27  public: |   32  public: | 
|   28   FrameTreeBrowserTest() {} |   33   FrameTreeBrowserTest() {} | 
|   29  |   34  | 
|   30   void SetUpOnMainThread() override { |   35   void SetUpOnMainThread() override { | 
|   31     host_resolver()->AddRule("*", "127.0.0.1"); |   36     host_resolver()->AddRule("*", "127.0.0.1"); | 
|   32     ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |   37     ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 
|   33     SetupCrossSiteRedirector(embedded_test_server()); |   38     SetupCrossSiteRedirector(embedded_test_server()); | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  139  |  144  | 
|  140 // Test that we can navigate away if the previous renderer doesn't clean up its |  145 // Test that we can navigate away if the previous renderer doesn't clean up its | 
|  141 // child frames. |  146 // child frames. | 
|  142 // Flaky on Mac. http://crbug.com/452018 |  147 // Flaky on Mac. http://crbug.com/452018 | 
|  143 #if defined(OS_MACOSX) |  148 #if defined(OS_MACOSX) | 
|  144 #define MAYBE_NavigateWithLeftoverFrames DISABLED_NavigateWithLeftoverFrames |  149 #define MAYBE_NavigateWithLeftoverFrames DISABLED_NavigateWithLeftoverFrames | 
|  145 #else |  150 #else | 
|  146 #define MAYBE_NavigateWithLeftoverFrames NavigateWithLeftoverFrames |  151 #define MAYBE_NavigateWithLeftoverFrames NavigateWithLeftoverFrames | 
|  147 #endif |  152 #endif | 
|  148 IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, MAYBE_NavigateWithLeftoverFrames) { |  153 IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, MAYBE_NavigateWithLeftoverFrames) { | 
 |  154 #if defined(OS_WIN) | 
 |  155   // Flaky on XP bot http://crbug.com/468713 | 
 |  156   if (base::win::GetVersion() <= base::win::VERSION_XP) | 
 |  157     return; | 
 |  158 #endif | 
|  149   GURL base_url = embedded_test_server()->GetURL("A.com", "/site_isolation/"); |  159   GURL base_url = embedded_test_server()->GetURL("A.com", "/site_isolation/"); | 
|  150  |  160  | 
|  151   NavigateToURL(shell(), |  161   NavigateToURL(shell(), | 
|  152                 embedded_test_server()->GetURL("/frame_tree/top.html")); |  162                 embedded_test_server()->GetURL("/frame_tree/top.html")); | 
|  153  |  163  | 
|  154   // Hang the renderer so that it doesn't send any FrameDetached messages. |  164   // Hang the renderer so that it doesn't send any FrameDetached messages. | 
|  155   // (This navigation will never complete, so don't wait for it.) |  165   // (This navigation will never complete, so don't wait for it.) | 
|  156   shell()->LoadURL(GURL(kChromeUIHangURL)); |  166   shell()->LoadURL(GURL(kChromeUIHangURL)); | 
|  157  |  167  | 
|  158   // Check that the frame tree still has children. |  168   // Check that the frame tree still has children. | 
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  388   GURL data_url("data:text/html,foo"); |  398   GURL data_url("data:text/html,foo"); | 
|  389   NavigateFrameToURL(root->child_at(1), data_url); |  399   NavigateFrameToURL(root->child_at(1), data_url); | 
|  390  |  400  | 
|  391   // Navigating to a data URL should set a unique origin.  This is represented |  401   // Navigating to a data URL should set a unique origin.  This is represented | 
|  392   // as "null" per RFC 6454. |  402   // as "null" per RFC 6454. | 
|  393   EXPECT_EQ(root->child_at(1)->current_replication_state().origin.string(), |  403   EXPECT_EQ(root->child_at(1)->current_replication_state().origin.string(), | 
|  394             "null"); |  404             "null"); | 
|  395 } |  405 } | 
|  396  |  406  | 
|  397 }  // namespace content |  407 }  // namespace content | 
| OLD | NEW |