ambient_container_view_unittest.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/ambient/ui/ambient_container_view.h"
  5. #include "ash/ambient/ambient_controller.h"
  6. #include "ash/ambient/test/ambient_ash_test_base.h"
  7. #include "ui/aura/window.h"
  8. #include "ui/display/display.h"
  9. #include "ui/display/screen.h"
  10. #include "ui/views/widget/widget.h"
  11. namespace ash {
  12. using AmbientContainerViewTest = AmbientAshTestBase;
  13. // Tests that AmbientContainerView window should be fullscreen.
  14. TEST_F(AmbientContainerViewTest, WindowFullscreenSize) {
  15. ShowAmbientScreen();
  16. for (const auto* container : GetContainerViews()) {
  17. const views::Widget* widget = container->GetWidget();
  18. gfx::Rect root_window_bounds =
  19. display::Screen::GetScreen()
  20. ->GetDisplayNearestWindow(
  21. widget->GetNativeWindow()->GetRootWindow())
  22. .bounds();
  23. gfx::Rect container_window_bounds =
  24. widget->GetNativeWindow()->GetBoundsInScreen();
  25. EXPECT_EQ(root_window_bounds, container_window_bounds);
  26. }
  27. // Clean up.
  28. CloseAmbientScreen();
  29. }
  30. } // namespace ash