Upstream version 8.36.155.0
[platform/framework/web/crosswalk.git] / src / xwalk / test / android / core / javatests / src / org / xwalk / core / xwview / test / HistorySizeTest.java
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2014 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 package org.xwalk.core.xwview.test;
7
8 import android.test.suitebuilder.annotation.SmallTest;
9
10 import org.chromium.base.test.util.Feature;
11
12 import org.xwalk.core.XWalkNavigationItem;
13
14 /**
15  * Test suite for HistorySize().
16  */
17 public class HistorySizeTest extends XWalkViewTestBase {
18     @Override
19     public void setUp() throws Exception {
20         super.setUp();
21
22         setXWalkClient(new XWalkViewTestBase.TestXWalkClient());
23     }
24
25     @SmallTest
26     @Feature({"HistorySize"})
27     public void testHistorySize() throws Throwable {
28         final String url1 = "about:blank";
29         final String url2 = "file:///android_asset/www/index.html";
30         assertEquals(0, historySizeOnUiThread());
31         loadUrlSync(url1);
32         assertEquals(1, historySizeOnUiThread());
33         loadUrlSync(url2);
34         assertEquals(2, historySizeOnUiThread());
35         goBackSync();
36         assertEquals(2, historySizeOnUiThread());
37     }
38 }