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

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

Issue 2630683003: Revert of Convert more test helpers to base::RunLoop, fix page title checks. (Closed)
Patch Set: 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return TestNavigationManager::ShouldMonitorNavigation(handle) && 371 return TestNavigationManager::ShouldMonitorNavigation(handle) &&
372 handle->GetFrameTreeNodeId() == filtering_frame_tree_node_id_; 372 handle->GetFrameTreeNodeId() == filtering_frame_tree_node_id_;
373 } 373 }
374 374
375 UrlCommitObserver::UrlCommitObserver(FrameTreeNode* frame_tree_node, 375 UrlCommitObserver::UrlCommitObserver(FrameTreeNode* frame_tree_node,
376 const GURL& url) 376 const GURL& url)
377 : content::WebContentsObserver(frame_tree_node->current_frame_host() 377 : content::WebContentsObserver(frame_tree_node->current_frame_host()
378 ->delegate() 378 ->delegate()
379 ->GetAsWebContents()), 379 ->GetAsWebContents()),
380 frame_tree_node_id_(frame_tree_node->frame_tree_node_id()), 380 frame_tree_node_id_(frame_tree_node->frame_tree_node_id()),
381 url_(url) { 381 url_(url),
382 message_loop_runner_(
383 new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE)) {
382 } 384 }
383 385
384 UrlCommitObserver::~UrlCommitObserver() {} 386 UrlCommitObserver::~UrlCommitObserver() {}
385 387
386 void UrlCommitObserver::Wait() { 388 void UrlCommitObserver::Wait() {
387 run_loop_.Run(); 389 message_loop_runner_->Run();
388 } 390 }
389 391
390 void UrlCommitObserver::DidFinishNavigation( 392 void UrlCommitObserver::DidFinishNavigation(
391 NavigationHandle* navigation_handle) { 393 NavigationHandle* navigation_handle) {
392 if (navigation_handle->HasCommitted() && 394 if (navigation_handle->HasCommitted() &&
393 !navigation_handle->IsErrorPage() && 395 !navigation_handle->IsErrorPage() &&
394 navigation_handle->GetURL() == url_ && 396 navigation_handle->GetURL() == url_ &&
395 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) { 397 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) {
396 run_loop_.Quit(); 398 message_loop_runner_->Quit();
397 } 399 }
398 } 400 }
399 401
400 } // namespace content 402 } // 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