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

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

Issue 2839633003: Consider empty url case when loading image (Closed)
Patch Set: Consider empty url case when loading image 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 0cc79443ce04832706b604e4c999995648191ddb..0ab9d672b780aff66a6c1fa9488d6d545aa80287 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -12153,4 +12153,33 @@ TEST_F(WebFrameTest, FallbackForNonexistentProvisionalNavigation) {
child->MaybeRenderFallbackContent(WebURLError()));
}
+TEST_F(WebFrameTest, AltTextOnAboutBlankPage) {
+ FrameTestHelpers::WebViewHelper web_view_helper;
+ web_view_helper.InitializeAndLoad("about:blank", true);
+ web_view_helper.Resize(WebSize(640, 480));
+ WebLocalFrameImpl* frame = web_view_helper.WebView()->MainFrameImpl();
+
+ const char kSource[] =
+ "<img id='foo' src='foo' alt='foo alt' width='200' height='200'>";
+ FrameTestHelpers::LoadHTMLString(frame, kSource, ToKURL("about:blank"));
+ web_view_helper.WebView()->UpdateAllLifecyclePhases();
+ RunPendingTasks();
+
+ // Check LayoutText with alt text "foo alt"
+ LayoutObject* layout_object = frame->GetFrame()
+ ->GetDocument()
+ ->getElementById("foo")
+ ->GetLayoutObject()
+ ->SlowFirstChild();
+ String text = "";
+ for (LayoutObject* obj = layout_object; obj; obj = obj->NextInPreOrder()) {
+ if (obj->IsText()) {
+ LayoutText* layout_text = ToLayoutText(obj);
+ text = layout_text->GetText();
+ break;
+ }
+ }
+ EXPECT_EQ("foo alt", text.Utf8());
+}
+
} // 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