chromium/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc

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

#include "chrome/browser/ui/passwords/settings/password_manager_porter.h"

#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/mock_callback.h"
#include "build/build_config.h"
#include "chrome/browser/password_manager/profile_password_store_factory.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/affiliations/core/browser/fake_affiliation_service.h"
#include "components/password_manager/core/browser/export/password_manager_exporter.h"
#include "components/password_manager/core/browser/import/csv_password_sequence.h"
#include "components/password_manager/core/browser/import/import_results.h"
#include "components/password_manager/core/browser/password_manager_test_utils.h"
#include "components/password_manager/core/browser/password_store/test_password_store.h"
#include "components/password_manager/core/browser/ui/credential_provider_interface.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/web_contents_tester.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/shell_dialogs/select_file_dialog_factory.h"
#include "ui/shell_dialogs/selected_file_info.h"
#include "url/gurl.h"

_;
IsEmpty;
SizeIs;
StrictMock;
UnorderedPointwise;

namespace {

class TestSelectFileDialog : public ui::SelectFileDialog {};

class TestSelectFileDialogFactory : public ui::SelectFileDialogFactory {};

// A fake ui::SelectFileDialog, which will cancel the file selection instead of
// selecting a file.
class FakeCancellingSelectFileDialog : public ui::SelectFileDialog {};

class FakeCancellingSelectFileDialogFactory
    : public ui::SelectFileDialogFactory {};

class MockPasswordManagerExporter
    : public password_manager::PasswordManagerExporter {};

class FakePasswordParserService
    : public password_manager::mojom::CSVPasswordParser {};

class PasswordManagerPorterTest : public ChromeRenderViewHostTestHarness {};

// Password importing and exporting using a |SelectFileDialog| is not yet
// supported on Android.
#if !BUILDFLAG(IS_ANDROID)

TEST_F(PasswordManagerPorterTest, PasswordExport) {}

TEST_F(PasswordManagerPorterTest, CancelExportFileSelection) {}

TEST_F(PasswordManagerPorterTest, CancelExport) {}

TEST_F(PasswordManagerPorterTest, ImportDismissedOnCanceledFileSelection) {}

TEST_F(PasswordManagerPorterTest, ContinueImportWithConflicts) {}

TEST_F(PasswordManagerPorterTest, RejectNewImportsWhenConflictsNotResolved) {}

TEST_F(PasswordManagerPorterTest, ResetImporterTriggersFileDeletion) {}

struct FormDescription {};

struct TestCase {};

class PasswordManagerPorterImportTest
    : public testing::WithParamInterface<TestCase>,
      public PasswordManagerPorterTest {};

MATCHER(FormHasDescription, "") {}

TEST_P(PasswordManagerPorterImportTest, Import) {}

INSTANTIATE_TEST_SUITE_P();

#endif

}  // namespace