#include "ash/public/cpp/test/test_cast_config_controller.h"
#include "ash/system/tray/tray_detailed_view.h"
#include "ash/system/unified/quick_settings_view.h"
#include "ash/system/unified/unified_system_tray.h"
#include "ash/system/unified/unified_system_tray_bubble.h"
#include "ash/system/unified/unified_system_tray_controller.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/pixel/ash_pixel_differ.h"
#include "ash/test/pixel/ash_pixel_test_helper.h"
#include "ash/test/pixel/ash_pixel_test_init_params.h"
namespace ash {
class CastZeroStateViewPixelTest
: public AshTestBase,
public testing::WithParamInterface</*enable_system_blur=*/bool> {
public:
std::optional<pixel_test::InitParams> CreatePixelTestInitParams()
const override {
pixel_test::InitParams init_params;
init_params.system_blur_enabled = GetParam();
return init_params;
}
TestCastConfigController cast_config_;
};
INSTANTIATE_TEST_SUITE_P(
,
CastZeroStateViewPixelTest,
testing::Bool());
TEST_P(CastZeroStateViewPixelTest, Basics) {
UnifiedSystemTray* system_tray = GetPrimaryUnifiedSystemTray();
system_tray->ShowBubble();
ASSERT_TRUE(system_tray->bubble());
system_tray->bubble()
->unified_system_tray_controller()
->ShowCastDetailedView();
TrayDetailedView* detailed_view =
system_tray->bubble()
->quick_settings_view()
->GetDetailedViewForTest<TrayDetailedView>();
ASSERT_TRUE(detailed_view);
EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen(
GenerateScreenshotName("cast_zero_state_view"),
pixel_test_helper()->IsSystemBlurEnabled() ? 14 : 0,
detailed_view));
}
}