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.infobar; | 5 package org.chromium.chrome.browser.infobar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.support.test.filters.SmallTest; |
8 import android.test.InstrumentationTestCase; | 9 import android.test.InstrumentationTestCase; |
9 import android.test.UiThreadTest; | 10 import android.test.UiThreadTest; |
10 import android.test.suitebuilder.annotation.SmallTest; | |
11 import android.view.View; | 11 import android.view.View; |
12 import android.view.View.MeasureSpec; | 12 import android.view.View.MeasureSpec; |
13 import android.view.ViewGroup.LayoutParams; | 13 import android.view.ViewGroup.LayoutParams; |
14 | 14 |
15 import org.chromium.chrome.R; | 15 import org.chromium.chrome.R; |
16 import org.chromium.chrome.browser.infobar.InfoBarControlLayout.ControlLayoutPar
ams; | 16 import org.chromium.chrome.browser.infobar.InfoBarControlLayout.ControlLayoutPar
ams; |
17 | 17 |
18 /** | 18 /** |
19 * Tests for InfoBarControlLayout. This suite doesn't check for specific detail
s, like margins | 19 * Tests for InfoBarControlLayout. This suite doesn't check for specific detail
s, like margins |
20 * paddings, and instead focuses on whether controls are placed correctly. | 20 * paddings, and instead focuses on whether controls are placed correctly. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 assertEquals(2, params1.columnsRequired); | 167 assertEquals(2, params1.columnsRequired); |
168 assertEquals(INFOBAR_WIDTH, view1.getMeasuredWidth()); | 168 assertEquals(INFOBAR_WIDTH, view1.getMeasuredWidth()); |
169 | 169 |
170 // Small control gets shunted onto the next row. | 170 // Small control gets shunted onto the next row. |
171 assertTrue(params2.top > view1.getMeasuredHeight()); | 171 assertTrue(params2.top > view1.getMeasuredHeight()); |
172 assertEquals(0, params2.start); | 172 assertEquals(0, params2.start); |
173 assertEquals(2, params2.columnsRequired); | 173 assertEquals(2, params2.columnsRequired); |
174 assertEquals(INFOBAR_WIDTH, view2.getMeasuredWidth()); | 174 assertEquals(INFOBAR_WIDTH, view2.getMeasuredWidth()); |
175 } | 175 } |
176 } | 176 } |
OLD | NEW |