#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/test/base/save_desktop_snapshot.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/i18n/time_formatting.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "content/public/browser/desktop_capture.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "ui/gfx/codec/png_codec.h"
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/crosapi/mojom/screen_manager.mojom.h"
#include "chromeos/lacros/lacros_service.h"
#endif
namespace {
class FrameHolder : public webrtc::DesktopCapturer::Callback { … };
SkBitmap CaptureScreen() { … }
}
const char kSnapshotOutputDir[] = …;
base::FilePath SaveDesktopSnapshot() { … }
base::FilePath SaveDesktopSnapshot(const base::FilePath& output_dir) { … }