| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.preference.PreferenceScreen; | 7 import android.preference.PreferenceScreen; |
| 8 import android.support.test.filters.LargeTest; | 8 import android.support.test.filters.LargeTest; |
| 9 import android.support.test.filters.MediumTest; | 9 import android.support.test.filters.MediumTest; |
| 10 import android.util.JsonReader; | 10 import android.util.JsonReader; |
| 11 | 11 |
| 12 import org.chromium.base.ThreadUtils; | 12 import org.chromium.base.ThreadUtils; |
| 13 import org.chromium.base.test.util.CallbackHelper; | 13 import org.chromium.base.test.util.CallbackHelper; |
| 14 import org.chromium.base.test.util.CommandLineFlags; | 14 import org.chromium.base.test.util.CommandLineFlags; |
| 15 import org.chromium.base.test.util.DisabledTest; |
| 15 import org.chromium.base.test.util.Feature; | 16 import org.chromium.base.test.util.Feature; |
| 16 import org.chromium.base.test.util.RetryOnFailure; | 17 import org.chromium.base.test.util.RetryOnFailure; |
| 17 import org.chromium.chrome.browser.preferences.ButtonPreference; | 18 import org.chromium.chrome.browser.preferences.ButtonPreference; |
| 18 import org.chromium.chrome.browser.preferences.Preferences; | 19 import org.chromium.chrome.browser.preferences.Preferences; |
| 19 import org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataPreferen
ces; | 20 import org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataPreferen
ces; |
| 20 import org.chromium.chrome.browser.tab.EmptyTabObserver; | 21 import org.chromium.chrome.browser.tab.EmptyTabObserver; |
| 21 import org.chromium.chrome.browser.tab.Tab; | 22 import org.chromium.chrome.browser.tab.Tab; |
| 22 import org.chromium.chrome.browser.tab.TabObserver; | 23 import org.chromium.chrome.browser.tab.TabObserver; |
| 23 import org.chromium.chrome.test.ChromeActivityTestCaseBase; | 24 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 24 import org.chromium.chrome.test.util.ActivityUtils; | 25 import org.chromium.chrome.test.util.ActivityUtils; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 loadCallback.waitForCallback(0); | 172 loadCallback.waitForCallback(0); |
| 172 waitForResultCount(getActivity().getCurrentContentViewCore(), 1); | 173 waitForResultCount(getActivity().getCurrentContentViewCore(), 1); |
| 173 | 174 |
| 174 // Delete the search term. | 175 // Delete the search term. |
| 175 runJavaScriptCodeInCurrentTab("historyView.setSearch('')"); | 176 runJavaScriptCodeInCurrentTab("historyView.setSearch('')"); |
| 176 loadCallback.waitForCallback(1); | 177 loadCallback.waitForCallback(1); |
| 177 waitForResultCount(getActivity().getCurrentContentViewCore(), 2); | 178 waitForResultCount(getActivity().getCurrentContentViewCore(), 2); |
| 178 tab.removeObserver(observer); | 179 tab.removeObserver(observer); |
| 179 } | 180 } |
| 180 | 181 |
| 181 @LargeTest | 182 // @LargeTest |
| 182 @Feature({"History"}) | 183 // @Feature({"History"}) |
| 184 @DisabledTest |
| 183 public void testRemovingEntries() throws InterruptedException, TimeoutExcept
ion { | 185 public void testRemovingEntries() throws InterruptedException, TimeoutExcept
ion { |
| 184 // Urls will be visited in reverse order to preserve the array ordering | 186 // Urls will be visited in reverse order to preserve the array ordering |
| 185 // in the history results. | 187 // in the history results. |
| 186 String[] testUrls = new String[] { | 188 String[] testUrls = new String[] { |
| 187 mTestServer.getURL("/chrome/test/data/android/google.html"), | 189 mTestServer.getURL("/chrome/test/data/android/google.html"), |
| 188 mTestServer.getURL("/chrome/test/data/android/about.html"), | 190 mTestServer.getURL("/chrome/test/data/android/about.html"), |
| 189 }; | 191 }; |
| 190 | 192 |
| 191 String[] testTitles = new String[testUrls.length]; | 193 String[] testTitles = new String[testUrls.length]; |
| 192 for (int i = testUrls.length - 1; i >= 0; --i) { | 194 for (int i = testUrls.length - 1; i >= 0; --i) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 return !clearBrowsingFragment.isVisible() | 273 return !clearBrowsingFragment.isVisible() |
| 272 && mainActivity.getActivityTab() != null | 274 && mainActivity.getActivityTab() != null |
| 273 && !mainActivity.getActivityTab().isFrozen(); | 275 && !mainActivity.getActivityTab().isFrozen(); |
| 274 } | 276 } |
| 275 }); | 277 }); |
| 276 JavaScriptUtils.executeJavaScriptAndWaitForResult( | 278 JavaScriptUtils.executeJavaScriptAndWaitForResult( |
| 277 mainActivity.getCurrentContentViewCore().getWebContents(), "relo
adHistory()"); | 279 mainActivity.getCurrentContentViewCore().getWebContents(), "relo
adHistory()"); |
| 278 waitForResultCount(getActivity().getCurrentContentViewCore(), 0); | 280 waitForResultCount(getActivity().getCurrentContentViewCore(), 0); |
| 279 } | 281 } |
| 280 } | 282 } |
| OLD | NEW |