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

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

Issue 1216543005: Revert of Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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.h » ('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 21 matching lines...) Expand all
32 void LayoutThemeTest::SetUp() 32 void LayoutThemeTest::SetUp()
33 { 33 {
34 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 34 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
35 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 35 m_document = toHTMLDocument(&m_dummyPageHolder->document());
36 ASSERT(m_document); 36 ASSERT(m_document);
37 } 37 }
38 38
39 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent) 39 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent)
40 { 40 {
41 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent), AS SERT_NO_EXCEPTION); 41 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent), AS SERT_NO_EXCEPTION);
42 document().view()->updateAllLifecyclePhases(); 42 document().view()->updateLayoutAndStyleForPainting();
43 } 43 }
44 44
45 inline Color outlineColor(Element* element) 45 inline Color outlineColor(Element* element)
46 { 46 {
47 return element->computedStyle()->visitedDependentColor(CSSPropertyOutlineCol or); 47 return element->computedStyle()->visitedDependentColor(CSSPropertyOutlineCol or);
48 } 48 }
49 49
50 inline EBorderStyle outlineStyle(Element* element) 50 inline EBorderStyle outlineStyle(Element* element)
51 { 51 {
52 return element->computedStyle()->outlineStyle(); 52 return element->computedStyle()->outlineStyle();
(...skipping 10 matching lines...) Expand all
63 Color customColor = makeRGB(123, 145, 167); 63 Color customColor = makeRGB(123, 145, 167);
64 64
65 // Checking unfocused style. 65 // Checking unfocused style.
66 EXPECT_EQ(BNONE, outlineStyle(span)); 66 EXPECT_EQ(BNONE, outlineStyle(span));
67 EXPECT_NE(customColor, outlineColor(span)); 67 EXPECT_NE(customColor, outlineColor(span));
68 68
69 // Do focus. 69 // Do focus.
70 document().page()->focusController().setActive(true); 70 document().page()->focusController().setActive(true);
71 document().page()->focusController().setFocused(true); 71 document().page()->focusController().setFocused(true);
72 span->focus(); 72 span->focus();
73 document().view()->updateAllLifecyclePhases(); 73 document().view()->updateLayoutAndStyleForPainting();
74 74
75 // Checking focused style. 75 // Checking focused style.
76 EXPECT_NE(BNONE, outlineStyle(span)); 76 EXPECT_NE(BNONE, outlineStyle(span));
77 EXPECT_NE(customColor, outlineColor(span)); 77 EXPECT_NE(customColor, outlineColor(span));
78 78
79 // Change focus ring color. 79 // Change focus ring color.
80 LayoutTheme::theme().setCustomFocusRingColor(customColor); 80 LayoutTheme::theme().setCustomFocusRingColor(customColor);
81 Page::platformColorsChanged(); 81 Page::platformColorsChanged();
82 document().view()->updateAllLifecyclePhases(); 82 document().view()->updateLayoutAndStyleForPainting();
83 83
84 // Check that the focus ring color is updated. 84 // Check that the focus ring color is updated.
85 EXPECT_NE(BNONE, outlineStyle(span)); 85 EXPECT_NE(BNONE, outlineStyle(span));
86 EXPECT_EQ(customColor, outlineColor(span)); 86 EXPECT_EQ(customColor, outlineColor(span));
87 } 87 }
88 88
89 } // namespace blink 89 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTestHelper.cpp ('k') | Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698