Commit 483903ea authored by Patrik Höglund's avatar Patrik Höglund Committed by Commit Bot

Disabling flaky Omnibox and KeyProvider tests.

They sometimes leak on ASAN.

TBR: tommycli@chromium.org
Bug: 1010691
Change-Id: I663cb4fa70974b35832edacf77e0fdb094631135
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844958
Commit-Queue: Patrik Höglund <phoglund@chromium.org>
Reviewed-by: default avatarPatrik Höglund <phoglund@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703338}
parent 8ea35442
...@@ -30,7 +30,14 @@ namespace base { ...@@ -30,7 +30,14 @@ namespace base {
class FilePath; class FilePath;
} }
class InMemoryURLIndexTest; // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_InMemoryURLIndexTest DISABLED_InMemoryURLIndexTest
#else
#define MAYBE_InMemoryURLIndexTest InMemoryURLIndexTest
#endif
class MAYBE_InMemoryURLIndexTest;
namespace history { namespace history {
...@@ -166,7 +173,8 @@ class HistoryDatabase : public DownloadDatabase, ...@@ -166,7 +173,8 @@ class HistoryDatabase : public DownloadDatabase,
friend class AndroidProviderBackend; friend class AndroidProviderBackend;
FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22);
#endif #endif
friend class ::InMemoryURLIndexTest;
friend class ::MAYBE_InMemoryURLIndexTest;
// Overridden from URLDatabase, DownloadDatabase, VisitDatabase, // Overridden from URLDatabase, DownloadDatabase, VisitDatabase,
// VisitSegmentDatabase and TypedURLSyncMetadataDatabase. // VisitSegmentDatabase and TypedURLSyncMetadataDatabase.
......
...@@ -39,10 +39,24 @@ ...@@ -39,10 +39,24 @@
#include "sql/init_status.h" #include "sql/init_status.h"
#include "ui/base/page_transition_types.h" #include "ui/base/page_transition_types.h"
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_HistoryQuickProviderTest DISABLED_HistoryQuickProviderTest
#else
#define MAYBE_HistoryQuickProviderTest HistoryQuickProviderTest
#endif
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_HistoryQuickProviderTest DISABLED_HistoryQuickProviderTest
#else
#define MAYBE_HistoryQuickProviderTest HistoryQuickProviderTest
#endif
class GURL; class GURL;
class HistoryQuickProviderTest; class MAYBE_HistoryQuickProviderTest;
class HistoryURLProvider; class HistoryURLProvider;
class InMemoryURLIndexTest; class MAYBE_InMemoryURLIndexTest;
class SkBitmap; class SkBitmap;
class SyncBookmarkDataTypeControllerTest; class SyncBookmarkDataTypeControllerTest;
class TestingProfile; class TestingProfile;
...@@ -543,11 +557,11 @@ class HistoryService : public KeyedService { ...@@ -543,11 +557,11 @@ class HistoryService : public KeyedService {
friend class favicon::FaviconServiceImpl; friend class favicon::FaviconServiceImpl;
friend class HistoryBackend; friend class HistoryBackend;
friend class HistoryQueryTest; friend class HistoryQueryTest;
friend class ::HistoryQuickProviderTest; friend class ::MAYBE_HistoryQuickProviderTest;
friend class HistoryServiceTest; friend class HistoryServiceTest;
friend class ::HistoryURLProvider; friend class ::HistoryURLProvider;
friend class HQPPerfTestOnePopularURL; friend class HQPPerfTestOnePopularURL;
friend class ::InMemoryURLIndexTest; friend class ::MAYBE_InMemoryURLIndexTest;
friend class ::SyncBookmarkDataTypeControllerTest; friend class ::SyncBookmarkDataTypeControllerTest;
friend class ::TestingProfile; friend class ::TestingProfile;
friend std::unique_ptr<HistoryService> CreateHistoryService( friend std::unique_ptr<HistoryService> CreateHistoryService(
......
...@@ -147,6 +147,13 @@ class AutocompleteController : public AutocompleteProviderListener, ...@@ -147,6 +147,13 @@ class AutocompleteController : public AutocompleteProviderListener,
return last_time_default_match_changed_; return last_time_default_match_changed_;
} }
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxPopupModelTest DISABLED_OmniboxPopupModelTest
#else
#define MAYBE_OmniboxPopupModelTest OmniboxPopupModelTest
#endif
private: private:
friend class AutocompleteProviderTest; friend class AutocompleteProviderTest;
FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest,
...@@ -162,9 +169,9 @@ class AutocompleteController : public AutocompleteProviderListener, ...@@ -162,9 +169,9 @@ class AutocompleteController : public AutocompleteProviderListener,
#if defined(OS_WIN) #if defined(OS_WIN)
FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsUIATest, AccessibleOmnibox); FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsUIATest, AccessibleOmnibox);
#endif // OS_WIN #endif // OS_WIN
FRIEND_TEST_ALL_PREFIXES(OmniboxPopupModelTest, SetSelectedLine); FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxPopupModelTest, SetSelectedLine);
FRIEND_TEST_ALL_PREFIXES(OmniboxPopupModelTest, TestFocusFixing); FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxPopupModelTest, TestFocusFixing);
FRIEND_TEST_ALL_PREFIXES(OmniboxPopupModelTest, PopupPositionChanging); FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxPopupModelTest, PopupPositionChanging);
FRIEND_TEST_ALL_PREFIXES(OmniboxPopupContentsViewTest, FRIEND_TEST_ALL_PREFIXES(OmniboxPopupContentsViewTest,
EmitSelectedChildrenChangedAccessibilityEvent); EmitSelectedChildrenChangedAccessibilityEvent);
......
...@@ -146,6 +146,13 @@ class AutocompleteResult { ...@@ -146,6 +146,13 @@ class AutocompleteResult {
const AutocompleteResult& old_result, const AutocompleteResult& old_result,
const AutocompleteResult& new_result); const AutocompleteResult& new_result);
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_HistoryURLProviderTest DISABLED_HistoryURLProviderTest
#else
#define MAYBE_HistoryURLProviderTest HistoryURLProviderTest
#endif
private: private:
FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest, ConvertsOpenTabsCorrectly); FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest, ConvertsOpenTabsCorrectly);
FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest, FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest,
...@@ -154,7 +161,7 @@ class AutocompleteResult { ...@@ -154,7 +161,7 @@ class AutocompleteResult {
TestGroupSuggestionsBySearchVsURL); TestGroupSuggestionsBySearchVsURL);
FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest, FRIEND_TEST_ALL_PREFIXES(AutocompleteResultTest,
DemoteOnDeviceSearchSuggestions); DemoteOnDeviceSearchSuggestions);
friend class HistoryURLProviderTest; friend class MAYBE_HistoryURLProviderTest;
typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches; typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches;
......
...@@ -42,18 +42,25 @@ class HistoryQuickProvider : public HistoryProvider { ...@@ -42,18 +42,25 @@ class HistoryQuickProvider : public HistoryProvider {
static void set_disabled(bool disabled) { disabled_ = disabled; } static void set_disabled(bool disabled) { disabled_ = disabled; }
private: private:
friend class HistoryQuickProviderTest; // Flaky leaks on ASAN LSAN (crbug.com/1010691).
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans); #if defined(ADDRESS_SANITIZER)
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Relevance); #define MAYBE_HistoryQuickProviderTest DISABLED_HistoryQuickProviderTest
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, DoTrimHttpScheme); #else
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, #define MAYBE_HistoryQuickProviderTest HistoryQuickProviderTest
#endif
friend class MAYBE_HistoryQuickProviderTest;
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest, Spans);
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest, Relevance);
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest, DoTrimHttpScheme);
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest,
DontTrimHttpSchemeIfInputHasScheme); DontTrimHttpSchemeIfInputHasScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest,
DontTrimHttpSchemeIfInputMatches); DontTrimHttpSchemeIfInputMatches);
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest,
DontTrimHttpsSchemeIfInputHasScheme); DontTrimHttpsSchemeIfInputHasScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, DoTrimHttpsScheme); FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest, DoTrimHttpsScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryQuickProviderTest,
CorrectAutocompleteWithTrailingSlash); CorrectAutocompleteWithTrailingSlash);
~HistoryQuickProvider() override; ~HistoryQuickProvider() override;
......
...@@ -228,15 +228,22 @@ class HistoryURLProvider : public HistoryProvider { ...@@ -228,15 +228,22 @@ class HistoryURLProvider : public HistoryProvider {
history::URLDatabase* db); history::URLDatabase* db);
private: private:
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, HUPScoringExperiment); // Flaky leaks on ASAN LSAN (crbug.com/1010691).
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, DoTrimHttpScheme); #if defined(ADDRESS_SANITIZER)
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, #define MAYBE_HistoryURLProviderTest DISABLED_HistoryURLProviderTest
#else
#define MAYBE_HistoryURLProviderTest HistoryURLProviderTest
#endif
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest, HUPScoringExperiment);
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest, DoTrimHttpScheme);
FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest,
DontTrimHttpSchemeIfInputHasScheme); DontTrimHttpSchemeIfInputHasScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest,
DontTrimHttpSchemeIfInputMatchesInScheme); DontTrimHttpSchemeIfInputMatchesInScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest,
DontTrimHttpsSchemeIfInputMatchesInScheme); DontTrimHttpsSchemeIfInputMatchesInScheme);
FRIEND_TEST_ALL_PREFIXES(HistoryURLProviderTest, DoTrimHttpsScheme); FRIEND_TEST_ALL_PREFIXES(MAYBE_HistoryURLProviderTest, DoTrimHttpsScheme);
enum MatchType { enum MatchType {
NORMAL, NORMAL,
......
...@@ -29,8 +29,15 @@ ...@@ -29,8 +29,15 @@
#include "components/omnibox/browser/scored_history_match.h" #include "components/omnibox/browser/scored_history_match.h"
#include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service.h"
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_HistoryQuickProviderTest DISABLED_HistoryQuickProviderTest
#else
#define MAYBE_HistoryQuickProviderTest HistoryQuickProviderTest
#endif
class FakeAutocompleteProviderClient; class FakeAutocompleteProviderClient;
class HistoryQuickProviderTest; class MAYBE_HistoryQuickProviderTest;
namespace base { namespace base {
class SequencedTaskRunner; class SequencedTaskRunner;
...@@ -145,12 +152,19 @@ class InMemoryURLIndex : public KeyedService, ...@@ -145,12 +152,19 @@ class InMemoryURLIndex : public KeyedService,
} }
private: private:
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_InMemoryURLIndexTest DISABLED_InMemoryURLIndexTest
#else
#define MAYBE_InMemoryURLIndexTest InMemoryURLIndexTest
#endif
friend class ::FakeAutocompleteProviderClient; friend class ::FakeAutocompleteProviderClient;
friend class ::HistoryQuickProviderTest; friend class ::MAYBE_HistoryQuickProviderTest;
friend class history::HQPPerfTestOnePopularURL; friend class history::HQPPerfTestOnePopularURL;
friend class InMemoryURLIndexTest; friend class MAYBE_InMemoryURLIndexTest;
friend class InMemoryURLIndexCacheTest; friend class InMemoryURLIndexCacheTest;
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, ExpireRow); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, ExpireRow);
FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization); FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization);
// HistoryDBTask used to rebuild our private data from the history database. // HistoryDBTask used to rebuild our private data from the history database.
......
...@@ -46,7 +46,13 @@ class TestingSchemeClassifier : public AutocompleteSchemeClassifier { ...@@ -46,7 +46,13 @@ class TestingSchemeClassifier : public AutocompleteSchemeClassifier {
} // namespace } // namespace
class KeywordProviderTest : public testing::Test { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_KeywordProviderTest DISABLED_KeywordProviderTest
#else
#define MAYBE_KeywordProviderTest KeywordProviderTest
#endif
class MAYBE_KeywordProviderTest : public testing::Test {
protected: protected:
template<class ResultType> template<class ResultType>
struct MatchType { struct MatchType {
...@@ -61,7 +67,7 @@ class KeywordProviderTest : public testing::Test { ...@@ -61,7 +67,7 @@ class KeywordProviderTest : public testing::Test {
const MatchType<ResultType> output[3]; const MatchType<ResultType> output[3];
}; };
KeywordProviderTest() : kw_provider_(nullptr) { MAYBE_KeywordProviderTest() : kw_provider_(nullptr) {
// Destroy the existing FieldTrialList before creating a new one to avoid // Destroy the existing FieldTrialList before creating a new one to avoid
// a DCHECK. // a DCHECK.
field_trial_list_.reset(); field_trial_list_.reset();
...@@ -69,7 +75,7 @@ class KeywordProviderTest : public testing::Test { ...@@ -69,7 +75,7 @@ class KeywordProviderTest : public testing::Test {
std::make_unique<variations::SHA1EntropyProvider>("foo"))); std::make_unique<variations::SHA1EntropyProvider>("foo")));
variations::testing::ClearAllVariationParams(); variations::testing::ClearAllVariationParams();
} }
~KeywordProviderTest() override {} ~MAYBE_KeywordProviderTest() override {}
// Should be called at least once during a test case. This is a separate // Should be called at least once during a test case. This is a separate
// function from SetUp() because the client may want to set parameters // function from SetUp() because the client may want to set parameters
...@@ -94,7 +100,7 @@ class KeywordProviderTest : public testing::Test { ...@@ -94,7 +100,7 @@ class KeywordProviderTest : public testing::Test {
}; };
// static // static
const TemplateURLService::Initializer KeywordProviderTest::kTestData[] = { const TemplateURLService::Initializer MAYBE_KeywordProviderTest::kTestData[] = {
{"aa", "aa.com?foo={searchTerms}", "aa"}, {"aa", "aa.com?foo={searchTerms}", "aa"},
{"aaaa", "http://aaaa/?aaaa=1&b={searchTerms}&c", "aaaa"}, {"aaaa", "http://aaaa/?aaaa=1&b={searchTerms}&c", "aaaa"},
{"aaaaa", "{searchTerms}", "aaaaa"}, {"aaaaa", "{searchTerms}", "aaaaa"},
...@@ -130,22 +136,22 @@ const TemplateURLService::Initializer KeywordProviderTest::kTestData[] = { ...@@ -130,22 +136,22 @@ const TemplateURLService::Initializer KeywordProviderTest::kTestData[] = {
"clean v8 slash"}, "clean v8 slash"},
}; };
void KeywordProviderTest::SetUpClientAndKeywordProvider() { void MAYBE_KeywordProviderTest::SetUpClientAndKeywordProvider() {
client_.reset(new MockAutocompleteProviderClient()); client_.reset(new MockAutocompleteProviderClient());
client_->set_template_url_service( client_->set_template_url_service(
std::make_unique<TemplateURLService>(kTestData, base::size(kTestData))); std::make_unique<TemplateURLService>(kTestData, base::size(kTestData)));
kw_provider_ = new KeywordProvider(client_.get(), nullptr); kw_provider_ = new KeywordProvider(client_.get(), nullptr);
} }
void KeywordProviderTest::TearDown() { void MAYBE_KeywordProviderTest::TearDown() {
client_.reset(); client_.reset();
kw_provider_ = nullptr; kw_provider_ = nullptr;
} }
template<class ResultType> template <class ResultType>
void KeywordProviderTest::RunTest(TestData<ResultType>* keyword_cases, void MAYBE_KeywordProviderTest::RunTest(TestData<ResultType>* keyword_cases,
int num_cases, int num_cases,
ResultType AutocompleteMatch::* member) { ResultType AutocompleteMatch::*member) {
ACMatches matches; ACMatches matches;
for (int i = 0; i < num_cases; ++i) { for (int i = 0; i < num_cases; ++i) {
SCOPED_TRACE(keyword_cases[i].input); SCOPED_TRACE(keyword_cases[i].input);
...@@ -164,7 +170,7 @@ void KeywordProviderTest::RunTest(TestData<ResultType>* keyword_cases, ...@@ -164,7 +170,7 @@ void KeywordProviderTest::RunTest(TestData<ResultType>* keyword_cases,
} }
} }
TEST_F(KeywordProviderTest, Edit) { TEST_F(MAYBE_KeywordProviderTest, Edit) {
const MatchType<base::string16> kEmptyMatch = { base::string16(), false }; const MatchType<base::string16> kEmptyMatch = { base::string16(), false };
TestData<base::string16> edit_cases[] = { TestData<base::string16> edit_cases[] = {
// Searching for a nonexistent prefix should give nothing. // Searching for a nonexistent prefix should give nothing.
...@@ -271,7 +277,7 @@ TEST_F(KeywordProviderTest, Edit) { ...@@ -271,7 +277,7 @@ TEST_F(KeywordProviderTest, Edit) {
&AutocompleteMatch::fill_into_edit); &AutocompleteMatch::fill_into_edit);
} }
TEST_F(KeywordProviderTest, DomainMatches) { TEST_F(MAYBE_KeywordProviderTest, DomainMatches) {
const MatchType<base::string16> kEmptyMatch = { base::string16(), false }; const MatchType<base::string16> kEmptyMatch = { base::string16(), false };
TestData<base::string16> edit_cases[] = { TestData<base::string16> edit_cases[] = {
// Searching for a nonexistent prefix should give nothing. // Searching for a nonexistent prefix should give nothing.
...@@ -322,7 +328,7 @@ TEST_F(KeywordProviderTest, DomainMatches) { ...@@ -322,7 +328,7 @@ TEST_F(KeywordProviderTest, DomainMatches) {
&AutocompleteMatch::fill_into_edit); &AutocompleteMatch::fill_into_edit);
} }
TEST_F(KeywordProviderTest, IgnoreRegistryForScoring) { TEST_F(MAYBE_KeywordProviderTest, IgnoreRegistryForScoring) {
const MatchType<base::string16> kEmptyMatch = { base::string16(), false }; const MatchType<base::string16> kEmptyMatch = { base::string16(), false };
TestData<base::string16> edit_cases[] = { TestData<base::string16> edit_cases[] = {
// Matches should be limited to three and sorted in quality order. // Matches should be limited to three and sorted in quality order.
...@@ -367,7 +373,7 @@ TEST_F(KeywordProviderTest, IgnoreRegistryForScoring) { ...@@ -367,7 +373,7 @@ TEST_F(KeywordProviderTest, IgnoreRegistryForScoring) {
&AutocompleteMatch::fill_into_edit); &AutocompleteMatch::fill_into_edit);
} }
TEST_F(KeywordProviderTest, DISABLED_URL) { TEST_F(MAYBE_KeywordProviderTest, DISABLED_URL) {
const MatchType<GURL> kEmptyMatch = { GURL(), false }; const MatchType<GURL> kEmptyMatch = { GURL(), false };
TestData<GURL> url_cases[] = { TestData<GURL> url_cases[] = {
// No query input -> empty destination URL. // No query input -> empty destination URL.
...@@ -405,7 +411,7 @@ TEST_F(KeywordProviderTest, DISABLED_URL) { ...@@ -405,7 +411,7 @@ TEST_F(KeywordProviderTest, DISABLED_URL) {
&AutocompleteMatch::destination_url); &AutocompleteMatch::destination_url);
} }
TEST_F(KeywordProviderTest, Contents) { TEST_F(MAYBE_KeywordProviderTest, Contents) {
const MatchType<base::string16> kEmptyMatch = { base::string16(), false }; const MatchType<base::string16> kEmptyMatch = { base::string16(), false };
TestData<base::string16> contents_cases[] = { TestData<base::string16> contents_cases[] = {
// No query input -> substitute "<Type search term>" into contents. // No query input -> substitute "<Type search term>" into contents.
...@@ -456,7 +462,7 @@ TEST_F(KeywordProviderTest, Contents) { ...@@ -456,7 +462,7 @@ TEST_F(KeywordProviderTest, Contents) {
&AutocompleteMatch::contents); &AutocompleteMatch::contents);
} }
TEST_F(KeywordProviderTest, AddKeyword) { TEST_F(MAYBE_KeywordProviderTest, AddKeyword) {
SetUpClientAndKeywordProvider(); SetUpClientAndKeywordProvider();
TemplateURLData data; TemplateURLData data;
data.SetShortName(ASCIIToUTF16("Test")); data.SetShortName(ASCIIToUTF16("Test"));
...@@ -470,7 +476,7 @@ TEST_F(KeywordProviderTest, AddKeyword) { ...@@ -470,7 +476,7 @@ TEST_F(KeywordProviderTest, AddKeyword) {
client_->GetTemplateURLService()->GetTemplateURLForKeyword(keyword)); client_->GetTemplateURLService()->GetTemplateURLForKeyword(keyword));
} }
TEST_F(KeywordProviderTest, RemoveKeyword) { TEST_F(MAYBE_KeywordProviderTest, RemoveKeyword) {
SetUpClientAndKeywordProvider(); SetUpClientAndKeywordProvider();
TemplateURLService* template_url_service = client_->GetTemplateURLService(); TemplateURLService* template_url_service = client_->GetTemplateURLService();
base::string16 url(ASCIIToUTF16("http://aaaa/?aaaa=1&b={searchTerms}&c")); base::string16 url(ASCIIToUTF16("http://aaaa/?aaaa=1&b={searchTerms}&c"));
...@@ -480,7 +486,7 @@ TEST_F(KeywordProviderTest, RemoveKeyword) { ...@@ -480,7 +486,7 @@ TEST_F(KeywordProviderTest, RemoveKeyword) {
ASCIIToUTF16("aaaa")) == nullptr); ASCIIToUTF16("aaaa")) == nullptr);
} }
TEST_F(KeywordProviderTest, GetKeywordForInput) { TEST_F(MAYBE_KeywordProviderTest, GetKeywordForInput) {
SetUpClientAndKeywordProvider(); SetUpClientAndKeywordProvider();
EXPECT_EQ(ASCIIToUTF16("aa"), EXPECT_EQ(ASCIIToUTF16("aa"),
kw_provider_->GetKeywordForText(ASCIIToUTF16("aa"))); kw_provider_->GetKeywordForText(ASCIIToUTF16("aa")));
...@@ -535,7 +541,7 @@ TEST_F(KeywordProviderTest, GetKeywordForInput) { ...@@ -535,7 +541,7 @@ TEST_F(KeywordProviderTest, GetKeywordForInput) {
kw_provider_->GetKeywordForText(ASCIIToUTF16("cleantestv8"))); kw_provider_->GetKeywordForText(ASCIIToUTF16("cleantestv8")));
} }
TEST_F(KeywordProviderTest, GetSubstitutingTemplateURLForInput) { TEST_F(MAYBE_KeywordProviderTest, GetSubstitutingTemplateURLForInput) {
struct { struct {
const std::string text; const std::string text;
const size_t cursor_position; const size_t cursor_position;
...@@ -596,7 +602,7 @@ TEST_F(KeywordProviderTest, GetSubstitutingTemplateURLForInput) { ...@@ -596,7 +602,7 @@ TEST_F(KeywordProviderTest, GetSubstitutingTemplateURLForInput) {
// If extra query params are specified on the command line, they should be // If extra query params are specified on the command line, they should be
// reflected (only) in the default search provider's destination URL. // reflected (only) in the default search provider's destination URL.
TEST_F(KeywordProviderTest, ExtraQueryParams) { TEST_F(MAYBE_KeywordProviderTest, ExtraQueryParams) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kExtraSearchQueryParams, "a=b"); switches::kExtraSearchQueryParams, "a=b");
...@@ -612,7 +618,7 @@ TEST_F(KeywordProviderTest, ExtraQueryParams) { ...@@ -612,7 +618,7 @@ TEST_F(KeywordProviderTest, ExtraQueryParams) {
&AutocompleteMatch::destination_url); &AutocompleteMatch::destination_url);
} }
TEST_F(KeywordProviderTest, DoesNotProvideMatchesOnFocus) { TEST_F(MAYBE_KeywordProviderTest, DoesNotProvideMatchesOnFocus) {
SetUpClientAndKeywordProvider(); SetUpClientAndKeywordProvider();
AutocompleteInput input(ASCIIToUTF16("aaa"), AutocompleteInput input(ASCIIToUTF16("aaa"),
metrics::OmniboxEventProto::OTHER, metrics::OmniboxEventProto::OTHER,
......
...@@ -52,11 +52,19 @@ struct TestMatchData { ...@@ -52,11 +52,19 @@ struct TestMatchData {
} // namespace } // namespace
class LocalHistoryZeroSuggestProviderTest // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_LocalHistoryZeroSuggestProviderTest \
DISABLED_LocalHistoryZeroSuggestProviderTest
#else
#define MAYBE_LocalHistoryZeroSuggestProviderTest \
LocalHistoryZeroSuggestProviderTest
#endif
class MAYBE_LocalHistoryZeroSuggestProviderTest
: public testing::Test, : public testing::Test,
public AutocompleteProviderListener { public AutocompleteProviderListener {
public: public:
LocalHistoryZeroSuggestProviderTest() MAYBE_LocalHistoryZeroSuggestProviderTest()
: client_(std::make_unique<FakeAutocompleteProviderClient>()), : client_(std::make_unique<FakeAutocompleteProviderClient>()),
provider_(base::WrapRefCounted( provider_(base::WrapRefCounted(
LocalHistoryZeroSuggestProvider::Create(client_.get(), this))) { LocalHistoryZeroSuggestProvider::Create(client_.get(), this))) {
...@@ -64,7 +72,7 @@ class LocalHistoryZeroSuggestProviderTest ...@@ -64,7 +72,7 @@ class LocalHistoryZeroSuggestProviderTest
metrics::OmniboxEventProto::NTP_REALBOX, metrics::OmniboxEventProto::NTP_REALBOX,
LocalHistoryZeroSuggestProvider::kZeroSuggestLocalVariant); LocalHistoryZeroSuggestProvider::kZeroSuggestLocalVariant);
} }
~LocalHistoryZeroSuggestProviderTest() override {} ~MAYBE_LocalHistoryZeroSuggestProviderTest() override {}
protected: protected:
// testing::Test // testing::Test
...@@ -110,10 +118,10 @@ class LocalHistoryZeroSuggestProviderTest ...@@ -110,10 +118,10 @@ class LocalHistoryZeroSuggestProviderTest
scoped_refptr<LocalHistoryZeroSuggestProvider> provider_; scoped_refptr<LocalHistoryZeroSuggestProvider> provider_;
private: private:
DISALLOW_COPY_AND_ASSIGN(LocalHistoryZeroSuggestProviderTest); DISALLOW_COPY_AND_ASSIGN(MAYBE_LocalHistoryZeroSuggestProviderTest);
}; };
void LocalHistoryZeroSuggestProviderTest::SetZeroSuggestVariant( void MAYBE_LocalHistoryZeroSuggestProviderTest::SetZeroSuggestVariant(
PageClassification page_classification, PageClassification page_classification,
std::string zero_suggest_variant_value) { std::string zero_suggest_variant_value) {
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
...@@ -124,7 +132,7 @@ void LocalHistoryZeroSuggestProviderTest::SetZeroSuggestVariant( ...@@ -124,7 +132,7 @@ void LocalHistoryZeroSuggestProviderTest::SetZeroSuggestVariant(
zero_suggest_variant_value}}); zero_suggest_variant_value}});
} }
void LocalHistoryZeroSuggestProviderTest::LoadURLs( void MAYBE_LocalHistoryZeroSuggestProviderTest::LoadURLs(
std::vector<TestURLData> url_data_list) { std::vector<TestURLData> url_data_list) {
const Time now = Time::Now(); const Time now = Time::Now();
history::URLRows rows; history::URLRows rows;
...@@ -149,7 +157,7 @@ void LocalHistoryZeroSuggestProviderTest::LoadURLs( ...@@ -149,7 +157,7 @@ void LocalHistoryZeroSuggestProviderTest::LoadURLs(
WaitForHistoryService(); WaitForHistoryService();
} }
void LocalHistoryZeroSuggestProviderTest::WaitForHistoryService() { void MAYBE_LocalHistoryZeroSuggestProviderTest::WaitForHistoryService() {
history::BlockUntilHistoryProcessesPendingRequests( history::BlockUntilHistoryProcessesPendingRequests(
client_->GetHistoryService()); client_->GetHistoryService());
...@@ -158,7 +166,7 @@ void LocalHistoryZeroSuggestProviderTest::WaitForHistoryService() { ...@@ -158,7 +166,7 @@ void LocalHistoryZeroSuggestProviderTest::WaitForHistoryService() {
BlockUntilInMemoryURLIndexIsRefreshed(client_->GetInMemoryURLIndex()); BlockUntilInMemoryURLIndexIsRefreshed(client_->GetInMemoryURLIndex());
} }
void LocalHistoryZeroSuggestProviderTest::StartProviderAndWaitUntilDone( void MAYBE_LocalHistoryZeroSuggestProviderTest::StartProviderAndWaitUntilDone(
const std::string& text = "", const std::string& text = "",
bool from_omnibox_focus = true, bool from_omnibox_focus = true,
PageClassification page_classification = PageClassification page_classification =
...@@ -174,13 +182,13 @@ void LocalHistoryZeroSuggestProviderTest::StartProviderAndWaitUntilDone( ...@@ -174,13 +182,13 @@ void LocalHistoryZeroSuggestProviderTest::StartProviderAndWaitUntilDone(
} }
} }
void LocalHistoryZeroSuggestProviderTest::OnProviderUpdate( void MAYBE_LocalHistoryZeroSuggestProviderTest::OnProviderUpdate(
bool updated_matches) { bool updated_matches) {
if (provider_->done() && provider_run_loop_) if (provider_->done() && provider_run_loop_)
provider_run_loop_->Quit(); provider_run_loop_->Quit();
} }
void LocalHistoryZeroSuggestProviderTest::ExpectMatches( void MAYBE_LocalHistoryZeroSuggestProviderTest::ExpectMatches(
std::vector<TestMatchData> match_data_list) { std::vector<TestMatchData> match_data_list) {
ASSERT_EQ(match_data_list.size(), provider_->matches().size()); ASSERT_EQ(match_data_list.size(), provider_->matches().size());
size_t index = 0; size_t index = 0;
...@@ -195,7 +203,7 @@ void LocalHistoryZeroSuggestProviderTest::ExpectMatches( ...@@ -195,7 +203,7 @@ void LocalHistoryZeroSuggestProviderTest::ExpectMatches(
} }
// Tests that suggestions are returned only if when input is empty and focused. // Tests that suggestions are returned only if when input is empty and focused.
TEST_F(LocalHistoryZeroSuggestProviderTest, Input) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, Input) {
LoadURLs({ LoadURLs({
{default_search_provider(), "hello world", "&foo=bar", 1}, {default_search_provider(), "hello world", "&foo=bar", 1},
}); });
...@@ -212,7 +220,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Input) { ...@@ -212,7 +220,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Input) {
// Tests that suggestions are returned only if ZeroSuggestVariant is configured // Tests that suggestions are returned only if ZeroSuggestVariant is configured
// to return local history suggestions in the NTP. // to return local history suggestions in the NTP.
TEST_F(LocalHistoryZeroSuggestProviderTest, ZeroSuggestVariant) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, ZeroSuggestVariant) {
LoadURLs({ LoadURLs({
{default_search_provider(), "hello world", "&foo=bar", 1}, {default_search_provider(), "hello world", "&foo=bar", 1},
}); });
...@@ -248,7 +256,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, ZeroSuggestVariant) { ...@@ -248,7 +256,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, ZeroSuggestVariant) {
// Tests that search terms are extracted from the default search provider's // Tests that search terms are extracted from the default search provider's
// search history only and only when Google is the default search provider. // search history only and only when Google is the default search provider.
TEST_F(LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) {
auto* template_url_service = client_->GetTemplateURLService(); auto* template_url_service = client_->GetTemplateURLService();
auto* other_search_provider = template_url_service->Add( auto* other_search_provider = template_url_service->Add(
std::make_unique<TemplateURL>(*GenerateDummyTemplateURLData("other"))); std::make_unique<TemplateURL>(*GenerateDummyTemplateURLData("other")));
...@@ -274,7 +282,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) { ...@@ -274,7 +282,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) {
// Tests that search terms are extracted with the correct encoding, whitespaces // Tests that search terms are extracted with the correct encoding, whitespaces
// are collapsed, search terms are lowercased and duplicated, and empty searches // are collapsed, search terms are lowercased and duplicated, and empty searches
// are ignored. // are ignored.
TEST_F(LocalHistoryZeroSuggestProviderTest, SearchTerms) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, SearchTerms) {
LoadURLs({ LoadURLs({
{default_search_provider(), "hello world", "&foo=bar", 1}, {default_search_provider(), "hello world", "&foo=bar", 1},
{default_search_provider(), "hello world", "&foo=bar", 1}, {default_search_provider(), "hello world", "&foo=bar", 1},
...@@ -290,7 +298,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, SearchTerms) { ...@@ -290,7 +298,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, SearchTerms) {
} }
// Tests that the suggestions are ordered by recency. // Tests that the suggestions are ordered by recency.
TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Recency) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, Suggestions_Recency) {
LoadURLs({ LoadURLs({
{default_search_provider(), "less recent search", "&foo=bar", 2}, {default_search_provider(), "less recent search", "&foo=bar", 2},
{default_search_provider(), "more recent search", "&foo=bar", 1}, {default_search_provider(), "more recent search", "&foo=bar", 1},
...@@ -301,7 +309,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Recency) { ...@@ -301,7 +309,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Recency) {
} }
// Tests that suggestions are created from fresh search histories only. // Tests that suggestions are created from fresh search histories only.
TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Freshness) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, Suggestions_Freshness) {
int fresh = (Time::Now() - history::AutocompleteAgeThreshold()).InDays() - 1; int fresh = (Time::Now() - history::AutocompleteAgeThreshold()).InDays() - 1;
int stale = (Time::Now() - history::AutocompleteAgeThreshold()).InDays() + 1; int stale = (Time::Now() - history::AutocompleteAgeThreshold()).InDays() + 1;
LoadURLs({ LoadURLs({
...@@ -315,7 +323,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Freshness) { ...@@ -315,7 +323,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Suggestions_Freshness) {
// Tests that all the search URLs that would produce a given suggestion get // Tests that all the search URLs that would produce a given suggestion get
// deleted when the autocomplete match is deleted. // deleted when the autocomplete match is deleted.
TEST_F(LocalHistoryZeroSuggestProviderTest, DISABLED_Delete) { TEST_F(MAYBE_LocalHistoryZeroSuggestProviderTest, DISABLED_Delete) {
LoadURLs({ LoadURLs({
{default_search_provider(), "hello world", "&foo=bar&aqs=1", 1}, {default_search_provider(), "hello world", "&foo=bar&aqs=1", 1},
{default_search_provider(), "HELLO WORLD", "&foo=bar&aqs=12", 1}, {default_search_provider(), "HELLO WORLD", "&foo=bar&aqs=12", 1},
......
...@@ -77,12 +77,18 @@ class FakeLocationBarModelDelegate : public LocationBarModelDelegate { ...@@ -77,12 +77,18 @@ class FakeLocationBarModelDelegate : public LocationBarModelDelegate {
bool connection_info_initialized_ = true; bool connection_info_initialized_ = true;
}; };
class LocationBarModelImplTest : public testing::Test { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_LocationBarModelImplTest DISABLED_LocationBarModelImplTest
#else
#define MAYBE_LocationBarModelImplTest LocationBarModelImplTest
#endif
class MAYBE_LocationBarModelImplTest : public testing::Test {
protected: protected:
const GURL kValidSearchResultsPage = const GURL kValidSearchResultsPage =
GURL("https://www.google.com/search?q=foo+query"); GURL("https://www.google.com/search?q=foo+query");
LocationBarModelImplTest() : model_(&delegate_, 1024) {} MAYBE_LocationBarModelImplTest() : model_(&delegate_, 1024) {}
FakeLocationBarModelDelegate* delegate() { return &delegate_; } FakeLocationBarModelDelegate* delegate() { return &delegate_; }
...@@ -94,7 +100,7 @@ class LocationBarModelImplTest : public testing::Test { ...@@ -94,7 +100,7 @@ class LocationBarModelImplTest : public testing::Test {
LocationBarModelImpl model_; LocationBarModelImpl model_;
}; };
TEST_F(LocationBarModelImplTest, TEST_F(MAYBE_LocationBarModelImplTest,
DisplayUrlAppliesFormattedStringWithEquivalentMeaning) { DisplayUrlAppliesFormattedStringWithEquivalentMeaning) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures({omnibox::kHideSteadyStateUrlScheme, feature_list.InitWithFeatures({omnibox::kHideSteadyStateUrlScheme,
...@@ -118,7 +124,7 @@ TEST_F(LocationBarModelImplTest, ...@@ -118,7 +124,7 @@ TEST_F(LocationBarModelImplTest,
#else #else
#define MAYBE_PreventElisionWorks PreventElisionWorks #define MAYBE_PreventElisionWorks PreventElisionWorks
#endif #endif
TEST_F(LocationBarModelImplTest, MAYBE_PreventElisionWorks) { TEST_F(MAYBE_LocationBarModelImplTest, MAYBE_PreventElisionWorks) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures( feature_list.InitWithFeatures(
{omnibox::kHideSteadyStateUrlScheme, {omnibox::kHideSteadyStateUrlScheme,
...@@ -137,7 +143,7 @@ TEST_F(LocationBarModelImplTest, MAYBE_PreventElisionWorks) { ...@@ -137,7 +143,7 @@ TEST_F(LocationBarModelImplTest, MAYBE_PreventElisionWorks) {
EXPECT_FALSE(model()->GetDisplaySearchTerms(nullptr)); EXPECT_FALSE(model()->GetDisplaySearchTerms(nullptr));
} }
TEST_F(LocationBarModelImplTest, QueryInOmniboxFeatureFlagWorks) { TEST_F(MAYBE_LocationBarModelImplTest, QueryInOmniboxFeatureFlagWorks) {
delegate()->SetURL(kValidSearchResultsPage); delegate()->SetURL(kValidSearchResultsPage);
delegate()->SetSecurityLevel(security_state::SecurityLevel::SECURE); delegate()->SetSecurityLevel(security_state::SecurityLevel::SECURE);
...@@ -149,7 +155,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxFeatureFlagWorks) { ...@@ -149,7 +155,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxFeatureFlagWorks) {
EXPECT_TRUE(model()->GetDisplaySearchTerms(nullptr)); EXPECT_TRUE(model()->GetDisplaySearchTerms(nullptr));
} }
TEST_F(LocationBarModelImplTest, QueryInOmniboxSecurityLevel) { TEST_F(MAYBE_LocationBarModelImplTest, QueryInOmniboxSecurityLevel) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox); scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox);
...@@ -174,7 +180,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxSecurityLevel) { ...@@ -174,7 +180,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxSecurityLevel) {
EXPECT_TRUE(model()->GetDisplaySearchTerms(nullptr)); EXPECT_TRUE(model()->GetDisplaySearchTerms(nullptr));
} }
TEST_F(LocationBarModelImplTest, TEST_F(MAYBE_LocationBarModelImplTest,
QueryInOmniboxDefaultSearchProviderWithAndWithoutQuery) { QueryInOmniboxDefaultSearchProviderWithAndWithoutQuery) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox); scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox);
...@@ -193,7 +199,7 @@ TEST_F(LocationBarModelImplTest, ...@@ -193,7 +199,7 @@ TEST_F(LocationBarModelImplTest,
EXPECT_EQ(base::string16(), result); EXPECT_EQ(base::string16(), result);
} }
TEST_F(LocationBarModelImplTest, QueryInOmniboxNonDefaultSearchProvider) { TEST_F(MAYBE_LocationBarModelImplTest, QueryInOmniboxNonDefaultSearchProvider) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox); scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox);
...@@ -207,7 +213,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxNonDefaultSearchProvider) { ...@@ -207,7 +213,7 @@ TEST_F(LocationBarModelImplTest, QueryInOmniboxNonDefaultSearchProvider) {
EXPECT_EQ(base::string16(), result); EXPECT_EQ(base::string16(), result);
} }
TEST_F(LocationBarModelImplTest, QueryInOmniboxLookalikeURL) { TEST_F(MAYBE_LocationBarModelImplTest, QueryInOmniboxLookalikeURL) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox); scoped_feature_list.InitAndEnableFeature(omnibox::kQueryInOmnibox);
......
...@@ -16,10 +16,16 @@ ...@@ -16,10 +16,16 @@
#include "components/sessions/core/session_id.h" #include "components/sessions/core/session_id.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
class OmniboxControllerTest : public testing::Test { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxControllerTest DISABLED_OmniboxControllerTest
#else
#define MAYBE_OmniboxControllerTest OmniboxControllerTest
#endif
class MAYBE_OmniboxControllerTest : public testing::Test {
protected: protected:
OmniboxControllerTest(); MAYBE_OmniboxControllerTest();
~OmniboxControllerTest() override; ~MAYBE_OmniboxControllerTest() override;
void CreateController(); void CreateController();
void AssertProviders(int expected_providers); void AssertProviders(int expected_providers);
...@@ -37,14 +43,14 @@ class OmniboxControllerTest : public testing::Test { ...@@ -37,14 +43,14 @@ class OmniboxControllerTest : public testing::Test {
std::unique_ptr<TestOmniboxClient> omnibox_client_; std::unique_ptr<TestOmniboxClient> omnibox_client_;
std::unique_ptr<OmniboxController> omnibox_controller_; std::unique_ptr<OmniboxController> omnibox_controller_;
DISALLOW_COPY_AND_ASSIGN(OmniboxControllerTest); DISALLOW_COPY_AND_ASSIGN(MAYBE_OmniboxControllerTest);
}; };
OmniboxControllerTest::OmniboxControllerTest() {} MAYBE_OmniboxControllerTest::MAYBE_OmniboxControllerTest() {}
OmniboxControllerTest::~OmniboxControllerTest() {} MAYBE_OmniboxControllerTest::~MAYBE_OmniboxControllerTest() {}
void OmniboxControllerTest::CreateController() { void MAYBE_OmniboxControllerTest::CreateController() {
DCHECK(omnibox_client_); DCHECK(omnibox_client_);
omnibox_controller_ = omnibox_controller_ =
std::make_unique<OmniboxController>(nullptr, omnibox_client_.get()); std::make_unique<OmniboxController>(nullptr, omnibox_client_.get());
...@@ -52,7 +58,7 @@ void OmniboxControllerTest::CreateController() { ...@@ -52,7 +58,7 @@ void OmniboxControllerTest::CreateController() {
// Checks that the list of autocomplete providers used by the OmniboxController // Checks that the list of autocomplete providers used by the OmniboxController
// matches the one in the |expected_providers| bit field. // matches the one in the |expected_providers| bit field.
void OmniboxControllerTest::AssertProviders(int expected_providers) { void MAYBE_OmniboxControllerTest::AssertProviders(int expected_providers) {
const AutocompleteController::Providers& providers = const AutocompleteController::Providers& providers =
GetAutocompleteProviders(); GetAutocompleteProviders();
...@@ -69,16 +75,16 @@ void OmniboxControllerTest::AssertProviders(int expected_providers) { ...@@ -69,16 +75,16 @@ void OmniboxControllerTest::AssertProviders(int expected_providers) {
ASSERT_EQ(0, expected_providers); ASSERT_EQ(0, expected_providers);
} }
void OmniboxControllerTest::SetUp() { void MAYBE_OmniboxControllerTest::SetUp() {
omnibox_client_ = std::make_unique<TestOmniboxClient>(); omnibox_client_ = std::make_unique<TestOmniboxClient>();
} }
void OmniboxControllerTest::TearDown() { void MAYBE_OmniboxControllerTest::TearDown() {
omnibox_controller_.reset(); omnibox_controller_.reset();
omnibox_client_.reset(); omnibox_client_.reset();
} }
TEST_F(OmniboxControllerTest, CheckDefaultAutocompleteProviders) { TEST_F(MAYBE_OmniboxControllerTest, CheckDefaultAutocompleteProviders) {
CreateController(); CreateController();
// First collect the basic providers. // First collect the basic providers.
int observed_providers = 0; int observed_providers = 0;
......
...@@ -379,11 +379,20 @@ class OmniboxEditModel { ...@@ -379,11 +379,20 @@ class OmniboxEditModel {
OmniboxView* view() { return view_; } OmniboxView* view() { return view_; }
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxEditModelTest DISABLED_OmniboxEditModelTest
#else
#define MAYBE_OmniboxEditModelTest OmniboxEditModelTest
#endif
private: private:
friend class OmniboxControllerTest; friend class MAYBE_OmniboxControllerTest;
FRIEND_TEST_ALL_PREFIXES(OmniboxEditModelTest, ConsumeCtrlKey); FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxEditModelTest, ConsumeCtrlKey);
FRIEND_TEST_ALL_PREFIXES(OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus); FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxEditModelTest,
FRIEND_TEST_ALL_PREFIXES(OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction); ConsumeCtrlKeyOnRequestFocus);
FRIEND_TEST_ALL_PREFIXES(MAYBE_OmniboxEditModelTest,
ConsumeCtrlKeyOnCtrlAction);
enum PasteState { enum PasteState {
NONE, // Most recent edit was not a paste. NONE, // Most recent edit was not a paste.
......
...@@ -28,7 +28,13 @@ ...@@ -28,7 +28,13 @@
using metrics::OmniboxEventProto; using metrics::OmniboxEventProto;
class OmniboxEditModelTest : public testing::Test { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxEditModelTest DISABLED_OmniboxEditModelTest
#else
#define MAYBE_OmniboxEditModelTest OmniboxEditModelTest
#endif
class MAYBE_OmniboxEditModelTest : public testing::Test {
public: public:
void SetUp() override { void SetUp() override {
controller_ = std::make_unique<TestOmniboxEditController>(); controller_ = std::make_unique<TestOmniboxEditController>();
...@@ -52,7 +58,7 @@ class OmniboxEditModelTest : public testing::Test { ...@@ -52,7 +58,7 @@ class OmniboxEditModelTest : public testing::Test {
}; };
// Tests various permutations of AutocompleteModel::AdjustTextForCopy. // Tests various permutations of AutocompleteModel::AdjustTextForCopy.
TEST_F(OmniboxEditModelTest, AdjustTextForCopy) { TEST_F(MAYBE_OmniboxEditModelTest, AdjustTextForCopy) {
struct Data { struct Data {
const char* url_for_editing; const char* url_for_editing;
const int sel_start; const int sel_start;
...@@ -192,7 +198,14 @@ TEST_F(OmniboxEditModelTest, AdjustTextForCopy) { ...@@ -192,7 +198,14 @@ TEST_F(OmniboxEditModelTest, AdjustTextForCopy) {
// Tests that AdjustTextForCopy behaves properly with Query in Omnibox enabled. // Tests that AdjustTextForCopy behaves properly with Query in Omnibox enabled.
// For more general tests of copy adjustment, see the AdjustTextForCopy test. // For more general tests of copy adjustment, see the AdjustTextForCopy test.
TEST_F(OmniboxEditModelTest, AdjustTextForCopyQueryInOmnibox) { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_AdjustTextForCopyQueryInOmnibox \
DISABLED_AdjustTextForCopyQueryInOmnibox
#else
#define MAYBE_AdjustTextForCopyQueryInOmnibox AdjustTextForCopyQueryInOmnibox
#endif
TEST_F(MAYBE_OmniboxEditModelTest, MAYBE_AdjustTextForCopyQueryInOmnibox) {
location_bar_model()->set_url(GURL("https://www.example.com/")); location_bar_model()->set_url(GURL("https://www.example.com/"));
location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com")); location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com"));
location_bar_model()->set_display_search_terms(base::ASCIIToUTF16("foobar")); location_bar_model()->set_display_search_terms(base::ASCIIToUTF16("foobar"));
...@@ -223,7 +236,7 @@ TEST_F(OmniboxEditModelTest, AdjustTextForCopyQueryInOmnibox) { ...@@ -223,7 +236,7 @@ TEST_F(OmniboxEditModelTest, AdjustTextForCopyQueryInOmnibox) {
} }
} }
TEST_F(OmniboxEditModelTest, DISABLED_InlineAutocompleteText) { TEST_F(MAYBE_OmniboxEditModelTest, DISABLED_InlineAutocompleteText) {
// Test if the model updates the inline autocomplete text in the view. // Test if the model updates the inline autocomplete text in the view.
EXPECT_EQ(base::string16(), view()->inline_autocomplete_text()); EXPECT_EQ(base::string16(), view()->inline_autocomplete_text());
model()->SetUserText(base::ASCIIToUTF16("he")); model()->SetUserText(base::ASCIIToUTF16("he"));
...@@ -260,7 +273,7 @@ TEST_F(OmniboxEditModelTest, DISABLED_InlineAutocompleteText) { ...@@ -260,7 +273,7 @@ TEST_F(OmniboxEditModelTest, DISABLED_InlineAutocompleteText) {
// iOS doesn't use elisions in the Omnibox textfield. // iOS doesn't use elisions in the Omnibox textfield.
#if !defined(OS_IOS) #if !defined(OS_IOS)
TEST_F(OmniboxEditModelTest, RespectUnelisionInZeroSuggest) { TEST_F(MAYBE_OmniboxEditModelTest, RespectUnelisionInZeroSuggest) {
location_bar_model()->set_url(GURL("https://www.example.com/")); location_bar_model()->set_url(GURL("https://www.example.com/"));
location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com")); location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com"));
...@@ -289,7 +302,7 @@ TEST_F(OmniboxEditModelTest, RespectUnelisionInZeroSuggest) { ...@@ -289,7 +302,7 @@ TEST_F(OmniboxEditModelTest, RespectUnelisionInZeroSuggest) {
// The failure was due to erroneously trying to strip the scheme from the // The failure was due to erroneously trying to strip the scheme from the
// resulting fill_into_edit. Alternate nav matches are never shown, so there's // resulting fill_into_edit. Alternate nav matches are never shown, so there's
// no need to ever try and strip this scheme. // no need to ever try and strip this scheme.
TEST_F(OmniboxEditModelTest, AlternateNavHasHTTP) { TEST_F(MAYBE_OmniboxEditModelTest, AlternateNavHasHTTP) {
const TestOmniboxClient* client = const TestOmniboxClient* client =
static_cast<TestOmniboxClient*>(model()->client()); static_cast<TestOmniboxClient*>(model()->client());
const AutocompleteMatch match( const AutocompleteMatch match(
...@@ -311,7 +324,13 @@ TEST_F(OmniboxEditModelTest, AlternateNavHasHTTP) { ...@@ -311,7 +324,13 @@ TEST_F(OmniboxEditModelTest, AlternateNavHasHTTP) {
client->alternate_nav_match().fill_into_edit)); client->alternate_nav_match().fill_into_edit));
} }
TEST_F(OmniboxEditModelTest, CurrentMatch) { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_CurrentMatch DISABLED_CurrentMatch
#else
#define MAYBE_CurrentMatch CurrentMatch
#endif
TEST_F(MAYBE_OmniboxEditModelTest, MAYBE_CurrentMatch) {
location_bar_model()->set_url(GURL("http://localhost/")); location_bar_model()->set_url(GURL("http://localhost/"));
location_bar_model()->set_url_for_display(base::ASCIIToUTF16("localhost")); location_bar_model()->set_url_for_display(base::ASCIIToUTF16("localhost"));
model()->ResetDisplayTexts(); model()->ResetDisplayTexts();
...@@ -338,7 +357,7 @@ TEST_F(OmniboxEditModelTest, CurrentMatch) { ...@@ -338,7 +357,7 @@ TEST_F(OmniboxEditModelTest, CurrentMatch) {
} }
} }
TEST_F(OmniboxEditModelTest, DisplayText) { TEST_F(MAYBE_OmniboxEditModelTest, DisplayText) {
location_bar_model()->set_url(GURL("https://www.example.com/")); location_bar_model()->set_url(GURL("https://www.example.com/"));
location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com")); location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com"));
...@@ -375,7 +394,13 @@ TEST_F(OmniboxEditModelTest, DisplayText) { ...@@ -375,7 +394,13 @@ TEST_F(OmniboxEditModelTest, DisplayText) {
EXPECT_FALSE(model()->ShouldShowCurrentPageIcon()); EXPECT_FALSE(model()->ShouldShowCurrentPageIcon());
} }
TEST_F(OmniboxEditModelTest, DisplayAndExitQueryInOmnibox) { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_DisplayAndExitQueryInOmnibox DISABLED_DisplayAndExitQueryInOmnibox
#else
#define MAYBE_DisplayAndExitQueryInOmnibox DisplayAndExitQueryInOmnibox
#endif
TEST_F(MAYBE_OmniboxEditModelTest, MAYBE_DisplayAndExitQueryInOmnibox) {
location_bar_model()->set_url(GURL("https://www.example.com/")); location_bar_model()->set_url(GURL("https://www.example.com/"));
location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com")); location_bar_model()->set_url_for_display(base::ASCIIToUTF16("example.com"));
location_bar_model()->set_display_search_terms(base::ASCIIToUTF16("foobar")); location_bar_model()->set_display_search_terms(base::ASCIIToUTF16("foobar"));
...@@ -401,7 +426,7 @@ TEST_F(OmniboxEditModelTest, DisplayAndExitQueryInOmnibox) { ...@@ -401,7 +426,7 @@ TEST_F(OmniboxEditModelTest, DisplayAndExitQueryInOmnibox) {
EXPECT_FALSE(model()->ShouldShowCurrentPageIcon()); EXPECT_FALSE(model()->ShouldShowCurrentPageIcon());
} }
TEST_F(OmniboxEditModelTest, UnelideDoesNothingWhenFullURLAlreadyShown) { TEST_F(MAYBE_OmniboxEditModelTest, UnelideDoesNothingWhenFullURLAlreadyShown) {
location_bar_model()->set_url(GURL("https://www.example.com/")); location_bar_model()->set_url(GURL("https://www.example.com/"));
location_bar_model()->set_url_for_display( location_bar_model()->set_url_for_display(
base::ASCIIToUTF16("https://www.example.com/")); base::ASCIIToUTF16("https://www.example.com/"));
...@@ -424,7 +449,7 @@ TEST_F(OmniboxEditModelTest, UnelideDoesNothingWhenFullURLAlreadyShown) { ...@@ -424,7 +449,7 @@ TEST_F(OmniboxEditModelTest, UnelideDoesNothingWhenFullURLAlreadyShown) {
// The tab-switching system sometimes focuses the Omnibox even if it was not // The tab-switching system sometimes focuses the Omnibox even if it was not
// previously focused. In those cases, ignore the saved focus state. // previously focused. In those cases, ignore the saved focus state.
TEST_F(OmniboxEditModelTest, IgnoreInvalidSavedFocusStates) { TEST_F(MAYBE_OmniboxEditModelTest, IgnoreInvalidSavedFocusStates) {
// The Omnibox starts out unfocused. Save that state. // The Omnibox starts out unfocused. Save that state.
ASSERT_FALSE(model()->has_focus()); ASSERT_FALSE(model()->has_focus());
OmniboxEditModel::State state = model()->GetStateForTabSwitch(); OmniboxEditModel::State state = model()->GetStateForTabSwitch();
...@@ -441,7 +466,7 @@ TEST_F(OmniboxEditModelTest, IgnoreInvalidSavedFocusStates) { ...@@ -441,7 +466,7 @@ TEST_F(OmniboxEditModelTest, IgnoreInvalidSavedFocusStates) {
// Tests ConsumeCtrlKey() consumes ctrl key when down, but does not affect ctrl // Tests ConsumeCtrlKey() consumes ctrl key when down, but does not affect ctrl
// state otherwise. // state otherwise.
TEST_F(OmniboxEditModelTest, ConsumeCtrlKey) { TEST_F(MAYBE_OmniboxEditModelTest, ConsumeCtrlKey) {
model()->control_key_state_ = TestOmniboxEditModel::UP; model()->control_key_state_ = TestOmniboxEditModel::UP;
model()->ConsumeCtrlKey(); model()->ConsumeCtrlKey();
EXPECT_EQ(model()->control_key_state_, TestOmniboxEditModel::UP); EXPECT_EQ(model()->control_key_state_, TestOmniboxEditModel::UP);
...@@ -455,7 +480,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKey) { ...@@ -455,7 +480,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKey) {
} }
// Tests ctrl_key_state_ is set consumed if the ctrl key is down on focus. // Tests ctrl_key_state_ is set consumed if the ctrl key is down on focus.
TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus) { TEST_F(MAYBE_OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus) {
model()->control_key_state_ = TestOmniboxEditModel::DOWN; model()->control_key_state_ = TestOmniboxEditModel::DOWN;
model()->OnSetFocus(false); model()->OnSetFocus(false);
EXPECT_EQ(model()->control_key_state_, TestOmniboxEditModel::UP); EXPECT_EQ(model()->control_key_state_, TestOmniboxEditModel::UP);
...@@ -465,7 +490,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus) { ...@@ -465,7 +490,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus) {
} }
// Tests the ctrl key is consumed on a ctrl-action (e.g. ctrl-c to copy) // Tests the ctrl key is consumed on a ctrl-action (e.g. ctrl-c to copy)
TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction) { TEST_F(MAYBE_OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction) {
model()->control_key_state_ = TestOmniboxEditModel::DOWN; model()->control_key_state_ = TestOmniboxEditModel::DOWN;
OmniboxView::StateChanges state_changes{nullptr, nullptr, 0, 0, OmniboxView::StateChanges state_changes{nullptr, nullptr, 0, 0,
false, false, false, false}; false, false, false, false};
...@@ -474,7 +499,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction) { ...@@ -474,7 +499,7 @@ TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction) {
TestOmniboxEditModel::DOWN_AND_CONSUMED); TestOmniboxEditModel::DOWN_AND_CONSUMED);
} }
TEST_F(OmniboxEditModelTest, KeywordModePreservesInlineAutocompleteText) { TEST_F(MAYBE_OmniboxEditModelTest, KeywordModePreservesInlineAutocompleteText) {
// Set the edit model into an inline autocompletion state. // Set the edit model into an inline autocompletion state.
view()->SetUserText(base::UTF8ToUTF16("user")); view()->SetUserText(base::UTF8ToUTF16("user"));
view()->OnInlineAutocompleteTextMaybeChanged(base::UTF8ToUTF16("user text"), view()->OnInlineAutocompleteTextMaybeChanged(base::UTF8ToUTF16("user text"),
...@@ -500,7 +525,7 @@ TEST_F(OmniboxEditModelTest, KeywordModePreservesInlineAutocompleteText) { ...@@ -500,7 +525,7 @@ TEST_F(OmniboxEditModelTest, KeywordModePreservesInlineAutocompleteText) {
} }
} }
TEST_F(OmniboxEditModelTest, KeywordModePreservesTemporaryText) { TEST_F(MAYBE_OmniboxEditModelTest, KeywordModePreservesTemporaryText) {
// Set the edit model into a temporary text state. // Set the edit model into a temporary text state.
view()->SetUserText(base::UTF8ToUTF16("user text")); view()->SetUserText(base::UTF8ToUTF16("user text"));
GURL destination_url("http://example.com"); GURL destination_url("http://example.com");
......
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
#include "components/omnibox/browser/test_omnibox_edit_controller.h" #include "components/omnibox/browser/test_omnibox_edit_controller.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxPedalImplementationsTest \
DISABLED_OmniboxPedalImplementationsTest
#else
#define MAYBE_OmniboxPedalImplementationsTest OmniboxPedalImplementationsTest
#endif
class OmniboxPedalImplementationsTest : public testing::Test { class OmniboxPedalImplementationsTest : public testing::Test {
protected: protected:
OmniboxPedalImplementationsTest() OmniboxPedalImplementationsTest()
......
...@@ -48,9 +48,15 @@ class TestOmniboxEditModel : public OmniboxEditModel { ...@@ -48,9 +48,15 @@ class TestOmniboxEditModel : public OmniboxEditModel {
} // namespace } // namespace
class OmniboxPopupModelTest : public ::testing::Test { // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_OmniboxPopupModelTest DISABLED_OmniboxPopupModelTest
#else
#define MAYBE_OmniboxPopupModelTest OmniboxPopupModelTest
#endif
class MAYBE_OmniboxPopupModelTest : public ::testing::Test {
public: public:
OmniboxPopupModelTest() MAYBE_OmniboxPopupModelTest()
: view_(&controller_), : view_(&controller_),
model_(&view_, &controller_, std::make_unique<TestOmniboxClient>()), model_(&view_, &controller_, std::make_unique<TestOmniboxClient>()),
popup_model_(&popup_view_, &model_) {} popup_model_(&popup_view_, &model_) {}
...@@ -66,13 +72,13 @@ class OmniboxPopupModelTest : public ::testing::Test { ...@@ -66,13 +72,13 @@ class OmniboxPopupModelTest : public ::testing::Test {
TestOmniboxPopupView popup_view_; TestOmniboxPopupView popup_view_;
OmniboxPopupModel popup_model_; OmniboxPopupModel popup_model_;
DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModelTest); DISALLOW_COPY_AND_ASSIGN(MAYBE_OmniboxPopupModelTest);
}; };
// This verifies that the new treatment of the user's selected match in // This verifies that the new treatment of the user's selected match in
// |SetSelectedLine()| with removed |AutocompleteResult::Selection::empty()| // |SetSelectedLine()| with removed |AutocompleteResult::Selection::empty()|
// is correct in the face of various replacement versions of |empty()|. // is correct in the face of various replacement versions of |empty()|.
TEST_F(OmniboxPopupModelTest, SetSelectedLine) { TEST_F(MAYBE_OmniboxPopupModelTest, SetSelectedLine) {
ACMatches matches; ACMatches matches;
for (size_t i = 0; i < 2; ++i) { for (size_t i = 0; i < 2; ++i) {
AutocompleteMatch match(nullptr, 1000, false, AutocompleteMatch match(nullptr, 1000, false,
...@@ -95,7 +101,7 @@ TEST_F(OmniboxPopupModelTest, SetSelectedLine) { ...@@ -95,7 +101,7 @@ TEST_F(OmniboxPopupModelTest, SetSelectedLine) {
EXPECT_TRUE(popup_model()->has_selected_match()); EXPECT_TRUE(popup_model()->has_selected_match());
} }
TEST_F(OmniboxPopupModelTest, PopupPositionChanging) { TEST_F(MAYBE_OmniboxPopupModelTest, PopupPositionChanging) {
ACMatches matches; ACMatches matches;
for (size_t i = 0; i < 3; ++i) { for (size_t i = 0; i < 3; ++i) {
AutocompleteMatch match(nullptr, 1000, false, AutocompleteMatch match(nullptr, 1000, false,
...@@ -124,7 +130,7 @@ TEST_F(OmniboxPopupModelTest, PopupPositionChanging) { ...@@ -124,7 +130,7 @@ TEST_F(OmniboxPopupModelTest, PopupPositionChanging) {
} }
} }
TEST_F(OmniboxPopupModelTest, ComputeMatchMaxWidths) { TEST_F(MAYBE_OmniboxPopupModelTest, ComputeMatchMaxWidths) {
int contents_max_width, description_max_width; int contents_max_width, description_max_width;
const int separator_width = 10; const int separator_width = 10;
const int kMinimumContentsWidth = 300; const int kMinimumContentsWidth = 300;
...@@ -262,7 +268,7 @@ TEST_F(OmniboxPopupModelTest, ComputeMatchMaxWidths) { ...@@ -262,7 +268,7 @@ TEST_F(OmniboxPopupModelTest, ComputeMatchMaxWidths) {
// Makes sure focus remains on the tab switch button when nothing changes, // Makes sure focus remains on the tab switch button when nothing changes,
// and leaves when it does. Exercises the ratcheting logic in // and leaves when it does. Exercises the ratcheting logic in
// OmniboxPopupModel::OnResultChanged(). // OmniboxPopupModel::OnResultChanged().
TEST_F(OmniboxPopupModelTest, TestFocusFixing) { TEST_F(MAYBE_OmniboxPopupModelTest, TestFocusFixing) {
ACMatches matches; ACMatches matches;
AutocompleteMatch match(nullptr, 1000, false, AutocompleteMatch match(nullptr, 1000, false,
AutocompleteMatchType::URL_WHAT_YOU_TYPED); AutocompleteMatchType::URL_WHAT_YOU_TYPED);
......
...@@ -20,7 +20,13 @@ ...@@ -20,7 +20,13 @@
#include "components/omnibox/browser/in_memory_url_index_types.h" #include "components/omnibox/browser/in_memory_url_index_types.h"
#include "components/omnibox/browser/scored_history_match.h" #include "components/omnibox/browser/scored_history_match.h"
class HistoryQuickProviderTest; // Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_HistoryQuickProviderTest DISABLED_HistoryQuickProviderTest
#else
#define MAYBE_HistoryQuickProviderTest HistoryQuickProviderTest
#endif
class MAYBE_HistoryQuickProviderTest;
class TemplateURLService; class TemplateURLService;
namespace bookmarks { namespace bookmarks {
...@@ -150,21 +156,37 @@ class URLIndexPrivateData ...@@ -150,21 +156,37 @@ class URLIndexPrivateData
friend class base::RefCountedThreadSafe<URLIndexPrivateData>; friend class base::RefCountedThreadSafe<URLIndexPrivateData>;
~URLIndexPrivateData(); ~URLIndexPrivateData();
friend class ::HistoryQuickProviderTest; // Flaky leaks on ASAN LSAN (crbug.com/1010691).
friend class InMemoryURLIndexTest; #if defined(ADDRESS_SANITIZER)
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CacheSaveRestore); #define MAYBE_InMemoryURLIndexTest DISABLED_InMemoryURLIndexTest
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CalculateWordStartsOffsets); #else
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, #define MAYBE_InMemoryURLIndexTest InMemoryURLIndexTest
#endif
// Flaky leaks on ASAN LSAN (crbug.com/1010691).
#if defined(ADDRESS_SANITIZER)
#define MAYBE_LimitedInMemoryURLIndexTest DISABLED_LimitedInMemoryURLIndexTest
#else
#define MAYBE_LimitedInMemoryURLIndexTest LimitedInMemoryURLIndexTest
#endif
friend class ::MAYBE_HistoryQuickProviderTest;
friend class MAYBE_InMemoryURLIndexTest;
FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, CacheSaveRestore);
FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest,
CalculateWordStartsOffsets);
FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest,
CalculateWordStartsOffsetsUnderscore); CalculateWordStartsOffsetsUnderscore);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, HugeResultSet); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, HugeResultSet);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, ReadVisitsFromHistory); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, ReadVisitsFromHistory);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, RebuildFromHistoryIfCacheOld); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest,
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, Scoring); RebuildFromHistoryIfCacheOld);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TitleSearch); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, Scoring);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TrimHistoryIds); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, TitleSearch);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TypedCharacterCaching); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, TrimHistoryIds);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, WhitelistedURLs); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, TypedCharacterCaching);
FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization); FRIEND_TEST_ALL_PREFIXES(MAYBE_InMemoryURLIndexTest, WhitelistedURLs);
FRIEND_TEST_ALL_PREFIXES(MAYBE_LimitedInMemoryURLIndexTest, Initialization);
// Support caching of term results so that we can optimize searches which // Support caching of term results so that we can optimize searches which
// build upon a previous search. Each entry in this map represents one // build upon a previous search. Each entry in this map represents one
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment