Commit 018fbce3 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Modernize content/public/test/browser_test_utils.cc.

- Use auto, = default, and std::make_unique().
- Remove content:: in namespace content.
- Fix a few nits along the way.

Change-Id: I55912384dcb5dff2d9a16b14706dca687b65aa75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404955Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806302}
parent c6261851
...@@ -426,8 +426,7 @@ CrossSiteRedirectResponseHandler(const net::EmbeddedTestServer* test_server, ...@@ -426,8 +426,7 @@ CrossSiteRedirectResponseHandler(const net::EmbeddedTestServer* test_server,
GURL redirect_target(redirect_server.Resolve(path)); GURL redirect_target(redirect_server.Resolve(path));
DCHECK(redirect_target.is_valid()); DCHECK(redirect_target.is_valid());
std::unique_ptr<net::test_server::BasicHttpResponse> http_response( auto http_response = std::make_unique<net::test_server::BasicHttpResponse>();
new net::test_server::BasicHttpResponse);
http_response->set_code(http_status_code); http_response->set_code(http_status_code);
http_response->AddCustomHeader("Location", redirect_target.spec()); http_response->AddCustomHeader("Location", redirect_target.spec());
return std::move(http_response); return std::move(http_response);
...@@ -488,8 +487,7 @@ bool HasGzipHeader(const base::RefCountedMemory& maybe_gzipped) { ...@@ -488,8 +487,7 @@ bool HasGzipHeader(const base::RefCountedMemory& maybe_gzipped) {
void AppendGzippedResource(const base::RefCountedMemory& encoded, void AppendGzippedResource(const base::RefCountedMemory& encoded,
std::string* to_append) { std::string* to_append) {
std::unique_ptr<net::MockSourceStream> source_stream( auto source_stream = std::make_unique<net::MockSourceStream>();
new net::MockSourceStream());
source_stream->AddReadResult(encoded.front_as<char>(), encoded.size(), source_stream->AddReadResult(encoded.front_as<char>(), encoded.size(),
net::OK, net::MockSourceStream::SYNC); net::OK, net::MockSourceStream::SYNC);
// Add an EOF. // Add an EOF.
...@@ -731,12 +729,13 @@ bool WaitForLoadStop(WebContents* web_contents) { ...@@ -731,12 +729,13 @@ bool WaitForLoadStop(WebContents* web_contents) {
if (!is_page_normal) { if (!is_page_normal) {
NavigationEntry* last_entry = NavigationEntry* last_entry =
web_contents->GetController().GetLastCommittedEntry(); web_contents->GetController().GetLastCommittedEntry();
if (last_entry) if (last_entry) {
LOG(ERROR) << "Http status code = " << last_entry->GetHttpStatusCode() LOG(ERROR) << "Http status code = " << last_entry->GetHttpStatusCode()
<< ", page type = " << last_entry->GetPageType(); << ", page type = " << last_entry->GetPageType();
else } else {
LOG(ERROR) << "No committed entry."; LOG(ERROR) << "No committed entry.";
} }
}
return is_page_normal; return is_page_normal;
} }
...@@ -756,9 +755,7 @@ bool IsLastCommittedEntryOfPageType(WebContents* web_contents, ...@@ -756,9 +755,7 @@ bool IsLastCommittedEntryOfPageType(WebContents* web_contents,
content::PageType page_type) { content::PageType page_type) {
NavigationEntry* last_entry = NavigationEntry* last_entry =
web_contents->GetController().GetLastCommittedEntry(); web_contents->GetController().GetLastCommittedEntry();
if (!last_entry) return last_entry && last_entry->GetPageType() == page_type;
return false;
return last_entry->GetPageType() == page_type;
} }
void OverrideLastCommittedOrigin(RenderFrameHost* render_frame_host, void OverrideLastCommittedOrigin(RenderFrameHost* render_frame_host,
...@@ -846,10 +843,8 @@ void SimulateMouseClickAt(WebContents* web_contents, ...@@ -846,10 +843,8 @@ void SimulateMouseClickAt(WebContents* web_contents,
int modifiers, int modifiers,
blink::WebMouseEvent::Button button, blink::WebMouseEvent::Button button,
const gfx::Point& point) { const gfx::Point& point) {
content::WebContentsImpl* web_contents_impl = auto* web_contents_impl = static_cast<WebContentsImpl*>(web_contents);
static_cast<content::WebContentsImpl*>(web_contents); auto* rwhvb = static_cast<RenderWidgetHostViewBase*>(
content::RenderWidgetHostViewBase* rwhvb =
static_cast<content::RenderWidgetHostViewBase*>(
web_contents->GetRenderWidgetHostView()); web_contents->GetRenderWidgetHostView());
blink::WebMouseEvent mouse_event(blink::WebInputEvent::Type::kMouseDown, blink::WebMouseEvent mouse_event(blink::WebInputEvent::Type::kMouseDown,
modifiers, ui::EventTimeForNow()); modifiers, ui::EventTimeForNow());
...@@ -870,37 +865,33 @@ void SimulateMouseClickAt(WebContents* web_contents, ...@@ -870,37 +865,33 @@ void SimulateMouseClickAt(WebContents* web_contents,
void SimulateMouseClickOrTapElementWithId(content::WebContents* web_contents, void SimulateMouseClickOrTapElementWithId(content::WebContents* web_contents,
const std::string& id) { const std::string& id) {
// Get the center coordinates of the DOM element. // Get the center coordinates of the DOM element.
const int x = const int x = EvalJs(web_contents,
content::EvalJs( JsReplace("const bounds = "
web_contents,
content::JsReplace("const bounds = "
"document.getElementById($1)." "document.getElementById($1)."
"getBoundingClientRect();" "getBoundingClientRect();"
"Math.floor(bounds.left + bounds.width / 2)", "Math.floor(bounds.left + bounds.width / 2)",
id)) id))
.ExtractInt(); .ExtractInt();
const int y = const int y = EvalJs(web_contents,
content::EvalJs( JsReplace("const bounds = "
web_contents,
content::JsReplace("const bounds = "
"document.getElementById($1)." "document.getElementById($1)."
"getBoundingClientRect();" "getBoundingClientRect();"
"Math.floor(bounds.top + bounds.height / 2)", "Math.floor(bounds.top + bounds.height / 2)",
id)) id))
.ExtractInt(); .ExtractInt();
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
content::SimulateTapDownAt(web_contents, gfx::Point(x, y)); SimulateTapDownAt(web_contents, gfx::Point(x, y));
content::SimulateTapAt(web_contents, gfx::Point(x, y)); SimulateTapAt(web_contents, gfx::Point(x, y));
#else #else
content::SimulateMouseClickAt( SimulateMouseClickAt(web_contents, 0, blink::WebMouseEvent::Button::kLeft,
web_contents, 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(x, y)); gfx::Point(x, y));
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} }
void SendMouseDownToWidget(RenderWidgetHost* target, void SendMouseDownToWidget(RenderWidgetHost* target,
int modifiers, int modifiers,
blink::WebMouseEvent::Button button) { blink::WebMouseEvent::Button button) {
auto* view = static_cast<content::RenderWidgetHostImpl*>(target)->GetView(); auto* view = static_cast<RenderWidgetHostImpl*>(target)->GetView();
blink::WebMouseEvent mouse_event(blink::WebInputEvent::Type::kMouseDown, blink::WebMouseEvent mouse_event(blink::WebInputEvent::Type::kMouseDown,
modifiers, ui::EventTimeForNow()); modifiers, ui::EventTimeForNow());
...@@ -923,10 +914,8 @@ void SimulateMouseEvent(WebContents* web_contents, ...@@ -923,10 +914,8 @@ void SimulateMouseEvent(WebContents* web_contents,
blink::WebInputEvent::Type type, blink::WebInputEvent::Type type,
blink::WebMouseEvent::Button button, blink::WebMouseEvent::Button button,
const gfx::Point& point) { const gfx::Point& point) {
content::WebContentsImpl* web_contents_impl = auto* web_contents_impl = static_cast<WebContentsImpl*>(web_contents);
static_cast<content::WebContentsImpl*>(web_contents); auto* rwhvb = static_cast<RenderWidgetHostViewBase*>(
content::RenderWidgetHostViewBase* rwhvb =
static_cast<content::RenderWidgetHostViewBase*>(
web_contents->GetRenderWidgetHostView()); web_contents->GetRenderWidgetHostView());
blink::WebMouseEvent mouse_event(type, 0, ui::EventTimeForNow()); blink::WebMouseEvent mouse_event(type, 0, ui::EventTimeForNow());
mouse_event.button = button; mouse_event.button = button;
...@@ -1253,7 +1242,7 @@ void ScopedSimulateModifierKeyPress::KeyPressWithoutChar( ...@@ -1253,7 +1242,7 @@ void ScopedSimulateModifierKeyPress::KeyPressWithoutChar(
bool IsWebcamAvailableOnSystem(WebContents* web_contents) { bool IsWebcamAvailableOnSystem(WebContents* web_contents) {
std::string result; std::string result;
EXPECT_TRUE(content::ExecuteScriptAndExtractString( EXPECT_TRUE(ExecuteScriptAndExtractString(
web_contents, kHasVideoInputDeviceOnSystem, &result)); web_contents, kHasVideoInputDeviceOnSystem, &result));
return result == kHasVideoInputDevice; return result == kHasVideoInputDevice;
} }
...@@ -1975,7 +1964,7 @@ bool WaitForRenderFrameReady(RenderFrameHost* rfh) { ...@@ -1975,7 +1964,7 @@ bool WaitForRenderFrameReady(RenderFrameHost* rfh) {
void RemoveWebContentsReceiverSet(WebContents* web_contents, void RemoveWebContentsReceiverSet(WebContents* web_contents,
const std::string& interface_name) { const std::string& interface_name) {
static_cast<content::WebContentsImpl*>(web_contents) static_cast<WebContentsImpl*>(web_contents)
->RemoveReceiverSetForTesting(interface_name); ->RemoveReceiverSetForTesting(interface_name);
} }
...@@ -2253,8 +2242,7 @@ void TitleWatcher::AlsoWaitForTitle(const base::string16& expected_title) { ...@@ -2253,8 +2242,7 @@ void TitleWatcher::AlsoWaitForTitle(const base::string16& expected_title) {
expected_titles_.push_back(expected_title); expected_titles_.push_back(expected_title);
} }
TitleWatcher::~TitleWatcher() { TitleWatcher::~TitleWatcher() = default;
}
const base::string16& TitleWatcher::WaitAndGetTitle() { const base::string16& TitleWatcher::WaitAndGetTitle() {
TestTitle(); TestTitle();
...@@ -2445,7 +2433,7 @@ DOMMessageQueue::DOMMessageQueue(RenderFrameHost* render_frame_host) ...@@ -2445,7 +2433,7 @@ DOMMessageQueue::DOMMessageQueue(RenderFrameHost* render_frame_host)
render_frame_host_ = render_frame_host; render_frame_host_ = render_frame_host;
} }
DOMMessageQueue::~DOMMessageQueue() {} DOMMessageQueue::~DOMMessageQueue() = default;
void DOMMessageQueue::Observe(int type, void DOMMessageQueue::Observe(int type,
const NotificationSource& source, const NotificationSource& source,
...@@ -2542,7 +2530,7 @@ WebContentsAddedObserver::~WebContentsAddedObserver() { ...@@ -2542,7 +2530,7 @@ WebContentsAddedObserver::~WebContentsAddedObserver() {
void WebContentsAddedObserver::WebContentsCreated(WebContents* web_contents) { void WebContentsAddedObserver::WebContentsCreated(WebContents* web_contents) {
DCHECK(!web_contents_); DCHECK(!web_contents_);
web_contents_ = web_contents; web_contents_ = web_contents;
child_observer_.reset(new RenderViewCreatedObserver(web_contents)); child_observer_ = std::make_unique<RenderViewCreatedObserver>(web_contents);
if (quit_closure_) if (quit_closure_)
std::move(quit_closure_).Run(); std::move(quit_closure_).Run();
...@@ -2862,10 +2850,10 @@ class FrameFocusedObserver::FrameTreeNodeObserverImpl ...@@ -2862,10 +2850,10 @@ class FrameFocusedObserver::FrameTreeNodeObserverImpl
}; };
FrameFocusedObserver::FrameFocusedObserver(RenderFrameHost* owner_host) FrameFocusedObserver::FrameFocusedObserver(RenderFrameHost* owner_host)
: impl_(new FrameTreeNodeObserverImpl( : impl_(std::make_unique<FrameTreeNodeObserverImpl>(
static_cast<RenderFrameHostImpl*>(owner_host)->frame_tree_node())) {} static_cast<RenderFrameHostImpl*>(owner_host)->frame_tree_node())) {}
FrameFocusedObserver::~FrameFocusedObserver() {} FrameFocusedObserver::~FrameFocusedObserver() = default;
void FrameFocusedObserver::Wait() { void FrameFocusedObserver::Wait() {
impl_->Run(); impl_->Run();
...@@ -2893,7 +2881,7 @@ class FrameDeletedObserver::FrameTreeNodeObserverImpl ...@@ -2893,7 +2881,7 @@ class FrameDeletedObserver::FrameTreeNodeObserverImpl
}; };
FrameDeletedObserver::FrameDeletedObserver(RenderFrameHost* owner_host) FrameDeletedObserver::FrameDeletedObserver(RenderFrameHost* owner_host)
: impl_(new FrameTreeNodeObserverImpl( : impl_(std::make_unique<FrameTreeNodeObserverImpl>(
static_cast<RenderFrameHostImpl*>(owner_host)->frame_tree_node())) {} static_cast<RenderFrameHostImpl*>(owner_host)->frame_tree_node())) {}
FrameDeletedObserver::~FrameDeletedObserver() = default; FrameDeletedObserver::~FrameDeletedObserver() = default;
...@@ -2953,13 +2941,12 @@ void TestNavigationManager::DidStartNavigation(NavigationHandle* handle) { ...@@ -2953,13 +2941,12 @@ void TestNavigationManager::DidStartNavigation(NavigationHandle* handle) {
return; return;
request_ = NavigationRequest::From(handle); request_ = NavigationRequest::From(handle);
std::unique_ptr<NavigationThrottle> throttle( auto throttle = std::make_unique<TestNavigationManagerThrottle>(
new TestNavigationManagerThrottle(
request_, request_,
base::BindOnce(&TestNavigationManager::OnWillStartRequest, base::BindOnce(&TestNavigationManager::OnWillStartRequest,
weak_factory_.GetWeakPtr()), weak_factory_.GetWeakPtr()),
base::BindOnce(&TestNavigationManager::OnWillProcessResponse, base::BindOnce(&TestNavigationManager::OnWillProcessResponse,
weak_factory_.GetWeakPtr()))); weak_factory_.GetWeakPtr()));
request_->RegisterThrottleForTesting(std::move(throttle)); request_->RegisterThrottleForTesting(std::move(throttle));
} }
...@@ -3039,7 +3026,7 @@ void TestNavigationManager::AllowNestableTasks() { ...@@ -3039,7 +3026,7 @@ void TestNavigationManager::AllowNestableTasks() {
NavigationHandleCommitObserver::NavigationHandleCommitObserver( NavigationHandleCommitObserver::NavigationHandleCommitObserver(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& url) const GURL& url)
: content::WebContentsObserver(web_contents), : WebContentsObserver(web_contents),
url_(url), url_(url),
has_committed_(false), has_committed_(false),
was_same_document_(false), was_same_document_(false),
...@@ -3159,7 +3146,7 @@ void PwnMessageHelper::OpenURL(RenderFrameHost* render_frame_host, ...@@ -3159,7 +3146,7 @@ void PwnMessageHelper::OpenURL(RenderFrameHost* render_frame_host,
params->should_replace_current_entry = false; params->should_replace_current_entry = false;
params->user_gesture = true; params->user_gesture = true;
static_cast<mojom::FrameHost*>( static_cast<mojom::FrameHost*>(
static_cast<content::RenderFrameHostImpl*>(render_frame_host)) static_cast<RenderFrameHostImpl*>(render_frame_host))
->OpenURL(std::move(params)); ->OpenURL(std::move(params));
} }
...@@ -3239,17 +3226,17 @@ void VerifyStaleContentOnFrameEviction( ...@@ -3239,17 +3226,17 @@ void VerifyStaleContentOnFrameEviction(
#endif // defined(USE_AURA) #endif // defined(USE_AURA)
ContextMenuFilter::ContextMenuFilter() ContextMenuFilter::ContextMenuFilter()
: content::BrowserMessageFilter(FrameMsgStart), : BrowserMessageFilter(FrameMsgStart),
run_loop_(new base::RunLoop), run_loop_(std::make_unique<base::RunLoop>()),
quit_closure_(run_loop_->QuitClosure()) {} quit_closure_(run_loop_->QuitClosure()) {}
bool ContextMenuFilter::OnMessageReceived(const IPC::Message& message) { bool ContextMenuFilter::OnMessageReceived(const IPC::Message& message) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (message.type() == FrameHostMsg_ContextMenu::ID) { if (message.type() == FrameHostMsg_ContextMenu::ID) {
FrameHostMsg_ContextMenu::Param params; FrameHostMsg_ContextMenu::Param params;
FrameHostMsg_ContextMenu::Read(&message, &params); FrameHostMsg_ContextMenu::Read(&message, &params);
content::UntrustworthyContextMenuParams menu_params = std::get<0>(params); UntrustworthyContextMenuParams menu_params = std::get<0>(params);
content::GetUIThreadTaskRunner({})->PostTask( GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&ContextMenuFilter::OnContextMenu, this, menu_params)); base::BindOnce(&ContextMenuFilter::OnContextMenu, this, menu_params));
} }
...@@ -3257,7 +3244,7 @@ bool ContextMenuFilter::OnMessageReceived(const IPC::Message& message) { ...@@ -3257,7 +3244,7 @@ bool ContextMenuFilter::OnMessageReceived(const IPC::Message& message) {
} }
void ContextMenuFilter::Wait() { void ContextMenuFilter::Wait() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
run_loop_->Run(); run_loop_->Run();
run_loop_ = nullptr; run_loop_ = nullptr;
} }
...@@ -3266,7 +3253,7 @@ ContextMenuFilter::~ContextMenuFilter() = default; ...@@ -3266,7 +3253,7 @@ ContextMenuFilter::~ContextMenuFilter() = default;
void ContextMenuFilter::OnContextMenu( void ContextMenuFilter::OnContextMenu(
const content::UntrustworthyContextMenuParams& params) { const content::UntrustworthyContextMenuParams& params) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
last_params_ = params; last_params_ = params;
std::move(quit_closure_).Run(); std::move(quit_closure_).Run();
} }
...@@ -3307,7 +3294,7 @@ void UpdateUserActivationStateInterceptor::UpdateUserActivationState( ...@@ -3307,7 +3294,7 @@ void UpdateUserActivationStateInterceptor::UpdateUserActivationState(
WebContents* GetEmbedderForGuest(content::WebContents* guest) { WebContents* GetEmbedderForGuest(content::WebContents* guest) {
CHECK(guest); CHECK(guest);
return static_cast<content::WebContentsImpl*>(guest)->GetOuterWebContents(); return static_cast<WebContentsImpl*>(guest)->GetOuterWebContents();
} }
namespace { namespace {
...@@ -3326,7 +3313,7 @@ int LoadBasicRequest( ...@@ -3326,7 +3313,7 @@ int LoadBasicRequest(
// Allow access to SameSite cookies in tests. // Allow access to SameSite cookies in tests.
request->site_for_cookies = net::SiteForCookies::FromUrl(url); request->site_for_cookies = net::SiteForCookies::FromUrl(url);
content::SimpleURLLoaderTestHelper simple_loader_helper; SimpleURLLoaderTestHelper simple_loader_helper;
std::unique_ptr<network::SimpleURLLoader> simple_loader = std::unique_ptr<network::SimpleURLLoader> simple_loader =
network::SimpleURLLoader::Create(std::move(request), network::SimpleURLLoader::Create(std::move(request),
TRAFFIC_ANNOTATION_FOR_TESTS); TRAFFIC_ANNOTATION_FOR_TESTS);
...@@ -3440,7 +3427,7 @@ bool TestGuestAutoresize(RenderProcessHost* embedder_rph, ...@@ -3440,7 +3427,7 @@ bool TestGuestAutoresize(RenderProcessHost* embedder_rph,
SynchronizeVisualPropertiesMessageFilter:: SynchronizeVisualPropertiesMessageFilter::
SynchronizeVisualPropertiesMessageFilter() SynchronizeVisualPropertiesMessageFilter()
: content::BrowserMessageFilter(FrameMsgStart), : BrowserMessageFilter(FrameMsgStart),
screen_space_rect_run_loop_(std::make_unique<base::RunLoop>()), screen_space_rect_run_loop_(std::make_unique<base::RunLoop>()),
screen_space_rect_received_(false), screen_space_rect_received_(false),
pinch_gesture_active_set_(false), pinch_gesture_active_set_(false),
...@@ -3453,7 +3440,7 @@ void SynchronizeVisualPropertiesMessageFilter::WaitForRect() { ...@@ -3453,7 +3440,7 @@ void SynchronizeVisualPropertiesMessageFilter::WaitForRect() {
void SynchronizeVisualPropertiesMessageFilter::ResetRectRunLoop() { void SynchronizeVisualPropertiesMessageFilter::ResetRectRunLoop() {
last_rect_ = gfx::Rect(); last_rect_ = gfx::Rect();
screen_space_rect_run_loop_.reset(new base::RunLoop); screen_space_rect_run_loop_ = std::make_unique<base::RunLoop>();
screen_space_rect_received_ = false; screen_space_rect_received_ = false;
} }
...@@ -3465,7 +3452,7 @@ viz::FrameSinkId SynchronizeVisualPropertiesMessageFilter::GetOrWaitForId() { ...@@ -3465,7 +3452,7 @@ viz::FrameSinkId SynchronizeVisualPropertiesMessageFilter::GetOrWaitForId() {
viz::LocalSurfaceId viz::LocalSurfaceId
SynchronizeVisualPropertiesMessageFilter::WaitForSurfaceId() { SynchronizeVisualPropertiesMessageFilter::WaitForSurfaceId() {
surface_id_run_loop_.reset(new base::RunLoop); surface_id_run_loop_ = std::make_unique<base::RunLoop>();
surface_id_run_loop_->Run(); surface_id_run_loop_->Run();
return last_surface_id_; return last_surface_id_;
} }
...@@ -3508,14 +3495,14 @@ void SynchronizeVisualPropertiesMessageFilter::OnSynchronizeVisualProperties( ...@@ -3508,14 +3495,14 @@ void SynchronizeVisualPropertiesMessageFilter::OnSynchronizeVisualProperties(
1.f / visual_properties.screen_info.device_scale_factor)); 1.f / visual_properties.screen_info.device_scale_factor));
} }
// Track each rect updates. // Track each rect updates.
content::GetUIThreadTaskRunner({})->PostTask( GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&SynchronizeVisualPropertiesMessageFilter::OnUpdatedFrameRectOnUI, &SynchronizeVisualPropertiesMessageFilter::OnUpdatedFrameRectOnUI,
this, screen_space_rect_in_dip)); this, screen_space_rect_in_dip));
// Track each surface id update. // Track each surface id update.
content::GetUIThreadTaskRunner({})->PostTask( GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&SynchronizeVisualPropertiesMessageFilter::OnUpdatedSurfaceIdOnUI, &SynchronizeVisualPropertiesMessageFilter::OnUpdatedSurfaceIdOnUI,
...@@ -3534,7 +3521,7 @@ void SynchronizeVisualPropertiesMessageFilter::OnSynchronizeVisualProperties( ...@@ -3534,7 +3521,7 @@ void SynchronizeVisualPropertiesMessageFilter::OnSynchronizeVisualProperties(
// We can't nest on the IO thread. So tests will wait on the UI thread, so // We can't nest on the IO thread. So tests will wait on the UI thread, so
// post there to exit the nesting. // post there to exit the nesting.
content::GetUIThreadTaskRunner({})->PostTask( GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&SynchronizeVisualPropertiesMessageFilter::OnUpdatedFrameSinkIdOnUI, &SynchronizeVisualPropertiesMessageFilter::OnUpdatedFrameSinkIdOnUI,
...@@ -3658,7 +3645,7 @@ bool CompareWebContentsOutputToReference( ...@@ -3658,7 +3645,7 @@ bool CompareWebContentsOutputToReference(
run_loop.Run(); run_loop.Run();
} }
content::RenderWidgetHostImpl* rwh = content::RenderWidgetHostImpl::From( auto* rwh = RenderWidgetHostImpl::From(
web_contents->GetRenderViewHost()->GetWidget()); web_contents->GetRenderViewHost()->GetWidget());
if (!rwh->GetView() || !rwh->GetView()->IsSurfaceAvailableForCopy()) { if (!rwh->GetView() || !rwh->GetView()->IsSurfaceAvailableForCopy()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment