Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc

Issue 1116313002: Layout login/lock screen, shelf and app list inside the first display in Unified Desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/web_notification/ash_popup_alignment_delegate.cc ('k') | ash/wm/app_list_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
diff --git a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
index 8024c294d3ccaa46061f3258de6a8b5d535b8196..5fcd7ca7f0599686f7e254d06213dda8ebcff07b 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
@@ -12,6 +12,7 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
+#include "ash/test/display_manager_test_api.h"
#include "ui/gfx/screen.h"
#include "ui/message_center/message_center_style.h"
@@ -24,9 +25,7 @@ class AshPopupAlignmentDelegateTest : public test::AshTestBase {
void SetUp() override {
test::AshTestBase::SetUp();
- alignment_delegate_.reset(new AshPopupAlignmentDelegate());
- alignment_delegate_->StartObserving(
- Shell::GetScreen(), Shell::GetScreen()->GetPrimaryDisplay());
+ SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate()));
}
void TearDown() override {
@@ -47,6 +46,18 @@ class AshPopupAlignmentDelegateTest : public test::AshTestBase {
return alignment_delegate_.get();
}
+ void SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate> delegate) {
+ if (!delegate.get()) {
+ alignment_delegate_.reset();
+ return;
+ }
+ alignment_delegate_ = delegate.Pass();
+ alignment_delegate_->StartObserving(
+ Shell::GetScreen(), Shell::GetScreen()->GetPrimaryDisplay());
+ // Update the layout
+ alignment_delegate_->OnDisplayWorkAreaInsetsChanged();
+ }
+
Position GetPositionInDisplay(const gfx::Point& point) {
const gfx::Rect& work_area =
Shell::GetScreen()->GetPrimaryDisplay().work_area();
@@ -218,4 +229,23 @@ TEST_F(AshPopupAlignmentDelegateTest, TrayHeight) {
alignment_delegate()->GetBaseLine());
}
+TEST_F(AshPopupAlignmentDelegateTest, Unified) {
+ if (!SupportsMultipleDisplays())
+ return;
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ test::DisplayManagerTestApi test_api(display_manager);
+ test_api.SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
+ display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED);
+
+ // Reset the delegate as the primary display's shelf will be destroyed during
+ // transition.
+ SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate>());
+
+ UpdateDisplay("600x600,800x800");
+ SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate()));
+
+ EXPECT_GT(600,
+ alignment_delegate()->GetToastOriginX(gfx::Rect(0, 0, 10, 10)));
+}
+
} // namespace ash
« no previous file with comments | « ash/system/web_notification/ash_popup_alignment_delegate.cc ('k') | ash/wm/app_list_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698