OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/html/HTMLLinkElement.h" |
| 6 |
| 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameView.h" |
| 9 #include "core/html/HTMLHeadElement.h" |
| 10 #include "core/testing/DummyPageHolder.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class HTMLLinkElementTest : public ::testing::Test { |
| 17 protected: |
| 18 void SetUp() override; |
| 19 Document& document() const { return m_dummyPageHolder->document(); } |
| 20 |
| 21 private: |
| 22 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
| 23 }; |
| 24 |
| 25 void HTMLLinkElementTest::SetUp() { |
| 26 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 27 } |
| 28 |
| 29 // This tests that we should ignore empty string value |
| 30 // in href attribute value of the link element. |
| 31 TEST_F(HTMLLinkElementTest, EmptyHrefAttribute) { |
| 32 document().documentElement()->setInnerHTML( |
| 33 "<head>" |
| 34 "<link rel=\"icon\" type=\"image/ico\" href=\"\" />" |
| 35 "</head>"); |
| 36 HTMLLinkElement* linkElement = |
| 37 toElement<HTMLLinkElement>(document().head()->firstChild()); |
| 38 EXPECT_EQ(KURL(), linkElement->href()); |
| 39 } |
| 40 |
| 41 } // namespace blink |
OLD | NEW |