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

Unified Diff: content/test/content_browser_test_utils_internal.cc

Issue 2686683004: ABANDONED CL: WaitForChildFrameSurfaceReady to avoid flaky test hangs. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/content_browser_test_utils_internal.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test_utils_internal.cc
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc
index 1f0ac7bb4d8974e236fed4677b747e0d113f21af..4d078e28158cf07dfeafaa32527454e492d3014b 100644
--- a/content/test/content_browser_test_utils_internal.cc
+++ b/content/test/content_browser_test_utils_internal.cc
@@ -15,17 +15,12 @@
#include "base/strings/stringprintf.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "cc/surfaces/surface.h"
-#include "cc/surfaces/surface_manager.h"
#include "content/browser/compositor/surface_utils.h"
-#include "content/browser/frame_host/cross_process_frame_connector.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/render_frame_host_delegate.h"
#include "content/browser/frame_host/render_frame_proxy_host.h"
-#include "content/browser/frame_host/render_widget_host_view_child_frame.h"
#include "content/browser/renderer_host/delegated_frame_host.h"
-#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
@@ -290,47 +285,6 @@ class HttpRequestStallThrottle : public ResourceThrottle {
} // namespace
-SurfaceHitTestReadyNotifier::SurfaceHitTestReadyNotifier(
- RenderWidgetHostViewChildFrame* target_view)
- : target_view_(target_view) {
- surface_manager_ = GetSurfaceManager();
-}
-
-void SurfaceHitTestReadyNotifier::WaitForSurfaceReady() {
- root_surface_id_ = target_view_->FrameConnectorForTesting()
- ->GetRootRenderWidgetHostViewForTesting()
- ->SurfaceIdForTesting();
- if (ContainsSurfaceId(root_surface_id_))
- return;
-
- while (true) {
- // TODO(kenrb): Need a better way to do this. If
- // RenderWidgetHostViewBase lifetime observer lands (see
- // https://codereview.chromium.org/1711103002/), we can add a callback
- // from OnSwapCompositorFrame and avoid this busy waiting, which is very
- // frequent in tests in this file.
- base::RunLoop run_loop;
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
- run_loop.Run();
- if (ContainsSurfaceId(root_surface_id_))
- break;
- }
-}
-
-bool SurfaceHitTestReadyNotifier::ContainsSurfaceId(
- cc::SurfaceId container_surface_id) {
- if (!container_surface_id.is_valid())
- return false;
- for (cc::SurfaceId id :
- surface_manager_->GetSurfaceForId(container_surface_id)
- ->referenced_surfaces()) {
- if (id == target_view_->SurfaceIdForTesting() || ContainsSurfaceId(id))
- return true;
- }
- return false;
-}
-
NavigationStallDelegate::NavigationStallDelegate(const GURL& url) : url_(url) {}
void NavigationStallDelegate::RequestBeginning(
« no previous file with comments | « content/test/content_browser_test_utils_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698