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

Side by Side Diff: content/public/test/test_frame_navigation_observer.cc

Issue 2523583003: Fix some flaky tests. (Closed)
Patch Set: Undo change in DOMMessageQueue. Created 4 years 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/browser/site_per_process_browsertest.cc ('k') | content/public/test/test_utils.h » ('j') | 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/public/test/test_frame_navigation_observer.h" 5 #include "content/public/test/test_frame_navigation_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 15 matching lines...) Expand all
26 } // namespace 26 } // namespace
27 27
28 TestFrameNavigationObserver::TestFrameNavigationObserver( 28 TestFrameNavigationObserver::TestFrameNavigationObserver(
29 const ToRenderFrameHost& adapter) 29 const ToRenderFrameHost& adapter)
30 : WebContentsObserver( 30 : WebContentsObserver(
31 ToRenderFrameHostImpl(adapter)->delegate()->GetAsWebContents()), 31 ToRenderFrameHostImpl(adapter)->delegate()->GetAsWebContents()),
32 frame_tree_node_id_(ToRenderFrameHostImpl(adapter)->GetFrameTreeNodeId()), 32 frame_tree_node_id_(ToRenderFrameHostImpl(adapter)->GetFrameTreeNodeId()),
33 navigation_started_(false), 33 navigation_started_(false),
34 has_committed_(false), 34 has_committed_(false),
35 wait_for_commit_(false), 35 wait_for_commit_(false),
36 message_loop_runner_(new MessageLoopRunner) { 36 message_loop_runner_(
37 new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE)) {
37 DCHECK_CURRENTLY_ON(BrowserThread::UI); 38 DCHECK_CURRENTLY_ON(BrowserThread::UI);
38 } 39 }
39 40
40 TestFrameNavigationObserver::~TestFrameNavigationObserver() {} 41 TestFrameNavigationObserver::~TestFrameNavigationObserver() {}
41 42
42 void TestFrameNavigationObserver::Wait() { 43 void TestFrameNavigationObserver::Wait() {
43 DCHECK_CURRENTLY_ON(BrowserThread::UI); 44 DCHECK_CURRENTLY_ON(BrowserThread::UI);
44 wait_for_commit_ = false; 45 wait_for_commit_ = false;
45 message_loop_runner_->Run(); 46 message_loop_runner_->Run();
46 } 47 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 void TestFrameNavigationObserver::DidStopLoading() { 89 void TestFrameNavigationObserver::DidStopLoading() {
89 if (!navigation_started_) 90 if (!navigation_started_)
90 return; 91 return;
91 92
92 navigation_started_ = false; 93 navigation_started_ = false;
93 message_loop_runner_->Quit(); 94 message_loop_runner_->Quit();
94 } 95 }
95 96
96 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/public/test/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698