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

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

Issue 2561043002: Clean-up after Form Association Refactoring (Closed)
Patch Set: Removed constructorNeedsFormElement from scripts and HTMLTagNames 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/HTMLOutputElement.h" 5 #include "core/html/HTMLOutputElement.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/DOMTokenList.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 TEST(HTMLLinkElementSizesAttributeTest, 14 TEST(HTMLLinkElementSizesAttributeTest,
15 setHTMLForProperty_updatesForAttribute) { 15 setHTMLForProperty_updatesForAttribute) {
16 Document* document = Document::create(); 16 Document* document = Document::create();
17 HTMLOutputElement* element = 17 HTMLOutputElement* element = HTMLOutputElement::create(*document);
18 HTMLOutputElement::create(*document, /* form: */ nullptr);
19 EXPECT_EQ(nullAtom, element->getAttribute(HTMLNames::forAttr)); 18 EXPECT_EQ(nullAtom, element->getAttribute(HTMLNames::forAttr));
20 element->htmlFor()->setValue(" strawberry "); 19 element->htmlFor()->setValue(" strawberry ");
21 EXPECT_EQ(" strawberry ", element->getAttribute(HTMLNames::forAttr)); 20 EXPECT_EQ(" strawberry ", element->getAttribute(HTMLNames::forAttr));
22 } 21 }
23 22
24 TEST(HTMLOutputElementTest, setForAttribute_updatesHTMLForPropertyValue) { 23 TEST(HTMLOutputElementTest, setForAttribute_updatesHTMLForPropertyValue) {
25 Document* document = Document::create(); 24 Document* document = Document::create();
26 HTMLOutputElement* element = HTMLOutputElement::create(*document, nullptr); 25 HTMLOutputElement* element = HTMLOutputElement::create(*document);
27 DOMTokenList* forTokens = element->htmlFor(); 26 DOMTokenList* forTokens = element->htmlFor();
28 EXPECT_EQ(nullAtom, forTokens->value()); 27 EXPECT_EQ(nullAtom, forTokens->value());
29 element->setAttribute(HTMLNames::forAttr, "orange grape"); 28 element->setAttribute(HTMLNames::forAttr, "orange grape");
30 EXPECT_EQ("orange grape", forTokens->value()); 29 EXPECT_EQ("orange grape", forTokens->value());
31 } 30 }
32 31
33 } // namespace blink 32 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLOutputElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698