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

Unified Diff: content/public/test/test_frame_navigation_observer.cc

Issue 2478583005: Browser tests for starting a drag-and-drop out of an OOPIF. (Closed)
Patch Set: Rebasing... Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/test_frame_navigation_observer.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_frame_navigation_observer.cc
diff --git a/content/test/test_frame_navigation_observer.cc b/content/public/test/test_frame_navigation_observer.cc
similarity index 78%
rename from content/test/test_frame_navigation_observer.cc
rename to content/public/test/test_frame_navigation_observer.cc
index 002a987d46f3988e1320b82e5bfdbb5970e30d0e..e5a19430143f939ecdbe9c60fbccd033db06f137 100644
--- a/content/test/test_frame_navigation_observer.cc
+++ b/content/public/test/test_frame_navigation_observer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/test/test_frame_navigation_observer.h"
+#include "content/public/test/test_frame_navigation_observer.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
@@ -17,26 +17,37 @@
namespace content {
+namespace {
+
+RenderFrameHostImpl* ToRenderFrameHostImpl(const ToRenderFrameHost& frame) {
+ return static_cast<RenderFrameHostImpl*>(frame.render_frame_host());
+}
+
+} // namespace
+
TestFrameNavigationObserver::TestFrameNavigationObserver(
- FrameTreeNode* node)
+ const ToRenderFrameHost& adapter)
: WebContentsObserver(
- node->current_frame_host()->delegate()->GetAsWebContents()),
- frame_tree_node_id_(node->frame_tree_node_id()),
+ ToRenderFrameHostImpl(adapter)->delegate()->GetAsWebContents()),
+ frame_tree_node_id_(ToRenderFrameHostImpl(adapter)->GetFrameTreeNodeId()),
navigation_started_(false),
has_committed_(false),
wait_for_commit_(false),
message_loop_runner_(new MessageLoopRunner) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
-TestFrameNavigationObserver::~TestFrameNavigationObserver() {
-}
+TestFrameNavigationObserver::~TestFrameNavigationObserver() {}
void TestFrameNavigationObserver::Wait() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
wait_for_commit_ = false;
message_loop_runner_->Run();
}
void TestFrameNavigationObserver::WaitForCommit() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
if (has_committed_)
return;
« no previous file with comments | « content/public/test/test_frame_navigation_observer.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698