Jorim Jaggi | 817ebdd | 2018-03-26 15:46:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.wm.utils; |
| 18 | |
| 19 | import static junit.framework.Assert.assertEquals; |
| 20 | |
| 21 | import android.graphics.Rect; |
| 22 | import android.platform.test.annotations.Presubmit; |
| 23 | import android.support.test.filters.SmallTest; |
| 24 | import android.support.test.runner.AndroidJUnit4; |
Tadashi G. Takaoka | 18c909c | 2018-10-11 07:51:35 +0000 | [diff] [blame^] | 25 | import android.util.Pair; |
Jorim Jaggi | 817ebdd | 2018-03-26 15:46:01 +0200 | [diff] [blame] | 26 | |
| 27 | import org.junit.Test; |
| 28 | import org.junit.runner.RunWith; |
| 29 | |
Jorim Jaggi | 817ebdd | 2018-03-26 15:46:01 +0200 | [diff] [blame] | 30 | @RunWith(AndroidJUnit4.class) |
| 31 | @SmallTest |
| 32 | @Presubmit |
| 33 | public class InsetUtilsTest { |
| 34 | |
| 35 | @Test |
| 36 | public void testAdd() throws Exception { |
| 37 | final Rect rect1 = new Rect(10, 20, 30, 40); |
| 38 | final Rect rect2 = new Rect(50, 60, 70, 80); |
| 39 | InsetUtils.addInsets(rect1, rect2); |
| 40 | assertEquals(new Rect(60, 80, 100, 120), rect1); |
| 41 | } |
| 42 | } |
| 43 | |