Chromium Code Reviews| 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 "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); | 128 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); |
| 129 RenderFrameHostImpl* rfh = | 129 RenderFrameHostImpl* rfh = |
| 130 static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame()); | 130 static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame()); |
| 131 EXPECT_TRUE(rvh->IsRenderViewLive()); | 131 EXPECT_TRUE(rvh->IsRenderViewLive()); |
| 132 EXPECT_TRUE(rfh->IsRenderFrameLive()); | 132 EXPECT_TRUE(rfh->IsRenderFrameLive()); |
| 133 | 133 |
| 134 // Crash the renderer so that it doesn't send any FrameDetached messages. | 134 // Crash the renderer so that it doesn't send any FrameDetached messages. |
| 135 RenderProcessHostWatcher crash_observer( | 135 RenderProcessHostWatcher crash_observer( |
| 136 shell()->web_contents(), | 136 shell()->web_contents(), |
| 137 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 137 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
| 138 NavigateToURL(shell(), GURL(kChromeUICrashURL)); | 138 shell()->web_contents()->GetMainFrame()->GetProcess()->Shutdown(0, false); |
|
Łukasz Anforowicz
2017/06/01 16:10:29
It's probably a good idea to check (probably via E
Charlie Reis
2017/06/01 17:04:16
Good idea. But this is one of the cases that ASSE
| |
| 139 crash_observer.Wait(); | 139 crash_observer.Wait(); |
| 140 | 140 |
| 141 // The frame tree should be cleared. | 141 // The frame tree should be cleared. |
| 142 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents()); | 142 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents()); |
| 143 FrameTreeNode* root = wc->GetFrameTree()->root(); | 143 FrameTreeNode* root = wc->GetFrameTree()->root(); |
| 144 EXPECT_EQ(0UL, root->child_count()); | 144 EXPECT_EQ(0UL, root->child_count()); |
| 145 | 145 |
| 146 // Ensure the view and frame aren't live anymore. | 146 // Ensure the view and frame aren't live anymore. |
| 147 EXPECT_FALSE(rvh->IsRenderViewLive()); | 147 EXPECT_FALSE(rvh->IsRenderViewLive()); |
| 148 EXPECT_FALSE(rfh->IsRenderFrameLive()); | 148 EXPECT_FALSE(rfh->IsRenderFrameLive()); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 754 // Make sure we did a process transfer back to "b.is". | 754 // Make sure we did a process transfer back to "b.is". |
| 755 EXPECT_EQ( | 755 EXPECT_EQ( |
| 756 " Site A ------------ proxies for B\n" | 756 " Site A ------------ proxies for B\n" |
| 757 " +--Site B ------- proxies for A\n" | 757 " +--Site B ------- proxies for A\n" |
| 758 "Where A = http://a.com/\n" | 758 "Where A = http://a.com/\n" |
| 759 " B = http://b.is/", | 759 " B = http://b.is/", |
| 760 FrameTreeVisualizer().DepictFrameTree(root)); | 760 FrameTreeVisualizer().DepictFrameTree(root)); |
| 761 } | 761 } |
| 762 | 762 |
| 763 } // namespace content | 763 } // namespace content |
| OLD | NEW |