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

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

Issue 2839633003: Consider empty url case when loading image (Closed)
Patch Set: added unit test Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698