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

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

Issue 2839633003: Consider empty url case when loading image (Closed)
Patch Set: rebased 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
« 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 2e19c34b6343c37505f54a993549a44954507241..71eaec310107c0000e53c81f789b9e7239f4c87a 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -12049,4 +12049,28 @@ TEST_F(WebFrameTest, FallbackForNonexistentProvisionalNavigation) {
child->MaybeRenderFallbackContent(WebURLError()));
}
+TEST_F(WebFrameTest, AltTextOnAboutBlankPage) {
+ FrameTestHelpers::WebViewHelper web_view_helper;
+ web_view_helper.InitializeAndLoad("about:blank", true);
+ // We set the size because it impacts line wrapping, which changes the
+ // resulting text value.
+ web_view_helper.Resize(WebSize(640, 480));
+
+ // Generate a simple test case.
+ const char kSource[] =
+ "<img src='foo' alt='foo alt' width='200' height='200'>";
+ FrameTestHelpers::LoadHTMLString(web_view_helper.WebView()->MainFrameImpl(),
+ kSource, ToKURL("about:blank"));
+
+ web_view_helper.WebView()->UpdateAllLifecyclePhases();
+ RunPendingTasks();
+
+ // Make sure it comes out OK.
+ std::string text = WebFrameContentDumper::DumpLayoutTreeAsText(
dmazzoni 2017/05/16 21:08:06 I think this is not a good fit for a unit test tha
dmazzoni 2017/05/16 21:10:43 Maybe I'm wrong - if accessing a LayoutObject is f
+ web_view_helper.WebView()->MainFrameImpl(),
+ WebFrameContentDumper::kLayoutAsTextPrinting)
+ .Utf8();
+ EXPECT_NE(std::string::npos, text.find("foo alt"));
+}
+
} // 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