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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp

Issue 1629403003: Merge DOMSettableTokensList into DOMTokensList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed non-oilpan inheritance Created 4 years, 10 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/HTMLLinkElement.h" 5 #include "core/html/HTMLLinkElement.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/DOMSettableTokenList.h" 8 #include "core/dom/DOMTokenList.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class HTMLLinkElementSizesAttributeTest : public testing::Test { 14 class HTMLLinkElementSizesAttributeTest : public testing::Test {
15 }; 15 };
16 16
17 TEST(HTMLLinkElementSizesAttributeTest, parseSizes) 17 TEST(HTMLLinkElementSizesAttributeTest, parseSizes)
18 { 18 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 sizesAttribute = "32x33, 64x64"; 71 sizesAttribute = "32x33, 64x64";
72 sizes.clear(); 72 sizes.clear();
73 HTMLLinkElement::parseSizesAttribute(sizesAttribute, sizes); 73 HTMLLinkElement::parseSizesAttribute(sizesAttribute, sizes);
74 ASSERT_EQ(0U, sizes.size()); 74 ASSERT_EQ(0U, sizes.size());
75 } 75 }
76 76
77 TEST(HTMLLinkElementSizesAttributeTest, setSizesPropertyValue_updatesAttribute) 77 TEST(HTMLLinkElementSizesAttributeTest, setSizesPropertyValue_updatesAttribute)
78 { 78 {
79 RefPtrWillBeRawPtr<Document> document = Document::create(); 79 RefPtrWillBeRawPtr<Document> document = Document::create();
80 RefPtrWillBeRawPtr<HTMLLinkElement> link = HTMLLinkElement::create(*document , /* createdByParser: */ false); 80 RefPtrWillBeRawPtr<HTMLLinkElement> link = HTMLLinkElement::create(*document , /* createdByParser: */ false);
81 RefPtrWillBeRawPtr<DOMSettableTokenList> sizes = link->sizes(); 81 RefPtrWillBeRawPtr<DOMTokenList> sizes = link->sizes();
82 EXPECT_EQ(nullAtom, sizes->value()); 82 EXPECT_EQ(nullAtom, sizes->value());
83 sizes->setValue(" a b c "); 83 sizes->setValue(" a b c ");
84 EXPECT_EQ(" a b c ", link->getAttribute(HTMLNames::sizesAttr)); 84 EXPECT_EQ(" a b c ", link->getAttribute(HTMLNames::sizesAttr));
85 EXPECT_EQ(" a b c ", sizes->value()); 85 EXPECT_EQ(" a b c ", sizes->value());
86 } 86 }
87 87
88 TEST(HTMLLinkElementSizesAttributeTest, setSizesAttribute_updatesSizesPropertyVa lue) 88 TEST(HTMLLinkElementSizesAttributeTest, setSizesAttribute_updatesSizesPropertyVa lue)
89 { 89 {
90 RefPtrWillBeRawPtr<Document> document = Document::create(); 90 RefPtrWillBeRawPtr<Document> document = Document::create();
91 RefPtrWillBeRawPtr<HTMLLinkElement> link = HTMLLinkElement::create(*document , /* createdByParser: */ false); 91 RefPtrWillBeRawPtr<HTMLLinkElement> link = HTMLLinkElement::create(*document , /* createdByParser: */ false);
92 RefPtrWillBeRawPtr<DOMSettableTokenList> sizes = link->sizes(); 92 RefPtrWillBeRawPtr<DOMTokenList> sizes = link->sizes();
93 EXPECT_EQ(nullAtom, sizes->value()); 93 EXPECT_EQ(nullAtom, sizes->value());
94 link->setAttribute(HTMLNames::sizesAttr, "y x "); 94 link->setAttribute(HTMLNames::sizesAttr, "y x ");
95 EXPECT_EQ("y x ", sizes->value()); 95 EXPECT_EQ("y x ", sizes->value());
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.idl ('k') | third_party/WebKit/Source/core/html/HTMLOutputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698