#include <memory>
#include <string>
#include <vector>
#include "base/functional/callback_forward.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_dialog_service.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search_engine_choice/search_engine_choice_tab_helper.h"
#include "chrome/browser/ui/test/pixel_test_configuration_mixin.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/mixin_based_in_process_browser_test.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/search_engines/prepopulated_engines.h"
#include "components/search_engines/search_engines_switches.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_service.h"
#include "components/signin/public/base/signin_switches.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/widget/any_widget_observer.h"
namespace {
constexpr int kMaximumHeight = …;
class MockSearchEngineChoiceDialogService
: public SearchEngineChoiceDialogService { … };
struct TestParam { … };
std::string ParamToTestSuffix(const ::testing::TestParamInfo<TestParam>& info) { … }
const TestParam kTestParams[] = …;
class SearchEngineChoiceNavigationObserver
: public content::TestNavigationObserver { … };
const char kSelectFirstSearchEngineJsString[] = …;
const char kMakeFirstSnippetLargerJsString[] = …;
const char kDisplayInfoDialogJsString[] = …;
const char kRemoveHoverPropertyJsString[] = …;
const char kAreBannersDisplayedJsString[] = …;
void WaitForBannersDisplayed(content::WebContents* web_contents,
base::OnceClosure quit_closure) { … }
}
class SearchEngineChoiceUIPixelTest
: public TestBrowserDialog,
public MixinBasedInProcessBrowserTest,
public testing::WithParamInterface<TestParam> { … };
IN_PROC_BROWSER_TEST_P(SearchEngineChoiceUIPixelTest, InvokeUi_default) { … }
INSTANTIATE_TEST_SUITE_P(…);