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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura_browsertest.cc

Issue 2052633002: Extend the ToRenderFrameHost magic to FrameTreeNode* and Shell* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix induced script bug. Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 std::unique_ptr<base::Value> value; 377 std::unique_ptr<base::Value> value;
378 value = content::ExecuteScriptAndGetValue(main_frame, "get_current()"); 378 value = content::ExecuteScriptAndGetValue(main_frame, "get_current()");
379 if (!value->GetAsInteger(&index)) 379 if (!value->GetAsInteger(&index))
380 index = -1; 380 index = -1;
381 return index; 381 return index;
382 } 382 }
383 383
384 int ExecuteScriptAndExtractInt(const std::string& script) { 384 int ExecuteScriptAndExtractInt(const std::string& script) {
385 int value = 0; 385 int value = 0;
386 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( 386 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
387 shell()->web_contents(), 387 shell(), "domAutomationController.send(" + script + ")", &value));
388 "domAutomationController.send(" + script + ")",
389 &value));
390 return value; 388 return value;
391 } 389 }
392 390
393 RenderViewHost* GetRenderViewHost() const { 391 RenderViewHost* GetRenderViewHost() const {
394 RenderViewHost* const rvh = shell()->web_contents()->GetRenderViewHost(); 392 RenderViewHost* const rvh = shell()->web_contents()->GetRenderViewHost();
395 CHECK(rvh); 393 CHECK(rvh);
396 return rvh; 394 return rvh;
397 } 395 }
398 396
399 RenderWidgetHostImpl* GetRenderWidgetHost() const { 397 RenderWidgetHostImpl* GetRenderWidgetHost() const {
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 details = dispatcher->OnEventFromSource(&release); 1127 details = dispatcher->OnEventFromSource(&release);
1130 ASSERT_FALSE(details.dispatcher_destroyed); 1128 ASSERT_FALSE(details.dispatcher_destroyed);
1131 WaitAFrame(); 1129 WaitAFrame();
1132 1130
1133 EXPECT_LT(0, tracker.num_overscroll_updates()); 1131 EXPECT_LT(0, tracker.num_overscroll_updates());
1134 EXPECT_FALSE(tracker.overscroll_completed()); 1132 EXPECT_FALSE(tracker.overscroll_completed());
1135 } 1133 }
1136 } 1134 }
1137 1135
1138 } // namespace content 1136 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698