chromium/chrome/browser/safe_browsing/client_side_detection_service_browsertest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/safe_browsing/content/browser/client_side_detection_service.h"

#include <optional>

#include "base/path_service.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/chrome_client_side_detection_service_delegate.h"
#include "chrome/browser/safe_browsing/client_side_detection_service_factory.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/client_side_phishing_model.h"
#include "components/safe_browsing/content/common/safe_browsing.mojom.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/client_model.pb.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "ipc/ipc_channel_proxy.h"
#include "mojo/public/cpp/base/proto_wrapper.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"

#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#else
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#endif  // defined (

#if BUILDFLAG(IS_MAC)
#include "base/mac/mac_util.h"
#endif

namespace safe_browsing {

namespace {

// Helper class used to wait until a phishing model has been set.
class PhishingModelWaiter : public mojom::PhishingModelSetterTestObserver {};

}  // namespace

_;
ReturnRef;
StrictMock;

class ClientSideDetectionServiceBrowserTest : public PlatformBrowserTest {};

// TODO(crbug.com/40904444): Re-enable this test
#if BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)
#define MAYBE_ModelUpdatesPropagated
#else
#define MAYBE_ModelUpdatesPropagated
#endif
IN_PROC_BROWSER_TEST_F(ClientSideDetectionServiceBrowserTest,
                       MAYBE_ModelUpdatesPropagated) {}

// TODO(crbug.com/40904444): Re-enable this test
#if BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)
#define MAYBE_TfLiteClassification
#else
#define MAYBE_TfLiteClassification
#endif
IN_PROC_BROWSER_TEST_F(ClientSideDetectionServiceBrowserTest,
                       MAYBE_TfLiteClassification) {}

// TODO(crbug.com/40904444): Re-enable this test
#if BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)
#define MAYBE_TfLiteClassificationAfterTwoModelUploads
#else
#define MAYBE_TfLiteClassificationAfterTwoModelUploads
#endif
IN_PROC_BROWSER_TEST_F(ClientSideDetectionServiceBrowserTest,
                       MAYBE_TfLiteClassificationAfterTwoModelUploads) {}

}  // namespace safe_browsing