OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.chrome.browser.compositor.bottombar; | 5 package org.chromium.chrome.browser.compositor.bottombar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.test.InstrumentationTestCase; | 8 import android.test.InstrumentationTestCase; |
9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
10 import android.view.MotionEvent; | 10 import android.view.MotionEvent; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 @Override | 159 @Override |
160 public void removeLastHistoryEntry(String url, long timeInMs) {} | 160 public void removeLastHistoryEntry(String url, long timeInMs) {} |
161 } | 161 } |
162 | 162 |
163 @Override | 163 @Override |
164 public ContentViewCore getContentViewCore() { | 164 public ContentViewCore getContentViewCore() { |
165 return mContentViewCore; | 165 return mContentViewCore; |
166 } | 166 } |
167 | 167 |
| 168 @Override |
| 169 protected void resizePanelContentViewCore(float width, float height) {} |
| 170 |
168 public boolean getWasTapDetected() { | 171 public boolean getWasTapDetected() { |
169 return mWasTapDetectedOnPanel; | 172 return mWasTapDetectedOnPanel; |
170 } | 173 } |
171 | 174 |
172 public boolean getWasScrollDetected() { | 175 public boolean getWasScrollDetected() { |
173 return mWasScrollDetectedOnPanel; | 176 return mWasScrollDetectedOnPanel; |
174 } | 177 } |
175 | 178 |
176 // GestureHandler overrides. | 179 // GestureHandler overrides. |
177 | 180 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 219 |
217 mPanel = new MockOverlayPanel(context, new OverlayPanelManager()); | 220 mPanel = new MockOverlayPanel(context, new OverlayPanelManager()); |
218 mEventFilter = new OverlayPanelEventFilterWrapper(context, null, mPanel)
; | 221 mEventFilter = new OverlayPanelEventFilterWrapper(context, null, mPanel)
; |
219 | 222 |
220 mPanel.setSearchBarHeightForTesting(BAR_HEIGHT_DP); | 223 mPanel.setSearchBarHeightForTesting(BAR_HEIGHT_DP); |
221 mPanel.setHeightForTesting(LAYOUT_HEIGHT_DP); | 224 mPanel.setHeightForTesting(LAYOUT_HEIGHT_DP); |
222 mPanel.setIsFullWidthSizePanelForTesting(true); | 225 mPanel.setIsFullWidthSizePanelForTesting(true); |
223 | 226 |
224 // NOTE(pedrosimonetti): This should be called after calling the method | 227 // NOTE(pedrosimonetti): This should be called after calling the method |
225 // setIsFullWidthSizePanelForTesting(), otherwise it will crash the test
. | 228 // setIsFullWidthSizePanelForTesting(), otherwise it will crash the test
. |
226 mPanel.onSizeChanged(LAYOUT_WIDTH_DP, LAYOUT_HEIGHT_DP); | 229 mPanel.onSizeChanged(LAYOUT_WIDTH_DP, LAYOUT_HEIGHT_DP, 0, 0); |
227 | 230 |
228 setContentViewVerticalScroll(0); | 231 setContentViewVerticalScroll(0); |
229 | 232 |
230 mAlmostMaximizedContentOffsetYDp = | 233 mAlmostMaximizedContentOffsetYDp = |
231 PANEL_ALMOST_MAXIMIZED_OFFSET_Y_DP + BAR_HEIGHT_DP; | 234 PANEL_ALMOST_MAXIMIZED_OFFSET_Y_DP + BAR_HEIGHT_DP; |
232 mMaximizedContentOffsetYDp = BAR_HEIGHT_DP; | 235 mMaximizedContentOffsetYDp = BAR_HEIGHT_DP; |
233 | 236 |
234 mWasTapDetectedOnContent = false; | 237 mWasTapDetectedOnContent = false; |
235 mWasScrollDetectedOnContent = false; | 238 mWasScrollDetectedOnContent = false; |
236 | 239 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 488 |
486 /** | 489 /** |
487 * Simulates a MotionEvent.ACTION_UP in the OverlayPanelEventFilter. | 490 * Simulates a MotionEvent.ACTION_UP in the OverlayPanelEventFilter. |
488 * @param x The event's x coordinate in dps. | 491 * @param x The event's x coordinate in dps. |
489 * @param y The event's y coordinate in dps. | 492 * @param y The event's y coordinate in dps. |
490 */ | 493 */ |
491 private void simulateActionUpEvent(float x, float y) { | 494 private void simulateActionUpEvent(float x, float y) { |
492 simulateEvent(MotionEvent.ACTION_UP, x, y); | 495 simulateEvent(MotionEvent.ACTION_UP, x, y); |
493 } | 496 } |
494 } | 497 } |
OLD | NEW |