From c6c254e403073e43e3e8e67a28911ca9ce9d7ad4 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 27 Aug 2014 14:18:32 -0400 Subject: [PATCH] Backed out changeset c7919e13cafb (bug 1048857) for mochitest-bc failures. --- toolkit/components/places/UnifiedComplete.js | 8 +--- .../test_avoid_stripping_to_empty_tokens.js | 41 ------------------- .../places/tests/unifiedcomplete/xpcshell.ini | 1 - 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js index 8d29b622112b..eba31b504c28 100644 --- a/toolkit/components/places/UnifiedComplete.js +++ b/toolkit/components/places/UnifiedComplete.js @@ -457,18 +457,14 @@ function getUnfilteredSearchTokens(searchString) function stripPrefix(spec) { ["http://", "https://", "ftp://"].some(scheme => { - // Strip protocol if not directly followed by a space - if (spec.startsWith(scheme) && spec != scheme && - spec[scheme.length] != " ") { + if (spec.startsWith(scheme)) { spec = spec.slice(scheme.length); return true; } return false; }); - // Strip www. if not directly followed by a space - if (spec.startsWith("www.") && spec != "www." && - spec[4] != " ") { + if (spec.startsWith("www.")) { spec = spec.slice(4); } return spec; diff --git a/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js b/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js deleted file mode 100644 index ec62a160cc5d..000000000000 --- a/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js +++ /dev/null @@ -1,41 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -add_task(function* test_protocol_trimming() { - for (let prot of ["http", "https", "ftp"]) { - let visit = { - // Include the protocol in the query string to ensure we get matches (see bug 1059395) - uri: NetUtil.newURI(prot + "://www.mozilla.org/test/?q=" + prot + encodeURIComponent("://") + "www.foo"), - title: "Test title", - transition: TRANSITION_TYPED - }; - yield promiseAddVisits(visit); - let matches = [{uri: visit.uri, title: visit.title}]; - - let inputs = [ - prot + "://", - prot + ":// ", - prot + ":// mo", - prot + "://mo te", - prot + "://www.", - prot + "://www. ", - prot + "://www. mo", - prot + "://www.mo te", - "www.", - "www. ", - "www. mo", - "www.mo te" - ]; - for (let input of inputs) { - do_log_info("Searching for: " + input); - yield check_autocomplete({ - search: input, - matches: matches - }); - } - - yield cleanup(); - } -}); - diff --git a/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini b/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini index 4c22763340a9..434f46f0e142 100644 --- a/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini +++ b/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini @@ -11,7 +11,6 @@ tail = [test_autocomplete_on_value_removed_479089.js] [test_autoFill_default_behavior.js] [test_avoid_middle_complete.js] -[test_avoid_stripping_to_empty_tokens.js] [test_casing.js] [test_do_not_trim.js] [test_download_embed_bookmarks.js]