| 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.tabmodel; | 5 package org.chromium.chrome.browser.tabmodel; |
| 6 | 6 |
| 7 import android.support.test.filters.SmallTest; |
| 7 import android.test.InstrumentationTestCase; | 8 import android.test.InstrumentationTestCase; |
| 8 import android.test.UiThreadTest; | 9 import android.test.UiThreadTest; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | |
| 10 | 10 |
| 11 import org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams; | 11 import org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams; |
| 12 import org.chromium.content_public.browser.LoadUrlParams; | 12 import org.chromium.content_public.browser.LoadUrlParams; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Tests that the AsyncTabCreationParamsManager works as expected. | 15 * Tests that the AsyncTabCreationParamsManager works as expected. |
| 16 */ | 16 */ |
| 17 public class AsyncTabCreationParamsManagerTest extends InstrumentationTestCase { | 17 public class AsyncTabCreationParamsManagerTest extends InstrumentationTestCase { |
| 18 @SmallTest | 18 @SmallTest |
| 19 @UiThreadTest | 19 @UiThreadTest |
| 20 public void testBasicAddingAndRemoval() throws Exception { | 20 public void testBasicAddingAndRemoval() throws Exception { |
| 21 AsyncTabCreationParams asyncParams = | 21 AsyncTabCreationParams asyncParams = |
| 22 new AsyncTabCreationParams(new LoadUrlParams("http://google.com"
)); | 22 new AsyncTabCreationParams(new LoadUrlParams("http://google.com"
)); |
| 23 AsyncTabParamsManager.add(11684, asyncParams); | 23 AsyncTabParamsManager.add(11684, asyncParams); |
| 24 | 24 |
| 25 AsyncTabParams retrievedParams = AsyncTabParamsManager.remove(11684); | 25 AsyncTabParams retrievedParams = AsyncTabParamsManager.remove(11684); |
| 26 assertEquals("Removed incorrect parameters from the map", asyncParams, r
etrievedParams); | 26 assertEquals("Removed incorrect parameters from the map", asyncParams, r
etrievedParams); |
| 27 | 27 |
| 28 AsyncTabParams failedParams = AsyncTabParamsManager.remove(11684); | 28 AsyncTabParams failedParams = AsyncTabParamsManager.remove(11684); |
| 29 assertNull("Removed same parameters twice", failedParams); | 29 assertNull("Removed same parameters twice", failedParams); |
| 30 } | 30 } |
| 31 } | 31 } |
| OLD | NEW |