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 void TearDown() override {} | |
tkent
2016/12/15 01:29:11
Remove this line. You don't need to override it.
lpy
2016/12/15 01:30:36
Done.
| |
20 Document& document() const { return m_dummyPageHolder->document(); } | |
21 | |
22 private: | |
23 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | |
24 }; | |
25 | |
26 void HTMLLinkElementTest::SetUp() { | |
27 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); | |
28 } | |
29 | |
30 // This tests that we should ignore empty string value | |
31 // in href attribute value of the link element. | |
32 TEST_F(HTMLLinkElementTest, EmptyHrefAttribute) { | |
33 document().documentElement()->setInnerHTML( | |
34 "<head>" | |
35 "<link rel=\"icon\" type=\"image/ico\" href=\"\" />" | |
36 "</head>"); | |
37 HTMLLinkElement* linkElement = | |
38 toElement<HTMLLinkElement>(document().head()->firstChild()); | |
39 EXPECT_EQ(KURL(), linkElement->href()); | |
40 } | |
41 | |
42 } // namespace blink | |
OLD | NEW |