// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.tabmodel.document;

import android.test.InstrumentationTestCase;
import android.test.UiThreadTest;
import android.test.suitebuilder.annotation.SmallTest;

import org.chromium.content_public.browser.LoadUrlParams;

/**
 * Tests that the AsyncTabCreationParamsManager works as expected.
 */
public class AsyncTabCreationParamsManagerTest extends InstrumentationTestCase {
    @SmallTest
    @UiThreadTest
    public void testBasicAddingAndRemoval() throws Exception {
        AsyncTabCreationParams asyncParams =
                new AsyncTabCreationParams(new LoadUrlParams("http://google.com"));
        AsyncTabCreationParamsManager.add(11684, asyncParams);

        AsyncTabCreationParams retrievedParams = AsyncTabCreationParamsManager.remove(11684);
        assertEquals("Removed incorrect parameters from the map", asyncParams, retrievedParams);

        AsyncTabCreationParams failedParams = AsyncTabCreationParamsManager.remove(11684);
        assertNull("Removed same parameters twice", failedParams);
    }
}
Add a simple test for AsyncTabCreationParamsManager
Add a simple test for AsyncTabCreationParamsManager

BUG=508333

Review URL: https://codereview.chromium.org/1234413003

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340132}
