blob: 38a6531e1b61f46e5cfa22494f94e3280dbe9858 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/chooser_controller/chooser_controller.h"
// A subclass of ChooserController that pretends to be a USB device chooser for
// testing. The result should be visually similar to the real version of the
// dialog for interactive tests.
class FakeUsbChooserController : public ChooserController {
explicit FakeUsbChooserController(int device_count);
// ChooserController:
base::string16 GetNoOptionsText() const override;
base::string16 GetOkButtonLabel() const override;
size_t NumOptions() const override;
base::string16 GetOption(size_t index) const override;
void Select(const std::vector<size_t>& indices) override {}
void Cancel() override {}
void Close() override {}
void OpenHelpCenterUrl() const override {}
void set_device_count(size_t device_count) { device_count_ = device_count; }
// The number of fake devices to include in the chooser. Names are generated
// for them.
size_t device_count_ = 0;