Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 void TearDown() override { | 59 void TearDown() override { |
| 60 Platform::Current() | 60 Platform::Current() |
| 61 ->GetURLLoaderMockFactory() | 61 ->GetURLLoaderMockFactory() |
| 62 ->UnregisterAllURLsAndClearMemoryCache(); | 62 ->UnregisterAllURLsAndClearMemoryCache(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 static LayoutBox* GetFrameElement(const char* iframe_name, | 66 static LayoutBox* GetFrameElement(const char* iframe_name, |
| 67 WebView* web_view, | 67 WebView* web_view, |
| 68 const WTF::AtomicString& element_id) { | 68 const WTF::AtomicString& element_id) { |
| 69 WebLocalFrameImpl* iframe = ToWebLocalFrameImpl( | 69 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
| |
| 70 web_view->FindFrameByName(WebString::FromUTF8(iframe_name))); | |
| 71 if (!iframe) | |
| 72 return nullptr; | 70 return nullptr; |
| 73 LocalFrame* frame = iframe->GetFrame(); | 71 WebFrame* iframe = |
| 72 web_view->MainFrame()->ToWebLocalFrame()->FindFrameByName( | |
| 73 WebString::FromUTF8(iframe_name)); | |
| 74 if (!iframe || !iframe->IsWebLocalFrame()) | |
| 75 return nullptr; | |
| 76 LocalFrame* frame = ToWebLocalFrameImpl(iframe)->GetFrame(); | |
| 74 Document* doc = frame->GetDocument(); | 77 Document* doc = frame->GetDocument(); |
| 75 Element* element = doc->getElementById(element_id); | 78 Element* element = doc->getElementById(element_id); |
| 76 if (!element) | 79 if (!element) |
| 77 return nullptr; | 80 return nullptr; |
| 78 return element->GetLayoutBox(); | 81 return element->GetLayoutBox(); |
| 79 } | 82 } |
| 80 | 83 |
| 81 static Element* GetElement(WebView* web_view, | 84 static Element* GetElement(WebView* web_view, |
| 82 const WTF::AtomicString& element_id) { | 85 const WTF::AtomicString& element_id) { |
| 83 WebViewBase* web_view_impl = static_cast<WebViewBase*>(web_view); | 86 WebViewBase* web_view_impl = static_cast<WebViewBase*>(web_view); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), | 532 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), |
| 530 RectFromQuad(rgm.MapToAncestor(rect, nullptr))); | 533 RectFromQuad(rgm.MapToAncestor(rect, nullptr))); |
| 531 | 534 |
| 532 rgm.PushMappingsToAncestor(floating, span); | 535 rgm.PushMappingsToAncestor(floating, span); |
| 533 EXPECT_EQ(rect, RectFromQuad(rgm.MapToAncestor(rect, container))); | 536 EXPECT_EQ(rect, RectFromQuad(rgm.MapToAncestor(rect, container))); |
| 534 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), | 537 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), |
| 535 RectFromQuad(rgm.MapToAncestor(rect, nullptr))); | 538 RectFromQuad(rgm.MapToAncestor(rect, nullptr))); |
| 536 } | 539 } |
| 537 | 540 |
| 538 } // namespace blink | 541 } // namespace blink |
| OLD | NEW |