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

Unified Diff: third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp

Issue 2907663004: FrameTree::Find only searches relative to local frames. (Closed)
Patch Set: . Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp b/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp
index de6d7918fc3d9527043b77253d598947ef73d23c..dc44385354b0f1284ffb9dea4e3e01098cc4d172 100644
--- a/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp
+++ b/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp
@@ -66,11 +66,14 @@ class LayoutGeometryMapTest
static LayoutBox* GetFrameElement(const char* iframe_name,
WebView* web_view,
const WTF::AtomicString& element_id) {
- WebLocalFrameImpl* iframe = ToWebLocalFrameImpl(
- web_view->FindFrameByName(WebString::FromUTF8(iframe_name)));
- if (!iframe)
+ if (!web_view->MainFrame()->IsWebLocalFrame())
dcheng 2017/05/26 18:28:05 As this is a unit test, you can cheat and just use
Łukasz Anforowicz 2017/05/26 20:04:05 Done (I think, I hope I've correctly understood wh
dcheng 2017/05/26 20:16:19 Ah.... the problem is this test isn't plumbing thi
return nullptr;
- LocalFrame* frame = iframe->GetFrame();
+ WebFrame* iframe =
+ web_view->MainFrame()->ToWebLocalFrame()->FindFrameByName(
+ WebString::FromUTF8(iframe_name));
+ if (!iframe || !iframe->IsWebLocalFrame())
+ return nullptr;
+ LocalFrame* frame = ToWebLocalFrameImpl(iframe)->GetFrame();
Document* doc = frame->GetDocument();
Element* element = doc->getElementById(element_id);
if (!element)

Powered by Google App Engine
This is Rietveld 408576698