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

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

Issue 2601843002: Convert more test helpers to base::RunLoop, fix page title checks. (Closed)
Patch Set: Remove unneeded call. 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
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)) {
384 } 382 }
385 383
386 UrlCommitObserver::~UrlCommitObserver() {} 384 UrlCommitObserver::~UrlCommitObserver() {}
387 385
388 void UrlCommitObserver::Wait() { 386 void UrlCommitObserver::Wait() {
389 message_loop_runner_->Run(); 387 run_loop_.Run();
390 } 388 }
391 389
392 void UrlCommitObserver::DidFinishNavigation( 390 void UrlCommitObserver::DidFinishNavigation(
393 NavigationHandle* navigation_handle) { 391 NavigationHandle* navigation_handle) {
394 if (navigation_handle->HasCommitted() && 392 if (navigation_handle->HasCommitted() &&
395 !navigation_handle->IsErrorPage() && 393 !navigation_handle->IsErrorPage() &&
396 navigation_handle->GetURL() == url_ && 394 navigation_handle->GetURL() == url_ &&
397 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) { 395 navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) {
398 message_loop_runner_->Quit(); 396 run_loop_.Quit();
399 } 397 }
400 } 398 }
401 399
402 } // namespace content 400 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698