Skip to content

Commit

Permalink
[M118] Remove CHECK_IS_TEST that's causing production issues
Browse files Browse the repository at this point in the history
The `CHECK_IS_TEST` in `TemplateURLService::ApplyDefaultSearchChange` is
crashing in production. This was previously a `DCHECK` and was replaced
by a `CHECK_IS_TEST` for testing purposes.

This will not cause issues because the pointer is never dereferenced.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1483111#c7 for further reasoning.

(cherry picked from commit 39daf18)

Fixed: 1483111, 1491858
Change-Id: Ia36ec84f3d2e85c806c6a83c6b3e5df54a747e51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4897116
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Commit-Queue: Jack Yammine <jyammine@google.com>
Reviewed-by: Jens Mueller <muellerj@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1202391}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4939024
Commit-Queue: Daniel Yip <danielyip@google.com>
Auto-Submit: Daniel Yip <danielyip@google.com>
Owners-Override: Daniel Yip <danielyip@google.com>
Reviewed-by: Jack Yammine <jyammine@google.com>
Cr-Commit-Position: refs/branch-heads/5993@{#1296}
Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
  • Loading branch information
Jack Yammine authored and Chromium LUCI CQ committed Oct 16, 2023
1 parent b4c9c9b commit 55e273d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions components/search_engines/template_url_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1980,10 +1980,6 @@ bool TemplateURLService::ApplyDefaultSearchChangeNoMetrics(
default_search_provider_ = nullptr;
} else if (source == DefaultSearchManager::FROM_EXTENSION) {
default_search_provider_ = FindMatchingDefaultExtensionTemplateURL(*data);
// Can be nullptr in tests.
if (!default_search_provider_) {
CHECK_IS_TEST();
}
} else if (source == DefaultSearchManager::FROM_FALLBACK) {
default_search_provider_ =
FindPrepopulatedTemplateURL(data->prepopulate_id);
Expand Down

0 comments on commit 55e273d

Please sign in to comment.