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 "content/test/content_browser_test_utils_internal.h" | 5 #include "content/test/content_browser_test_utils_internal.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "cc/surfaces/surface.h" | 17 #include "cc/surfaces/surface.h" |
18 #include "cc/surfaces/surface_manager.h" | 18 #include "cc/surfaces/surface_manager.h" |
19 #include "content/browser/compositor/surface_utils.h" | 19 #include "content/browser/compositor/surface_utils.h" |
20 #include "content/browser/frame_host/cross_process_frame_connector.h" | 20 #include "content/browser/frame_host/cross_process_frame_connector.h" |
21 #include "content/browser/frame_host/frame_tree_node.h" | 21 #include "content/browser/frame_host/frame_tree_node.h" |
22 #include "content/browser/frame_host/navigator.h" | 22 #include "content/browser/frame_host/navigator.h" |
23 #include "content/browser/frame_host/render_frame_proxy_host.h" | 23 #include "content/browser/frame_host/render_frame_proxy_host.h" |
24 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 24 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
25 #include "content/browser/renderer_host/delegated_frame_host.h" | 25 #include "content/browser/renderer_host/delegated_frame_host.h" |
26 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 26 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
27 #include "content/public/browser/resource_dispatcher_host.h" | 27 #include "content/public/browser/resource_dispatcher_host.h" |
28 #include "content/public/browser/resource_throttle.h" | 28 #include "content/public/browser/resource_throttle.h" |
| 29 #include "content/public/browser/web_contents.h" |
29 #include "content/public/test/browser_test_utils.h" | 30 #include "content/public/test/browser_test_utils.h" |
30 #include "content/public/test/content_browser_test_utils.h" | 31 #include "content/public/test/content_browser_test_utils.h" |
31 #include "content/shell/browser/shell.h" | 32 #include "content/shell/browser/shell.h" |
32 #include "content/shell/browser/shell_javascript_dialog_manager.h" | 33 #include "content/shell/browser/shell_javascript_dialog_manager.h" |
33 #include "content/test/test_frame_navigation_observer.h" | 34 #include "content/test/test_frame_navigation_observer.h" |
34 #include "net/url_request/url_request.h" | 35 #include "net/url_request/url_request.h" |
35 | 36 |
36 namespace content { | 37 namespace content { |
37 | 38 |
38 namespace { | 39 namespace { |
(...skipping 29 matching lines...) Expand all Loading... |
68 observer.Wait(); | 69 observer.Wait(); |
69 } | 70 } |
70 | 71 |
71 void SetShouldProceedOnBeforeUnload(Shell* shell, bool proceed) { | 72 void SetShouldProceedOnBeforeUnload(Shell* shell, bool proceed) { |
72 ShellJavaScriptDialogManager* manager = | 73 ShellJavaScriptDialogManager* manager = |
73 static_cast<ShellJavaScriptDialogManager*>( | 74 static_cast<ShellJavaScriptDialogManager*>( |
74 shell->GetJavaScriptDialogManager(shell->web_contents())); | 75 shell->GetJavaScriptDialogManager(shell->web_contents())); |
75 manager->set_should_proceed_on_beforeunload(proceed); | 76 manager->set_should_proceed_on_beforeunload(proceed); |
76 } | 77 } |
77 | 78 |
| 79 RenderFrameHost* ConvertToRenderFrameHost(FrameTreeNode* frame_tree_node) { |
| 80 return frame_tree_node->current_frame_host(); |
| 81 } |
| 82 |
78 FrameTreeVisualizer::FrameTreeVisualizer() { | 83 FrameTreeVisualizer::FrameTreeVisualizer() { |
79 } | 84 } |
80 | 85 |
81 FrameTreeVisualizer::~FrameTreeVisualizer() { | 86 FrameTreeVisualizer::~FrameTreeVisualizer() { |
82 } | 87 } |
83 | 88 |
84 std::string FrameTreeVisualizer::DepictFrameTree(FrameTreeNode* root) { | 89 std::string FrameTreeVisualizer::DepictFrameTree(FrameTreeNode* root) { |
85 // Tracks the sites actually used in this depiction. | 90 // Tracks the sites actually used in this depiction. |
86 std::map<std::string, SiteInstance*> legend; | 91 std::map<std::string, SiteInstance*> legend; |
87 | 92 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 loop_runner_->Quit(); | 418 loop_runner_->Quit(); |
414 } | 419 } |
415 | 420 |
416 void TestNavigationManager::OnWillStartRequest() { | 421 void TestNavigationManager::OnWillStartRequest() { |
417 navigation_paused_ = true; | 422 navigation_paused_ = true; |
418 if (loop_runner_) | 423 if (loop_runner_) |
419 loop_runner_->Quit(); | 424 loop_runner_->Quit(); |
420 } | 425 } |
421 | 426 |
422 } // namespace content | 427 } // namespace content |
OLD | NEW |