| OLD | NEW |
| 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 package org.chromium.chrome.browser.compositor.layouts; | 5 package org.chromium.chrome.browser.compositor.layouts; |
| 6 | 6 |
| 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; | 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; |
| 8 | 8 |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.graphics.PointF; | 10 import android.graphics.PointF; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 mTabModelSelector.selectModel(incognitoSelected); | 128 mTabModelSelector.selectModel(incognitoSelected); |
| 129 LayoutManagerHost layoutManagerHost = new MockLayoutHost(context); | 129 LayoutManagerHost layoutManagerHost = new MockLayoutHost(context); |
| 130 | 130 |
| 131 // Build a fake content container | 131 // Build a fake content container |
| 132 FrameLayout parentContainer = new FrameLayout(context); | 132 FrameLayout parentContainer = new FrameLayout(context); |
| 133 FrameLayout container = new FrameLayout(context); | 133 FrameLayout container = new FrameLayout(context); |
| 134 parentContainer.addView(container); | 134 parentContainer.addView(container); |
| 135 | 135 |
| 136 mManagerPhone = new LayoutManagerChromePhone(layoutManagerHost); | 136 mManagerPhone = new LayoutManagerChromePhone(layoutManagerHost); |
| 137 mManager = mManagerPhone; | 137 mManager = mManagerPhone; |
| 138 mManager.init(mTabModelSelector, null, null, container, null, null, null
); | 138 mManager.init(mTabModelSelector, null, null, container, null, null); |
| 139 initializeMotionEvent(); | 139 initializeMotionEvent(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 private void eventDown(long time, PointF p) { | 142 private void eventDown(long time, PointF p) { |
| 143 mLastDownTime = time; | 143 mLastDownTime = time; |
| 144 | 144 |
| 145 mPointerCoords[0].x = p.x * mDpToPx; | 145 mPointerCoords[0].x = p.x * mDpToPx; |
| 146 mPointerCoords[0].y = p.y * mDpToPx; | 146 mPointerCoords[0].y = p.y * mDpToPx; |
| 147 | 147 |
| 148 MotionEvent event = MotionEvent.obtain(mLastDownTime, time, MotionEvent.
ACTION_DOWN, | 148 MotionEvent event = MotionEvent.obtain(mLastDownTime, time, MotionEvent.
ACTION_DOWN, |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 mManager.getActiveLayout() instanceof ToolbarSwipeLayout); | 556 mManager.getActiveLayout() instanceof ToolbarSwipeLayout); |
| 557 Assert.assertTrue("LayoutManager took too long to finish the animations"
, | 557 Assert.assertTrue("LayoutManager took too long to finish the animations"
, |
| 558 simulateTime(mManager, 1000)); | 558 simulateTime(mManager, 1000)); |
| 559 } | 559 } |
| 560 | 560 |
| 561 @Override | 561 @Override |
| 562 public Tab createTab(int id, boolean incognito) { | 562 public Tab createTab(int id, boolean incognito) { |
| 563 return new Tab(id, incognito, null); | 563 return new Tab(id, incognito, null); |
| 564 } | 564 } |
| 565 } | 565 } |
| OLD | NEW |