| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.test.suitebuilder.annotation.MediumTest; | 7 import android.test.suitebuilder.annotation.MediumTest; |
| 8 | 8 |
| 9 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
| 10 import org.chromium.base.test.util.UrlUtils; | 10 import org.chromium.base.test.util.UrlUtils; |
| 11 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 11 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
| 12 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEval
uateJavaScriptResultHelper; | 12 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEval
uateJavaScriptResultHelper; |
| 13 import org.chromium.content_public.browser.LoadUrlParams; |
| 14 import org.chromium.content_public.browser.NavigationHistory; |
| 13 import org.chromium.content_shell_apk.ContentShellActivity; | 15 import org.chromium.content_shell_apk.ContentShellActivity; |
| 14 import org.chromium.content_shell_apk.ContentShellTestBase; | 16 import org.chromium.content_shell_apk.ContentShellTestBase; |
| 15 | 17 |
| 16 /** | 18 /** |
| 17 * Tests for various aspects of navigation. | 19 * Tests for various aspects of navigation. |
| 18 */ | 20 */ |
| 19 public class NavigationTest extends ContentShellTestBase { | 21 public class NavigationTest extends ContentShellTestBase { |
| 20 | 22 |
| 21 private static final String URL_1 = UrlUtils.encodeHtmlDataUri("<html>1</htm
l>"); | 23 private static final String URL_1 = UrlUtils.encodeHtmlDataUri("<html>1</htm
l>"); |
| 22 private static final String URL_2 = UrlUtils.encodeHtmlDataUri("<html>2</htm
l>"); | 24 private static final String URL_2 = UrlUtils.encodeHtmlDataUri("<html>2</htm
l>"); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 122 |
| 121 // Grab the timestamp after a reload and make sure they don't match. | 123 // Grab the timestamp after a reload and make sure they don't match. |
| 122 reload(contentViewCore, testCallbackHelperContainer); | 124 reload(contentViewCore, testCallbackHelperContainer); |
| 123 javascriptHelper.evaluateJavaScript(contentViewCore, "getLoadtime();"); | 125 javascriptHelper.evaluateJavaScript(contentViewCore, "getLoadtime();"); |
| 124 javascriptHelper.waitUntilHasValue(); | 126 javascriptHelper.waitUntilHasValue(); |
| 125 String secondTimestamp = javascriptHelper.getJsonResultAndClear(); | 127 String secondTimestamp = javascriptHelper.getJsonResultAndClear(); |
| 126 assertNotNull("Timestamp was null.", secondTimestamp); | 128 assertNotNull("Timestamp was null.", secondTimestamp); |
| 127 assertFalse("Timestamps matched.", firstTimestamp.equals(secondTimestamp
)); | 129 assertFalse("Timestamps matched.", firstTimestamp.equals(secondTimestamp
)); |
| 128 } | 130 } |
| 129 } | 131 } |
| OLD | NEW |