#include "chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.h"
#include "base/run_loop.h"
#include "chrome/browser/ui/global_media_controls/media_notification_service.h"
#include "chrome/browser/ui/global_media_controls/media_notification_service_factory.h"
#include "chrome/browser/ui/global_media_controls/media_toolbar_button_observer.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/global_media_controls/media_dialog_view.h"
#include "chrome/browser/ui/views/global_media_controls/media_dialog_view_observer.h"
#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "components/global_media_controls/public/media_item_manager.h"
#include "components/global_media_controls/public/media_item_manager_observer.h"
#include "components/global_media_controls/public/views/media_item_ui_updated_view.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/test/ui_controls.h"
namespace {
MediaSessionAction;
class MediaToolbarButtonWatcher
: public MediaToolbarButtonObserver,
public MediaDialogViewObserver,
public global_media_controls::MediaItemManagerObserver { … };
}
MediaDialogUiForTest::MediaDialogUiForTest(
base::RepeatingCallback<Browser*()> callback)
: … { … }
MediaDialogUiForTest::~MediaDialogUiForTest() = default;
MediaToolbarButtonView* MediaDialogUiForTest::GetToolbarIcon() { … }
void MediaDialogUiForTest::LayoutBrowserIfNecessary() { … }
void MediaDialogUiForTest::ClickToolbarIcon() { … }
bool MediaDialogUiForTest::IsToolbarIconVisible() { … }
bool MediaDialogUiForTest::WaitForToolbarIconShown() { … }
bool MediaDialogUiForTest::WaitForToolbarIconHidden() { … }
bool MediaDialogUiForTest::WaitForDialogOpened() { … }
bool MediaDialogUiForTest::IsDialogVisible() { … }
void MediaDialogUiForTest::WaitForDialogToContainText(
const std::u16string& text) { … }
void MediaDialogUiForTest::WaitForItemCount(int count) { … }
void MediaDialogUiForTest::WaitForPictureInPictureButtonVisibility(
bool visible) { … }
global_media_controls::MediaItemManager* MediaDialogUiForTest::GetItemManager()
const { … }