1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2013 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.graphics.Bitmap;
9 import android.test.suitebuilder.annotation.SmallTest;
10 import android.util.Log;
12 import org.chromium.base.test.util.DisabledTest;
13 import org.chromium.base.test.util.Feature;
16 * Test suite for loadUrl().
18 public class LoadUrlTest extends XWalkViewTestBase {
20 public void setUp() throws Exception {
23 setXWalkClient(new XWalkViewTestBase.TestXWalkClient());
27 // @Feature({"LoadUrl"})
28 // TODO(hengzhi): Since the device issue, it can not access the network,
29 // so disabled this test temporarily. It will be enabled later.
31 public void testNormalUrl() throws Throwable {
32 final String url = "http://www.webkit.org/";
33 final String expected_title = "The WebKit Open Source Project";
35 assertEquals(expected_title, getTitleOnUiThread());
40 public void testLocalUrl() throws Throwable {
41 final String name = "index.html";
42 final String expected_title = "Crosswalk Sample Application";
45 assertEquals(expected_title, getTitleOnUiThread());
49 @Feature({"ContentScheme"})
50 public void testContentUrl() throws Throwable {
51 final String resource = "content_test";
52 final String content_url = TestContentProvider.createContentUrl(resource);
54 int count_before_load =
55 TestContentProvider.getResourceRequestCount(getActivity(), resource);
56 loadUrlSync(content_url);
57 assertEquals(count_before_load + 1,
58 TestContentProvider.getResourceRequestCount(getActivity(), resource));