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;
11 import org.chromium.base.test.util.DisabledTest;
12 import org.chromium.base.test.util.Feature;
13 import org.chromium.net.test.util.TestWebServer;
14 import org.xwalk.core.XWalkClient;
15 import org.xwalk.core.XWalkView;
18 * Test suite for reload().
20 public class ReloadTest extends XWalkViewTestBase {
22 private TestWebServer mWebServer;
25 public void setUp() throws Exception {
28 setXWalkClient(new XWalkViewTestBase.TestXWalkClient());
29 mWebServer = new TestWebServer(false);
33 public void tearDown() throws Exception {
34 if (mWebServer != null) {
35 mWebServer.shutdown();
40 // TODO(guangzhen): Since the device issue, it can not access the network,
41 // so disabled this test temporarily. It will be enabled later.
43 // @Feature({"reload"})
45 public void testReloadUrl() throws Throwable {
47 String title1 = "title1";
48 String title2 = "title2";
49 String html1 = "<html><head><title>" + title1 + "</title></head></html><body></body>";
50 String html2 = "<html><head><title>" + title2 + "</title></head></html><body></body>";
51 String url = mWebServer.setResponse("/reload.html", html1, null);
53 mWebServer.setResponse("/reload.html", html2, null);
54 reloadSync(XWalkView.RELOAD_IGNORE_CACHE);
55 //TODO(guangzhen) When reload finished, immediately call getTitle will get wrong title.
57 assertEquals(title2, getTitleOnUiThread());