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

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 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
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