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

Side by Side Diff: Source/core/layout/LayoutThemeTest.cpp

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutTestHelper.cpp ('k') | Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/layout/LayoutTheme.h" 6 #include "core/layout/LayoutTheme.h"
7 7
8 #include "core/dom/NodeComputedStyle.h" 8 #include "core/dom/NodeComputedStyle.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/html/HTMLDocument.h" 10 #include "core/html/HTMLDocument.h"
(...skipping 24 matching lines...) Expand all
35 void LayoutThemeTest::SetUp() 35 void LayoutThemeTest::SetUp()
36 { 36 {
37 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 37 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
38 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 38 m_document = toHTMLDocument(&m_dummyPageHolder->document());
39 ASSERT(m_document); 39 ASSERT(m_document);
40 } 40 }
41 41
42 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent) 42 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent)
43 { 43 {
44 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent), AS SERT_NO_EXCEPTION); 44 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent), AS SERT_NO_EXCEPTION);
45 document().view()->updateLayoutAndStyleIfNeededRecursive(); 45 document().view()->updateLayoutAndStyleForPainting();
46 } 46 }
47 47
48 inline Color outlineColor(Element* element) 48 inline Color outlineColor(Element* element)
49 { 49 {
50 return element->computedStyle()->visitedDependentColor(CSSPropertyOutlineCol or); 50 return element->computedStyle()->visitedDependentColor(CSSPropertyOutlineCol or);
51 } 51 }
52 52
53 inline EBorderStyle outlineStyle(Element* element) 53 inline EBorderStyle outlineStyle(Element* element)
54 { 54 {
55 return element->computedStyle()->outlineStyle(); 55 return element->computedStyle()->outlineStyle();
(...skipping 10 matching lines...) Expand all
66 Color customColor = makeRGB(123, 145, 167); 66 Color customColor = makeRGB(123, 145, 167);
67 67
68 // Checking unfocused style. 68 // Checking unfocused style.
69 EXPECT_EQ(BNONE, outlineStyle(span)); 69 EXPECT_EQ(BNONE, outlineStyle(span));
70 EXPECT_NE(customColor, outlineColor(span)); 70 EXPECT_NE(customColor, outlineColor(span));
71 71
72 // Do focus. 72 // Do focus.
73 document().page()->focusController().setActive(true); 73 document().page()->focusController().setActive(true);
74 document().page()->focusController().setFocused(true); 74 document().page()->focusController().setFocused(true);
75 span->focus(); 75 span->focus();
76 document().view()->updateLayoutAndStyleIfNeededRecursive(); 76 document().view()->updateLayoutAndStyleForPainting();
77 77
78 // Checking focused style. 78 // Checking focused style.
79 EXPECT_NE(BNONE, outlineStyle(span)); 79 EXPECT_NE(BNONE, outlineStyle(span));
80 EXPECT_NE(customColor, outlineColor(span)); 80 EXPECT_NE(customColor, outlineColor(span));
81 81
82 // Change focus ring color. 82 // Change focus ring color.
83 LayoutTheme::theme().setCustomFocusRingColor(customColor); 83 LayoutTheme::theme().setCustomFocusRingColor(customColor);
84 Page::platformColorsChanged(); 84 Page::platformColorsChanged();
85 document().view()->updateLayoutAndStyleIfNeededRecursive(); 85 document().view()->updateLayoutAndStyleForPainting();
86 86
87 // Check that the focus ring color is updated. 87 // Check that the focus ring color is updated.
88 EXPECT_NE(BNONE, outlineStyle(span)); 88 EXPECT_NE(BNONE, outlineStyle(span));
89 EXPECT_EQ(customColor, outlineColor(span)); 89 EXPECT_EQ(customColor, outlineColor(span));
90 } 90 }
91 91
92 } 92 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTestHelper.cpp ('k') | Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698