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.
6 package org.xwalk.core.xwview.test;
8 import android.test.suitebuilder.annotation.SmallTest;
10 import org.chromium.base.test.util.Feature;
12 import org.xwalk.core.XWalkNavigationItem;
15 * Test suite for GetItemAt().
17 public class GetItemAtTest extends XWalkViewTestBase {
19 public void setUp() throws Exception {
24 @Feature({"GetItemAt"})
25 public void testGetItemAt() throws Throwable {
26 final String url1 = "about:blank";
27 final String url2 = "file:///android_asset/www/index.html";
28 final String title ="Crosswalk Sample Application";
29 assertTrue(getItemAtOnUiThread(-1) == null);
30 assertTrue(getItemAtOnUiThread(java.lang.Integer.MAX_VALUE) == null);
31 assertTrue(getItemAtOnUiThread(java.lang.Integer.MIN_VALUE) == null);
34 assertTrue(getItemAtOnUiThread(historySizeOnUiThread()) == null);
35 XWalkNavigationItem navigationItem1 = getItemAtOnUiThread(0);
36 assertEquals(url1, navigationItem1.getUrl());
37 XWalkNavigationItem navigationItem2 = getItemAtOnUiThread(1);
38 assertEquals(url2, navigationItem2.getUrl());
39 assertEquals(title, navigationItem2.getTitle());