chromium/chrome/test/base/chromeos/test_ash_chrome_browser_main_extra_parts.h

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

#ifndef CHROME_TEST_BASE_CHROMEOS_TEST_ASH_CHROME_BROWSER_MAIN_EXTRA_PARTS_H_
#define CHROME_TEST_BASE_CHROMEOS_TEST_ASH_CHROME_BROWSER_MAIN_EXTRA_PARTS_H_

#include <memory>

#include "base/auto_reset.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"

namespace test {

class TestAshChromeBrowserMainExtraParts
    : public ChromeBrowserMainExtraParts {
 public:
  TestAshChromeBrowserMainExtraParts();
  TestAshChromeBrowserMainExtraParts(
      const TestAshChromeBrowserMainExtraParts&) = delete;
  TestAshChromeBrowserMainExtraParts& operator=(
      const TestAshChromeBrowserMainExtraParts&) = delete;
  ~TestAshChromeBrowserMainExtraParts() override;

  void PreProfileInit() override;
  void PreBrowserStart() override;
  void PostBrowserStart() override;
  void PostMainMessageLoopRun() override;

 private:
  // Signin errors create a notification. That can interfere with tests.
  std::unique_ptr<base::AutoReset<bool>> ignore_signin_errors_;
  // Multi-device notifications are created on first login.
  std::unique_ptr<base::AutoReset<bool>> ignore_multi_device_notifications_;
};

}  // namespace test

#endif  // CHROME_TEST_BASE_CHROMEOS_TEST_ASH_CHROME_BROWSER_MAIN_EXTRA_PARTS_H_