Upstream version 10.39.233.0
[platform/framework/web/crosswalk.git] / src / android_webview / javatests / src / org / chromium / android_webview / test / NavigationHistoryTest.java
index a50a151..ebf9298 100644 (file)
@@ -10,10 +10,10 @@ import org.chromium.android_webview.AwContents;
 import org.chromium.android_webview.test.util.CommonResources;
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.DisabledTest;
-import org.chromium.content.browser.NavigationEntry;
-import org.chromium.content.browser.NavigationHistory;
 import org.chromium.content.browser.test.util.HistoryUtils;
 import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.NavigationHistory;
 import org.chromium.net.test.util.TestWebServer;
 
 import java.util.concurrent.Callable;
@@ -41,11 +41,12 @@ public class NavigationHistoryTest extends AwTestBase {
     @Override
     public void setUp() throws Exception {
         super.setUp();
+        AwContents.setShouldDownloadFavicons();
         mContentsClient = new TestAwContentsClient();
         final AwTestContainerView testContainerView =
             createAwTestContainerViewOnMainSync(mContentsClient);
         mAwContents = testContainerView.getAwContents();
-        mWebServer = new TestWebServer(false);
+        mWebServer = TestWebServer.start();
     }
 
     @Override
@@ -59,7 +60,7 @@ public class NavigationHistoryTest extends AwTestBase {
         return ThreadUtils.runOnUiThreadBlocking(new Callable<NavigationHistory>() {
             @Override
             public NavigationHistory call() {
-                return awContents.getContentViewCore().getNavigationHistory();
+                return awContents.getNavigationController().getNavigationHistory();
             }
         });
     }
@@ -170,7 +171,7 @@ public class NavigationHistoryTest extends AwTestBase {
         loadUrlSync(mAwContents, onPageFinishedHelper, page1Url);
         loadUrlSync(mAwContents, onPageFinishedHelper, page2Url);
 
-        HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getContentViewCore(),
+        HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getWebContents(),
                 onPageFinishedHelper);
         list = getNavigationHistory(mAwContents);
 
@@ -287,7 +288,7 @@ public class NavigationHistoryTest extends AwTestBase {
         pollOnUiThread(new Callable<Boolean>() {
             @Override
             public Boolean call() {
-                String title = mAwContents.getContentViewCore().getTitle();
+                String title = mAwContents.getTitle();
                 return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
             }
         });
@@ -298,18 +299,18 @@ public class NavigationHistoryTest extends AwTestBase {
         pollOnUiThread(new Callable<Boolean>() {
             @Override
             public Boolean call() {
-                String title = mAwContents.getContentViewCore().getTitle();
+                String title = mAwContents.getTitle();
                 return PAGE_1_TITLE.equals(title);
             }
         });
         // Verify that we can still go back to the login response page despite that
         // it is non-cacheable.
-        HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getContentViewCore(),
+        HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getWebContents(),
                 onPageFinishedHelper);
         pollOnUiThread(new Callable<Boolean>() {
             @Override
             public Boolean call() {
-                String title = mAwContents.getContentViewCore().getTitle();
+                String title = mAwContents.getTitle();
                 return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
             }
         });