#include <memory>
#include <string>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback_helpers.h"
#include "base/json/values_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/hats/hats_service_desktop.h"
#include "chrome/browser/ui/hats/hats_service_factory.h"
#include "chrome/browser/ui/hats/mock_hats_service.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/hats/hats_next_web_dialog.h"
#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/scoped_browser_locale.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/version_info/version_info.h"
#include "content/public/test/browser_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/page/page_zoom.h"
#include "ui/views/test/views_test_utils.h"
#include "url/gurl.h"
namespace {
const SurveyBitsData kHatsNextTestSurveyProductSpecificBitsData{ … };
const SurveyStringData kHatsNextTestSurveyProductSpecificStringData{ … };
const char kTestLocale[] = …;
const char kTestHistogramName[] = …;
}
class MockHatsNextWebDialog : public HatsNextWebDialog { … };
class HatsNextWebDialogBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, SurveyLoaded) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyLoadedWithHistogramName) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, SurveyClosed) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, SurveyLoadedThenClosed) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, SurveyTimeout) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, UnknownURLFragment) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, NewWebContents) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
NewWebContentsForDevtoolsBrowser) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, DialogResize) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, MaximumSize) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, ZoomLevel) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, SurveyCompleted) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyQuestionAnsweredInvalidQuestion) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyQuestionAnsweredFirstQuestion) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyQuestionAnsweredSingleSelectQuestion) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyQuestionAnsweredMultipleSelectQuestion) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest,
SurveyQuestionAnsweredMultipleQuestions) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, NoHistogramName) { … }
IN_PROC_BROWSER_TEST_F(HatsNextWebDialogBrowserTest, ExcludedHistogram) { … }