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

Side by Side Diff: content/test/content_browser_test_utils_internal.cc

Issue 2635933003: Convert more test helpers to base::RunLoop, fix page title checks. (Reland) (Closed)
Patch Set: Fix ClickModifierTests. Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « content/test/content_browser_test_utils_internal.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 return TestNavigationManager::ShouldMonitorNavigation(handle) && 372 return TestNavigationManager::ShouldMonitorNavigation(handle) &&
373 handle->GetFrameTreeNodeId() == filtering_frame_tree_node_id_; 373 handle->GetFrameTreeNodeId() == filtering_frame_tree_node_id_;
374 } 374 }
375 375
376 UrlCommitObserver::UrlCommitObserver(FrameTreeNode* frame_tree_node, 376 UrlCommitObserver::UrlCommitObserver(FrameTreeNode* frame_tree_node,
377 const GURL& url) 377 const GURL& url)
378 : content::WebContentsObserver(frame_tree_node->current_frame_host() 378 : content::WebContentsObserver(frame_tree_node->current_frame_host()
379 ->delegate() 379 ->delegate()
380 ->GetAsWebContents()), 380 ->GetAsWebContents()),
381 frame_tree_node_id_(frame_tree_node->frame_tree_node_id()), 381 frame_tree_node_id_(frame_tree_node->frame_tree_node_id()),
382 url_(url), 382 url_(url) {
383 message_loop_runner_(
384 new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE)) {
385 } 383 }
386 384
387 UrlCommitObserver::~UrlCommitObserver() {} 385 UrlCommitObserver::~UrlCommitObserver() {}
388 386
389 void UrlCommitObserver::Wait() { 387 void UrlCommitObserver::Wait() {
390 message_loop_runner_->Run(); 388 run_loop_.Run();
391 } 389 }
392 390
393 void UrlCommitObserver::DidFinishNavigation( 391 void UrlCommitObserver::DidFinishNavigation(
394 NavigationHandle* navigation_handle) { 392 NavigationHandle* navigation_handle) {
395 if (navigation_handle->HasCommitted() && 393 if (navigation_handle->HasCommitted() &&
396 !navigation_handle->IsErrorPage() && 394 !navigation_handle->IsErrorPage() &&
397 navigation_handle->GetURL() == url_ && 395 navigation_handle->GetURL() == url_ &&
398 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) { 396 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) {
399 message_loop_runner_->Quit(); 397 run_loop_.Quit();
400 } 398 }
401 } 399 }
402 400
403 } // namespace content 401 } // namespace content
OLDNEW
« 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