Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 4355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4366 RegisterMockedHttpURLLoad("iframe_redirect.html"); | 4366 RegisterMockedHttpURLLoad("iframe_redirect.html"); |
| 4367 RegisterMockedHttpURLLoad("visible_iframe.html"); | 4367 RegisterMockedHttpURLLoad("visible_iframe.html"); |
| 4368 | 4368 |
| 4369 FrameTestHelpers::WebViewHelper web_view_helper; | 4369 FrameTestHelpers::WebViewHelper web_view_helper; |
| 4370 web_view_helper.InitializeAndLoad(base_url_ + "iframe_redirect.html", true); | 4370 web_view_helper.InitializeAndLoad(base_url_ + "iframe_redirect.html", true); |
| 4371 // Pump pending requests one more time. The test page loads script that | 4371 // Pump pending requests one more time. The test page loads script that |
| 4372 // navigates. | 4372 // navigates. |
| 4373 FrameTestHelpers::PumpPendingRequestsForFrameToLoad( | 4373 FrameTestHelpers::PumpPendingRequestsForFrameToLoad( |
| 4374 web_view_helper.WebView()->MainFrame()); | 4374 web_view_helper.WebView()->MainFrame()); |
| 4375 | 4375 |
| 4376 WebFrame* iframe = web_view_helper.WebView()->FindFrameByName( | 4376 WebFrame* iframe = web_view_helper.WebView() |
| 4377 WebString::FromUTF8("ifr"), nullptr); | 4377 ->MainFrame() |
| 4378 ->ToWebLocalFrame() | |
|
Łukasz Anforowicz
2017/05/26 16:38:40
ToWebLocalFrame above is okay, because otherwise t
dcheng
2017/05/26 18:28:06
Ditto to using MainFrameImpl() here
Łukasz Anforowicz
2017/05/26 20:04:05
Done (I think).
| |
| 4379 ->FindFrameByName(WebString::FromUTF8("ifr")); | |
| 4378 ASSERT_TRUE(iframe); | 4380 ASSERT_TRUE(iframe); |
| 4379 WebDataSource* iframe_data_source = iframe->DataSource(); | 4381 WebDataSource* iframe_data_source = iframe->DataSource(); |
| 4380 ASSERT_TRUE(iframe_data_source); | 4382 ASSERT_TRUE(iframe_data_source); |
| 4381 WebVector<WebURL> redirects; | 4383 WebVector<WebURL> redirects; |
| 4382 iframe_data_source->RedirectChain(redirects); | 4384 iframe_data_source->RedirectChain(redirects); |
| 4383 ASSERT_EQ(2U, redirects.size()); | 4385 ASSERT_EQ(2U, redirects.size()); |
| 4384 EXPECT_EQ(ToKURL("about:blank"), KURL(redirects[0])); | 4386 EXPECT_EQ(ToKURL("about:blank"), KURL(redirects[0])); |
| 4385 EXPECT_EQ(ToKURL("http://internal.test/visible_iframe.html"), | 4387 EXPECT_EQ(ToKURL("http://internal.test/visible_iframe.html"), |
| 4386 KURL(redirects[1])); | 4388 KURL(redirects[1])); |
| 4387 } | 4389 } |
| (...skipping 7789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12177 if (obj->IsText()) { | 12179 if (obj->IsText()) { |
| 12178 LayoutText* layout_text = ToLayoutText(obj); | 12180 LayoutText* layout_text = ToLayoutText(obj); |
| 12179 text = layout_text->GetText(); | 12181 text = layout_text->GetText(); |
| 12180 break; | 12182 break; |
| 12181 } | 12183 } |
| 12182 } | 12184 } |
| 12183 EXPECT_EQ("foo alt", text.Utf8()); | 12185 EXPECT_EQ("foo alt", text.Utf8()); |
| 12184 } | 12186 } |
| 12185 | 12187 |
| 12186 } // namespace blink | 12188 } // namespace blink |
| OLD | NEW |