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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleElementTest.cpp

Issue 2941893002: DO NOT SUBMIT: results of old clang-format (Closed)
Patch Set: Created 3 years, 6 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 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/dom/StyleElement.h" 5 #include "core/dom/StyleElement.h"
6 6
7 #include <memory>
7 #include "core/css/StyleSheetContents.h" 8 #include "core/css/StyleSheetContents.h"
8 #include "core/dom/Comment.h" 9 #include "core/dom/Comment.h"
9 #include "core/html/HTMLStyleElement.h" 10 #include "core/html/HTMLStyleElement.h"
10 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 #include <memory>
13 13
14 namespace blink { 14 namespace blink {
15 15
16 TEST(StyleElementTest, CreateSheetUsesCache) { 16 TEST(StyleElementTest, CreateSheetUsesCache) {
17 std::unique_ptr<DummyPageHolder> dummy_page_holder = 17 std::unique_ptr<DummyPageHolder> dummy_page_holder =
18 DummyPageHolder::Create(IntSize(800, 600)); 18 DummyPageHolder::Create(IntSize(800, 600));
19 Document& document = dummy_page_holder->GetDocument(); 19 Document& document = dummy_page_holder->GetDocument();
20 20
21 document.documentElement()->setInnerHTML( 21 document.documentElement()->setInnerHTML(
22 "<style id=style>a { top: 0; }</style>"); 22 "<style id=style>a { top: 0; }</style>");
23 23
24 HTMLStyleElement& style_element = 24 HTMLStyleElement& style_element =
25 toHTMLStyleElement(*document.getElementById("style")); 25 toHTMLStyleElement(*document.getElementById("style"));
26 StyleSheetContents* sheet = style_element.sheet()->Contents(); 26 StyleSheetContents* sheet = style_element.sheet()->Contents();
27 27
28 Comment* comment = document.createComment("hello!"); 28 Comment* comment = document.createComment("hello!");
29 style_element.AppendChild(comment); 29 style_element.AppendChild(comment);
30 EXPECT_EQ(style_element.sheet()->Contents(), sheet); 30 EXPECT_EQ(style_element.sheet()->Contents(), sheet);
31 31
32 style_element.RemoveChild(comment); 32 style_element.RemoveChild(comment);
33 EXPECT_EQ(style_element.sheet()->Contents(), sheet); 33 EXPECT_EQ(style_element.sheet()->Contents(), sheet);
34 } 34 }
35 35
36 } // namespace blink 36 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NthIndexCacheTest.cpp ('k') | third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698