OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/root_window_transformers.h" | 5 #include "ash/display/root_window_transformers.h" |
6 | 6 |
7 #include "ash/display/display_info.h" | 7 #include "ash/display/display_info.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/host/root_window_transformer.h" | 9 #include "ash/host/root_window_transformer.h" |
10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale()); | 386 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale()); |
387 | 387 |
388 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 388 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
389 } | 389 } |
390 | 390 |
391 TEST_F(RootWindowTransformersTest, LetterBoxPillarBox) { | 391 TEST_F(RootWindowTransformersTest, LetterBoxPillarBox) { |
392 if (!SupportsMultipleDisplays()) | 392 if (!SupportsMultipleDisplays()) |
393 return; | 393 return; |
394 test::MirrorWindowTestApi test_api; | 394 test::MirrorWindowTestApi test_api; |
395 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 395 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
396 display_manager->SetSecondDisplayMode(DisplayManager::MIRRORING); | 396 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING); |
397 UpdateDisplay("400x200,500x500"); | 397 UpdateDisplay("400x200,500x500"); |
398 scoped_ptr<RootWindowTransformer> transformer( | 398 scoped_ptr<RootWindowTransformer> transformer( |
399 test_api.CreateCurrentRootWindowTransformer()); | 399 test_api.CreateCurrentRootWindowTransformer()); |
400 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. | 400 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. |
401 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); | 401 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); |
402 | 402 |
403 UpdateDisplay("200x400,500x500"); | 403 UpdateDisplay("200x400,500x500"); |
404 // The aspect ratio is flipped, so X margin is now 125. | 404 // The aspect ratio is flipped, so X margin is now 125. |
405 transformer = test_api.CreateCurrentRootWindowTransformer(); | 405 transformer = test_api.CreateCurrentRootWindowTransformer(); |
406 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); | 406 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); |
407 } | 407 } |
408 | 408 |
409 } // namespace ash | 409 } // namespace ash |
OLD | NEW |