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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 "core/css/StyleSheetContents.h" 7 #include "core/css/StyleSheetContents.h"
8 #include "core/dom/Comment.h" 8 #include "core/dom/Comment.h"
9 #include "core/html/HTMLStyleElement.h" 9 #include "core/html/HTMLStyleElement.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 TEST(StyleElementTest, CreateSheetUsesCache) 15 TEST(StyleElementTest, CreateSheetUsesCache)
16 { 16 {
17 OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(80 0, 600)); 17 OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(80 0, 600));
18 Document& document = dummyPageHolder->document(); 18 Document& document = dummyPageHolder->document();
19 19
20 document.documentElement()->setInnerHTML("<style id=style>a { top: 0; }</sty le>", ASSERT_NO_EXCEPTION); 20 document.documentElement()->setInnerHTML("<style id=style>a { top: 0; }</sty le>", ASSERT_NO_EXCEPTION);
21 21
22 HTMLStyleElement& styleElement = toHTMLStyleElement(*document.getElementById ("style")); 22 HTMLStyleElement& styleElement = toHTMLStyleElement(*document.getElementById ("style"));
23 RefPtrWillBeRawPtr<StyleSheetContents> sheet = styleElement.sheet()->content s(); 23 RawPtr<StyleSheetContents> sheet = styleElement.sheet()->contents();
24 24
25 RefPtrWillBeRawPtr<Comment> comment = document.createComment("hello!"); 25 RawPtr<Comment> comment = document.createComment("hello!");
26 styleElement.appendChild(comment); 26 styleElement.appendChild(comment);
27 EXPECT_EQ(styleElement.sheet()->contents(), sheet); 27 EXPECT_EQ(styleElement.sheet()->contents(), sheet);
28 28
29 styleElement.removeChild(comment); 29 styleElement.removeChild(comment);
30 EXPECT_EQ(styleElement.sheet()->contents(), sheet); 30 EXPECT_EQ(styleElement.sheet()->contents(), sheet);
31 } 31 }
32 32
33 } // namespace blink 33 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleElement.cpp ('k') | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698