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

Side by Side Diff: ash/display/root_window_transformers_unittest.cc

Issue 1107733006: Unified Desktop: hook up ash to allow unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AshWindowTreeHostUnified 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 unified diff | Download patch
« no previous file with comments | « ash/display/root_window_transformers.cc ('k') | ash/display/screen_ash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/display/root_window_transformers.cc ('k') | ash/display/screen_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698