Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
index 17a956bca081debcdd4b2a511b271d45d8b38b36..6817b7163fe98ce4be53e3d771ae2348a00816f1 100644 |
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
@@ -12003,4 +12003,26 @@ TEST_F(WebFrameTest, FallbackForNonexistentProvisionalNavigation) { |
child->MaybeRenderFallbackContent(WebURLError())); |
} |
+TEST_F(WebFrameTest, AltTextOnAboutBlankPage) { |
+ FrameTestHelpers::WebViewHelper web_view_helper; |
+ web_view_helper.Initialize(); |
+ // We set the size because it impacts line wrapping, which changes the |
+ // resulting text value. |
+ web_view_helper.Resize(WebSize(640, 480)); |
+ WebViewImpl* web_view = web_view_helper.WebView(); |
+ InitializeWithHTML(*web_view->MainFrameImpl()->GetFrame(), |
+ "<!DOCTYPE html>" |
+ "<img src='foo' alt='foo' width='200' height='200'>"); |
+ |
+ web_view->UpdateAllLifecyclePhases(); |
+ RunPendingTasks(); |
+ |
+ // Make sure it fails to load image and shows alt text. |
+ std::string text = WebFrameContentDumper::DumpLayoutTreeAsText( |
Nate Chapin
2017/05/02 22:58:03
String text = ToWebLocalFrameImpl(web_view->MainFr
|
+ web_view->MainFrame()->ToWebLocalFrame(), |
+ WebFrameContentDumper::kLayoutAsTextPrinting) |
+ .Utf8(); |
+ EXPECT_NE(std::string::npos, text.find("foo")); |
+} |
+ |
} // namespace blink |