chromium/components/autofill/content/browser/risk/fingerprint_browsertest.cc

// Copyright 2014 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/autofill/content/browser/risk/fingerprint.h"

#include <stdint.h>

#include <memory>

#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/autofill/content/browser/risk/proto/fingerprint.pb.h"
#include "components/autofill/content/common/content_autofill_features.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/test_utils.h"
#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"
#include "services/device/public/mojom/geoposition.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/screen_info.h"
#include "ui/gfx/geometry/rect.h"

ElementsAre;

namespace autofill {
namespace risk {

namespace internal {

// Defined in the implementation file corresponding to this test.
void GetFingerprintInternal(
    uint64_t obfuscated_gaia_id,
    const gfx::Rect& window_bounds,
    const gfx::Rect& content_bounds,
    const display::ScreenInfo& screen_info,
    const std::string& version,
    const std::string& charset,
    const std::string& accept_languages,
    base::Time install_time,
    const std::string& app_locale,
    const std::string& user_agent,
    base::TimeDelta timeout,
    base::OnceCallback<void(std::unique_ptr<Fingerprint>)> callback);

}  // namespace internal

// Constants that are passed verbatim to the fingerprinter code and should be
// serialized into the resulting protocol buffer.
const uint64_t kObfuscatedGaiaId =16571487432910023183);
const char kCharset[] =;
const char kAcceptLanguages[] =;
const int kScreenColorDepth =;
const char kLocale[] =;
const char kUserAgent[] =;

// Geolocation constants that are passed verbatim to the fingerprinter code and
// should be serialized into the resulting protocol buffer.
const double kLatitude =;
const double kLongitude =;
const double kAltitude =;
const double kAccuracy =;
const int kGeolocationTime =;

class AutofillRiskFingerprintTest : public content::ContentBrowserTest,
                                    public ::testing::WithParamInterface<bool> {};

// Test that getting a fingerprint works on some basic level.
IN_PROC_BROWSER_TEST_P(AutofillRiskFingerprintTest, GetFingerprint) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace risk
}  // namespace autofill