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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp

Issue 2575273002: Fix empty href for favicon link element causing page to be fetched twice. (Closed)
Patch Set: Update test Created 4 years 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/html/HTMLLinkElement.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/core/html/HTMLLinkElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e73be25c1dd85f36c9a00295a79941477091d30f
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/html/HTMLLinkElement.h"
+
+#include "core/dom/Document.h"
+#include "core/frame/FrameView.h"
+#include "core/html/HTMLHeadElement.h"
+#include "core/testing/DummyPageHolder.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+class HTMLLinkElementTest : public ::testing::Test {
+ protected:
+ void SetUp() override;
+ Document& document() const { return m_dummyPageHolder->document(); }
+
+ private:
+ std::unique_ptr<DummyPageHolder> m_dummyPageHolder;
+};
+
+void HTMLLinkElementTest::SetUp() {
+ m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
+}
+
+// This tests that we should ignore empty string value
+// in href attribute value of the link element.
+TEST_F(HTMLLinkElementTest, EmptyHrefAttribute) {
+ document().documentElement()->setInnerHTML(
+ "<head>"
+ "<link rel=\"icon\" type=\"image/ico\" href=\"\" />"
+ "</head>");
+ HTMLLinkElement* linkElement =
+ toElement<HTMLLinkElement>(document().head()->firstChild());
+ EXPECT_EQ(KURL(), linkElement->href());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698