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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« 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