Skip to content

Commit

Permalink
11895: Fix another memory bug and enable asan for problematic tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
iefremov committed Dec 1, 2020
1 parent 02e2235 commit 26f349b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
3 changes: 3 additions & 0 deletions components/weekly_storage/weekly_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ uint64_t WeeklyStorage::GetHighestValueInWeek() const {
[](const auto& left, const auto& right) {
return left.value < right.value;
});
if (highest_it == last_weeks_daily_values.end()) {
return 0;
}
return highest_it->value;
}

Expand Down
26 changes: 6 additions & 20 deletions test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ if (!is_android) {
"//brave/browser/brave_content_browser_client_browsertest.cc",
"//brave/browser/brave_profile_prefs_browsertest.cc",
"//brave/browser/brave_resources_browsertest.cc",
"//brave/browser/brave_scheme_load_browsertest.cc",
"//brave/browser/brave_shields/ad_block_service_browsertest.cc",
"//brave/browser/brave_shields/cookie_pref_service_browsertest.cc",
"//brave/browser/brave_stats/brave_stats_updater_browsertest.cc",
Expand Down Expand Up @@ -599,6 +600,7 @@ if (!is_android) {
"//brave/browser/ui/views/tabs/brave_tab_context_menu_contents_browsertest.cc",
"//brave/browser/ui/views/toolbar/brave_toolbar_view_browsertest.cc",
"//brave/browser/ui/webui/brave_welcome_ui_browsertest.cc",
"//brave/browser/ui/webui/new_tab_page/brave_new_tab_ui_browsertest.cc",
"//brave/chromium_src/chrome/browser/media/router/media_router_feature_browsertest.cc",
"//brave/chromium_src/chrome/browser/profiles/profile_window_browsertest.cc",
"//brave/chromium_src/chrome/browser/safe_browsing/download_protection/check_client_download_request_base_browsertest.cc",
Expand Down Expand Up @@ -631,15 +633,6 @@ if (!is_android) {
"//chrome/browser/ui/test/test_browser_ui.h",
]

if (!is_asan) {
# Move outside the !is_asan block once
# https://github.com/brave/brave-browser/issues/11897
# https://github.com/brave/brave-browser/issues/11906 is fixed
sources += [
"//brave/browser/brave_scheme_load_browsertest.cc",
"//brave/browser/ui/webui/new_tab_page/brave_new_tab_ui_browsertest.cc",
]
}
if (is_mac) {
sources += [
"//chrome/browser/ui/test/test_browser_dialog_mac.h",
Expand All @@ -656,9 +649,7 @@ if (!is_android) {
"//media:test_support",
]

if (enable_widevine && !is_asan) {
# Remove the !is_asan check once
# https://github.com/brave/brave-browser/issues/11901 is fixed
if (enable_widevine) {
sources += [
"//brave/browser/widevine/widevine_permission_request_browsertest.cc",
"//brave/browser/widevine/widevine_prefs_migration_browsertest.cc",
Expand Down Expand Up @@ -697,7 +688,7 @@ if (!is_android) {
]
}

if (binance_enabled && !is_asan) {
if (binance_enabled) {
sources += [
"//brave/components/binance/browser/binance_service_browsertest.cc",
]
Expand All @@ -708,7 +699,7 @@ if (!is_android) {
]
}

if (gemini_enabled && !is_asan) {
if (gemini_enabled) {
sources +=
[ "//brave/components/gemini/browser/gemini_service_browsertest.cc" ]
deps += [
Expand Down Expand Up @@ -744,6 +735,7 @@ if (!is_android) {
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h",
"//brave/components/brave_rewards/browser/test/rewards_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_contribution_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_database_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_flag_browsertest.cc",
Expand All @@ -753,12 +745,6 @@ if (!is_android) {
"//brave/components/brave_rewards/browser/test/rewards_state_browsertest.cc",
]

if (!is_asan) {
# Move this out of the !is_asan block once
# https://github.com/brave/brave-browser/issues/11900 is fixed
sources += [ "//brave/components/brave_rewards/browser/test/rewards_browsertest.cc" ]
}

deps += [
"//brave/components/brave_ads/browser",
"//brave/components/brave_ads/common",
Expand Down

0 comments on commit 26f349b

Please sign in to comment.