OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/display/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_layout_store.h" | 9 #include "ash/display/display_layout_store.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 void OnAttemptToReactivateWindow(aura::Window* request_active, | 123 void OnAttemptToReactivateWindow(aura::Window* request_active, |
124 aura::Window* actual_active) override {} | 124 aura::Window* actual_active) override {} |
125 | 125 |
126 int CountAndReset() { | 126 int CountAndReset() { |
127 EXPECT_EQ(changing_count_, changed_count_); | 127 EXPECT_EQ(changing_count_, changed_count_); |
128 changed_count_ = 0; | 128 changed_count_ = 0; |
129 return Resetter<int>(&changing_count_).value(); | 129 return Resetter<int>(&changing_count_).value(); |
130 } | 130 } |
131 | 131 |
132 int64 GetBoundsChangedCountAndReset() { | 132 int64_t GetBoundsChangedCountAndReset() { |
133 return Resetter<int>(&bounds_changed_count_).value(); | 133 return Resetter<int>(&bounds_changed_count_).value(); |
134 } | 134 } |
135 | 135 |
136 int64 GetRotationChangedCountAndReset() { | 136 int64_t GetRotationChangedCountAndReset() { |
137 return Resetter<int>(&rotation_changed_count_).value(); | 137 return Resetter<int>(&rotation_changed_count_).value(); |
138 } | 138 } |
139 | 139 |
140 int64 GetWorkareaChangedCountAndReset() { | 140 int64_t GetWorkareaChangedCountAndReset() { |
141 return Resetter<int>(&workarea_changed_count_).value(); | 141 return Resetter<int>(&workarea_changed_count_).value(); |
142 } | 142 } |
143 | 143 |
144 int64 GetPrimaryChangedCountAndReset() { | 144 int64_t GetPrimaryChangedCountAndReset() { |
145 return Resetter<int>(&primary_changed_count_).value(); | 145 return Resetter<int>(&primary_changed_count_).value(); |
146 } | 146 } |
147 | 147 |
148 int64 GetChangedDisplayIdAndReset() { | 148 int64_t GetChangedDisplayIdAndReset() { |
149 return Resetter<int64>(&changed_display_id_).value(); | 149 return Resetter<int64_t>(&changed_display_id_).value(); |
150 } | 150 } |
151 | 151 |
152 int GetFocusChangedCountAndReset() { | 152 int GetFocusChangedCountAndReset() { |
153 return Resetter<int>(&focus_changed_count_).value(); | 153 return Resetter<int>(&focus_changed_count_).value(); |
154 } | 154 } |
155 | 155 |
156 int GetActivationChangedCountAndReset() { | 156 int GetActivationChangedCountAndReset() { |
157 return Resetter<int>(&activation_changed_count_).value(); | 157 return Resetter<int>(&activation_changed_count_).value(); |
158 } | 158 } |
159 | 159 |
160 private: | 160 private: |
161 int changing_count_; | 161 int changing_count_; |
162 int changed_count_; | 162 int changed_count_; |
163 | 163 |
164 int bounds_changed_count_; | 164 int bounds_changed_count_; |
165 int rotation_changed_count_; | 165 int rotation_changed_count_; |
166 int workarea_changed_count_; | 166 int workarea_changed_count_; |
167 int primary_changed_count_; | 167 int primary_changed_count_; |
168 int64 changed_display_id_; | 168 int64_t changed_display_id_; |
169 | 169 |
170 int focus_changed_count_; | 170 int focus_changed_count_; |
171 int activation_changed_count_; | 171 int activation_changed_count_; |
172 | 172 |
173 DISALLOW_COPY_AND_ASSIGN(TestObserver); | 173 DISALLOW_COPY_AND_ASSIGN(TestObserver); |
174 }; | 174 }; |
175 | 175 |
176 gfx::Display GetPrimaryDisplay() { | 176 gfx::Display GetPrimaryDisplay() { |
177 return Shell::GetScreen()->GetDisplayNearestWindow( | 177 return Shell::GetScreen()->GetDisplayNearestWindow( |
178 Shell::GetAllRootWindows()[0]); | 178 Shell::GetAllRootWindows()[0]); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 float touch_radius_x_; | 342 float touch_radius_x_; |
343 float touch_radius_y_; | 343 float touch_radius_y_; |
344 float scroll_x_offset_; | 344 float scroll_x_offset_; |
345 float scroll_y_offset_; | 345 float scroll_y_offset_; |
346 float scroll_x_offset_ordinal_; | 346 float scroll_x_offset_ordinal_; |
347 float scroll_y_offset_ordinal_; | 347 float scroll_y_offset_ordinal_; |
348 | 348 |
349 DISALLOW_COPY_AND_ASSIGN(TestEventHandler); | 349 DISALLOW_COPY_AND_ASSIGN(TestEventHandler); |
350 }; | 350 }; |
351 | 351 |
352 float GetStoredUIScale(int64 id) { | 352 float GetStoredUIScale(int64_t id) { |
353 return Shell::GetInstance() | 353 return Shell::GetInstance() |
354 ->display_manager() | 354 ->display_manager() |
355 ->GetDisplayInfo(id) | 355 ->GetDisplayInfo(id) |
356 .GetEffectiveUIScale(); | 356 .GetEffectiveUIScale(); |
357 } | 357 } |
358 | 358 |
359 class TestMouseWatcherListener : public views::MouseWatcherListener { | 359 class TestMouseWatcherListener : public views::MouseWatcherListener { |
360 public: | 360 public: |
361 TestMouseWatcherListener() {} | 361 TestMouseWatcherListener() {} |
362 | 362 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 w1->Focus(); | 394 w1->Focus(); |
395 | 395 |
396 TestObserver observer; | 396 TestObserver observer; |
397 UpdateDisplay("500x500,400x400"); | 397 UpdateDisplay("500x500,400x400"); |
398 EXPECT_EQ(1, observer.CountAndReset()); // resize and add | 398 EXPECT_EQ(1, observer.CountAndReset()); // resize and add |
399 EXPECT_EQ(1, observer.GetBoundsChangedCountAndReset()); | 399 EXPECT_EQ(1, observer.GetBoundsChangedCountAndReset()); |
400 EXPECT_EQ(1, observer.GetWorkareaChangedCountAndReset()); | 400 EXPECT_EQ(1, observer.GetWorkareaChangedCountAndReset()); |
401 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 401 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
402 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 402 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
403 gfx::Insets insets(5, 5, 5, 5); | 403 gfx::Insets insets(5, 5, 5, 5); |
404 int64 secondary_display_id = ScreenUtil::GetSecondaryDisplay().id(); | 404 int64_t secondary_display_id = ScreenUtil::GetSecondaryDisplay().id(); |
405 Shell::GetInstance()->display_manager()->UpdateWorkAreaOfDisplay( | 405 Shell::GetInstance()->display_manager()->UpdateWorkAreaOfDisplay( |
406 secondary_display_id, insets); | 406 secondary_display_id, insets); |
407 | 407 |
408 // Default layout is RIGHT. | 408 // Default layout is RIGHT. |
409 EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString()); | 409 EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString()); |
410 EXPECT_EQ("500,0 400x400", GetSecondaryDisplay().bounds().ToString()); | 410 EXPECT_EQ("500,0 400x400", GetSecondaryDisplay().bounds().ToString()); |
411 EXPECT_EQ("505,5 390x390", GetSecondaryDisplay().work_area().ToString()); | 411 EXPECT_EQ("505,5 390x390", GetSecondaryDisplay().work_area().ToString()); |
412 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 412 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
413 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 413 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
414 | 414 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString()); | 523 EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString()); |
524 EXPECT_EQ("-300,500 400x400", GetSecondaryDisplay().bounds().ToString()); | 524 EXPECT_EQ("-300,500 400x400", GetSecondaryDisplay().bounds().ToString()); |
525 | 525 |
526 UpdateDisplay("500x500"); | 526 UpdateDisplay("500x500"); |
527 EXPECT_LE(1, observer.GetFocusChangedCountAndReset()); | 527 EXPECT_LE(1, observer.GetFocusChangedCountAndReset()); |
528 EXPECT_LE(1, observer.GetActivationChangedCountAndReset()); | 528 EXPECT_LE(1, observer.GetActivationChangedCountAndReset()); |
529 } | 529 } |
530 | 530 |
531 namespace { | 531 namespace { |
532 | 532 |
533 DisplayInfo CreateDisplayInfo(int64 id, | 533 DisplayInfo CreateDisplayInfo(int64_t id, |
534 int y, | 534 int y, |
535 gfx::Display::Rotation rotation) { | 535 gfx::Display::Rotation rotation) { |
536 DisplayInfo info(id, "", false); | 536 DisplayInfo info(id, "", false); |
537 info.SetBounds(gfx::Rect(0, y, 500, 500)); | 537 info.SetBounds(gfx::Rect(0, y, 500, 500)); |
538 info.SetRotation(rotation, gfx::Display::ROTATION_SOURCE_ACTIVE); | 538 info.SetRotation(rotation, gfx::Display::ROTATION_SOURCE_ACTIVE); |
539 return info; | 539 return info; |
540 } | 540 } |
541 | 541 |
542 DisplayInfo CreateMirroredDisplayInfo(int64 id, float device_scale_factor) { | 542 DisplayInfo CreateMirroredDisplayInfo(int64_t id, float device_scale_factor) { |
543 DisplayInfo info = CreateDisplayInfo(id, 0, gfx::Display::ROTATE_0); | 543 DisplayInfo info = CreateDisplayInfo(id, 0, gfx::Display::ROTATE_0); |
544 info.set_device_scale_factor(device_scale_factor); | 544 info.set_device_scale_factor(device_scale_factor); |
545 return info; | 545 return info; |
546 } | 546 } |
547 | 547 |
548 } // namespace | 548 } // namespace |
549 | 549 |
550 TEST_F(WindowTreeHostManagerTest, MirrorToDockedWithFullscreen) { | 550 TEST_F(WindowTreeHostManagerTest, MirrorToDockedWithFullscreen) { |
551 if (!SupportsMultipleDisplays()) | 551 if (!SupportsMultipleDisplays()) |
552 return; | 552 return; |
553 | 553 |
554 // Creates windows to catch activation change event. | 554 // Creates windows to catch activation change event. |
555 scoped_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1)); | 555 scoped_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1)); |
556 w1->Focus(); | 556 w1->Focus(); |
557 | 557 |
558 // Docked mode. | 558 // Docked mode. |
559 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 559 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
560 | 560 |
561 const DisplayInfo internal_display_info = CreateMirroredDisplayInfo(1, 2.0f); | 561 const DisplayInfo internal_display_info = CreateMirroredDisplayInfo(1, 2.0f); |
562 const DisplayInfo external_display_info = CreateMirroredDisplayInfo(2, 1.0f); | 562 const DisplayInfo external_display_info = CreateMirroredDisplayInfo(2, 1.0f); |
563 | 563 |
564 std::vector<DisplayInfo> display_info_list; | 564 std::vector<DisplayInfo> display_info_list; |
565 // Mirror. | 565 // Mirror. |
566 display_info_list.push_back(internal_display_info); | 566 display_info_list.push_back(internal_display_info); |
567 display_info_list.push_back(external_display_info); | 567 display_info_list.push_back(external_display_info); |
568 display_manager->OnNativeDisplaysChanged(display_info_list); | 568 display_manager->OnNativeDisplaysChanged(display_info_list); |
569 const int64 internal_display_id = | 569 const int64_t internal_display_id = |
570 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); | 570 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); |
571 EXPECT_EQ(1, internal_display_id); | 571 EXPECT_EQ(1, internal_display_id); |
572 EXPECT_EQ(2U, display_manager->num_connected_displays()); | 572 EXPECT_EQ(2U, display_manager->num_connected_displays()); |
573 EXPECT_EQ(1U, display_manager->GetNumDisplays()); | 573 EXPECT_EQ(1U, display_manager->GetNumDisplays()); |
574 | 574 |
575 wm::WindowState* window_state = wm::GetWindowState(w1.get()); | 575 wm::WindowState* window_state = wm::GetWindowState(w1.get()); |
576 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); | 576 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
577 window_state->OnWMEvent(&toggle_fullscreen_event); | 577 window_state->OnWMEvent(&toggle_fullscreen_event); |
578 EXPECT_TRUE(window_state->IsFullscreen()); | 578 EXPECT_TRUE(window_state->IsFullscreen()); |
579 EXPECT_EQ("0,0 250x250", w1->bounds().ToString()); | 579 EXPECT_EQ("0,0 250x250", w1->bounds().ToString()); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 | 652 |
653 // No change | 653 // No change |
654 UpdateDisplay("400x500*2,300x300"); | 654 UpdateDisplay("400x500*2,300x300"); |
655 // We still call into Pre/PostDisplayConfigurationChange(). | 655 // We still call into Pre/PostDisplayConfigurationChange(). |
656 EXPECT_EQ(1, observer.CountAndReset()); | 656 EXPECT_EQ(1, observer.CountAndReset()); |
657 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 657 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
658 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 658 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
659 | 659 |
660 // Rotation | 660 // Rotation |
661 observer.GetRotationChangedCountAndReset(); // we only want to reset. | 661 observer.GetRotationChangedCountAndReset(); // we only want to reset. |
662 int64 primary_id = GetPrimaryDisplay().id(); | 662 int64_t primary_id = GetPrimaryDisplay().id(); |
663 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90, | 663 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90, |
664 gfx::Display::ROTATION_SOURCE_ACTIVE); | 664 gfx::Display::ROTATION_SOURCE_ACTIVE); |
665 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); | 665 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); |
666 EXPECT_EQ(1, observer.CountAndReset()); | 666 EXPECT_EQ(1, observer.CountAndReset()); |
667 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 667 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
668 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 668 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
669 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90, | 669 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90, |
670 gfx::Display::ROTATION_SOURCE_ACTIVE); | 670 gfx::Display::ROTATION_SOURCE_ACTIVE); |
671 EXPECT_EQ(0, observer.GetRotationChangedCountAndReset()); | 671 EXPECT_EQ(0, observer.GetRotationChangedCountAndReset()); |
672 EXPECT_EQ(0, observer.CountAndReset()); | 672 EXPECT_EQ(0, observer.CountAndReset()); |
673 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 673 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
674 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 674 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
675 | 675 |
676 // UI scale is eanbled only on internal display. | 676 // UI scale is eanbled only on internal display. |
677 int64 secondary_id = GetSecondaryDisplay().id(); | 677 int64_t secondary_id = GetSecondaryDisplay().id(); |
678 test::ScopedSetInternalDisplayId set_internal(secondary_id); | 678 test::ScopedSetInternalDisplayId set_internal(secondary_id); |
679 // Changing internal ID display changes the DisplayIdPair (it comes | 679 // Changing internal ID display changes the DisplayIdPair (it comes |
680 // first), which also changes the primary display candidate. Update | 680 // first), which also changes the primary display candidate. Update |
681 // the primary display manually to update the primary display to | 681 // the primary display manually to update the primary display to |
682 // avoid getting the OnDisplayConfigurationChanged() call twice in | 682 // avoid getting the OnDisplayConfigurationChanged() call twice in |
683 // SetDisplayUIScale. Note that this scenario will never happen on | 683 // SetDisplayUIScale. Note that this scenario will never happen on |
684 // real devices. | 684 // real devices. |
685 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( | 685 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( |
686 secondary_id); | 686 secondary_id); |
687 EXPECT_EQ(1, observer.CountAndReset()); | 687 EXPECT_EQ(1, observer.CountAndReset()); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 TEST_F(WindowTreeHostManagerTest, Rotate) { | 1014 TEST_F(WindowTreeHostManagerTest, Rotate) { |
1015 if (!SupportsMultipleDisplays()) | 1015 if (!SupportsMultipleDisplays()) |
1016 return; | 1016 return; |
1017 | 1017 |
1018 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 1018 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
1019 TestEventHandler event_handler; | 1019 TestEventHandler event_handler; |
1020 Shell::GetInstance()->AddPreTargetHandler(&event_handler); | 1020 Shell::GetInstance()->AddPreTargetHandler(&event_handler); |
1021 | 1021 |
1022 UpdateDisplay("120x200,300x400*2"); | 1022 UpdateDisplay("120x200,300x400*2"); |
1023 gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); | 1023 gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); |
1024 int64 display2_id = ScreenUtil::GetSecondaryDisplay().id(); | 1024 int64_t display2_id = ScreenUtil::GetSecondaryDisplay().id(); |
1025 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1025 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
1026 ui::test::EventGenerator generator1(root_windows[0]); | 1026 ui::test::EventGenerator generator1(root_windows[0]); |
1027 | 1027 |
1028 TestObserver observer; | 1028 TestObserver observer; |
1029 EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString()); | 1029 EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString()); |
1030 EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); | 1030 EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); |
1031 EXPECT_EQ("120,0 150x200", | 1031 EXPECT_EQ("120,0 150x200", |
1032 ScreenUtil::GetSecondaryDisplay().bounds().ToString()); | 1032 ScreenUtil::GetSecondaryDisplay().bounds().ToString()); |
1033 generator1.MoveMouseToInHost(50, 40); | 1033 generator1.MoveMouseToInHost(50, 40); |
1034 EXPECT_EQ("50,40", event_handler.GetLocationAndReset()); | 1034 EXPECT_EQ("50,40", event_handler.GetLocationAndReset()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 } | 1215 } |
1216 | 1216 |
1217 // Make sure that the compositor based mirroring can switch | 1217 // Make sure that the compositor based mirroring can switch |
1218 // from/to dock mode. | 1218 // from/to dock mode. |
1219 TEST_F(WindowTreeHostManagerTest, DockToSingle) { | 1219 TEST_F(WindowTreeHostManagerTest, DockToSingle) { |
1220 if (!SupportsMultipleDisplays()) | 1220 if (!SupportsMultipleDisplays()) |
1221 return; | 1221 return; |
1222 | 1222 |
1223 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 1223 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
1224 | 1224 |
1225 const int64 internal_id = 1; | 1225 const int64_t internal_id = 1; |
1226 | 1226 |
1227 const DisplayInfo internal_display_info = | 1227 const DisplayInfo internal_display_info = |
1228 CreateDisplayInfo(internal_id, 0, gfx::Display::ROTATE_0); | 1228 CreateDisplayInfo(internal_id, 0, gfx::Display::ROTATE_0); |
1229 const DisplayInfo external_display_info = | 1229 const DisplayInfo external_display_info = |
1230 CreateDisplayInfo(2, 1, gfx::Display::ROTATE_90); | 1230 CreateDisplayInfo(2, 1, gfx::Display::ROTATE_90); |
1231 | 1231 |
1232 std::vector<DisplayInfo> display_info_list; | 1232 std::vector<DisplayInfo> display_info_list; |
1233 // Extended | 1233 // Extended |
1234 display_info_list.push_back(internal_display_info); | 1234 display_info_list.push_back(internal_display_info); |
1235 display_info_list.push_back(external_display_info); | 1235 display_info_list.push_back(external_display_info); |
1236 display_manager->OnNativeDisplaysChanged(display_info_list); | 1236 display_manager->OnNativeDisplaysChanged(display_info_list); |
1237 const int64 internal_display_id = | 1237 const int64_t internal_display_id = |
1238 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); | 1238 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); |
1239 EXPECT_EQ(internal_id, internal_display_id); | 1239 EXPECT_EQ(internal_id, internal_display_id); |
1240 EXPECT_EQ(2U, display_manager->GetNumDisplays()); | 1240 EXPECT_EQ(2U, display_manager->GetNumDisplays()); |
1241 | 1241 |
1242 // Dock mode. | 1242 // Dock mode. |
1243 display_info_list.clear(); | 1243 display_info_list.clear(); |
1244 display_info_list.push_back(external_display_info); | 1244 display_info_list.push_back(external_display_info); |
1245 display_manager->OnNativeDisplaysChanged(display_info_list); | 1245 display_manager->OnNativeDisplaysChanged(display_info_list); |
1246 EXPECT_EQ(1U, display_manager->GetNumDisplays()); | 1246 EXPECT_EQ(1U, display_manager->GetNumDisplays()); |
1247 EXPECT_FALSE(Shell::GetPrimaryRootWindow() | 1247 EXPECT_FALSE(Shell::GetPrimaryRootWindow() |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 const DisplayInfo second_display_info = | 1336 const DisplayInfo second_display_info = |
1337 CreateDisplayInfo(11, 500, gfx::Display::ROTATE_0); | 1337 CreateDisplayInfo(11, 500, gfx::Display::ROTATE_0); |
1338 | 1338 |
1339 std::vector<DisplayInfo> display_info_list; | 1339 std::vector<DisplayInfo> display_info_list; |
1340 // Extended | 1340 // Extended |
1341 display_info_list.push_back(first_display_info); | 1341 display_info_list.push_back(first_display_info); |
1342 display_info_list.push_back(second_display_info); | 1342 display_info_list.push_back(second_display_info); |
1343 display_manager->OnNativeDisplaysChanged(display_info_list); | 1343 display_manager->OnNativeDisplaysChanged(display_info_list); |
1344 aura::Window* primary_root = Shell::GetAllRootWindows()[0]; | 1344 aura::Window* primary_root = Shell::GetAllRootWindows()[0]; |
1345 | 1345 |
1346 int64 new_display_id = 20; | 1346 int64_t new_display_id = 20; |
1347 RootWindowTestObserver test_observer; | 1347 RootWindowTestObserver test_observer; |
1348 primary_root->AddObserver(&test_observer); | 1348 primary_root->AddObserver(&test_observer); |
1349 | 1349 |
1350 display_info_list.clear(); | 1350 display_info_list.clear(); |
1351 const DisplayInfo new_first_display_info = | 1351 const DisplayInfo new_first_display_info = |
1352 CreateDisplayInfo(new_display_id, 0, gfx::Display::ROTATE_0); | 1352 CreateDisplayInfo(new_display_id, 0, gfx::Display::ROTATE_0); |
1353 | 1353 |
1354 display_info_list.push_back(new_first_display_info); | 1354 display_info_list.push_back(new_first_display_info); |
1355 display_manager->OnNativeDisplaysChanged(display_info_list); | 1355 display_manager->OnNativeDisplaysChanged(display_info_list); |
1356 EXPECT_EQ("0,0 500x500", test_observer.shelf_display_bounds().ToString()); | 1356 EXPECT_EQ("0,0 500x500", test_observer.shelf_display_bounds().ToString()); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 widget->GetNativeWindow()->GetRootWindow()); | 1532 widget->GetNativeWindow()->GetRootWindow()); |
1533 event_generator.MoveMouseToCenterOf(widget->GetNativeWindow()); | 1533 event_generator.MoveMouseToCenterOf(widget->GetNativeWindow()); |
1534 | 1534 |
1535 UpdateDisplay("300x300"); | 1535 UpdateDisplay("300x300"); |
1536 watcher.Stop(); | 1536 watcher.Stop(); |
1537 | 1537 |
1538 widget->CloseNow(); | 1538 widget->CloseNow(); |
1539 } | 1539 } |
1540 | 1540 |
1541 } // namespace ash | 1541 } // namespace ash |
OLD | NEW |