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

Side by Side Diff: Source/WebKit/chromium/tests/GraphicsLayerTest.cpp

Issue 16982005: Allow objects without scrollbars to be scrollable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CR Fixes Created 7 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 virtual bool isScrollCornerVisible() const OVERRIDE { return false; } 122 virtual bool isScrollCornerVisible() const OVERRIDE { return false; }
123 virtual IntRect scrollCornerRect() const OVERRIDE { return IntRect(); } 123 virtual IntRect scrollCornerRect() const OVERRIDE { return IntRect(); }
124 virtual int visibleWidth() const OVERRIDE { return 10; } 124 virtual int visibleWidth() const OVERRIDE { return 10; }
125 virtual int visibleHeight() const OVERRIDE { return 10; } 125 virtual int visibleHeight() const OVERRIDE { return 10; }
126 virtual IntSize contentsSize() const OVERRIDE { return IntSize(100, 100); } 126 virtual IntSize contentsSize() const OVERRIDE { return IntSize(100, 100); }
127 virtual bool scrollbarsCanBeActive() const OVERRIDE { return false; } 127 virtual bool scrollbarsCanBeActive() const OVERRIDE { return false; }
128 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE { return 0; } 128 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE { return 0; }
129 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE { return IntRect( ); } 129 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE { return IntRect( ); }
130 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE { } 130 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE { }
131 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE { } 131 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE { }
132 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE { retu rn true; }
132 133
133 virtual void setScrollOffset(const IntPoint& scrollOffset) OVERRIDE { m_scro llPosition = scrollOffset; } 134 virtual void setScrollOffset(const IntPoint& scrollOffset) OVERRIDE { m_scro llPosition = scrollOffset; }
134 virtual IntPoint scrollPosition() const OVERRIDE { return m_scrollPosition; } 135 virtual IntPoint scrollPosition() const OVERRIDE { return m_scrollPosition; }
135 136
136 private: 137 private:
137 IntPoint m_scrollPosition; 138 IntPoint m_scrollPosition;
138 }; 139 };
139 140
140 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) 141 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea)
141 { 142 {
(...skipping 13 matching lines...) Expand all
155 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); 156 EXPECT_FALSE(m_graphicsLayer->contentsLayer());
156 157
157 m_graphicsLayer->setContentsToSolidColor(Color::white); 158 m_graphicsLayer->setContentsToSolidColor(Color::white);
158 EXPECT_TRUE(m_graphicsLayer->contentsLayer()); 159 EXPECT_TRUE(m_graphicsLayer->contentsLayer());
159 160
160 m_graphicsLayer->setContentsToSolidColor(Color()); 161 m_graphicsLayer->setContentsToSolidColor(Color());
161 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); 162 EXPECT_FALSE(m_graphicsLayer->contentsLayer());
162 } 163 }
163 164
164 } // namespace 165 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698