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

Side by Side Diff: ui/display/chromeos/update_display_configuration_task_unittest.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ui/compositor/test/in_process_context_factory.cc ('k') | ui/events/event.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/display/chromeos/update_display_configuration_task.h" 5 #include "ui/display/chromeos/update_display_configuration_task.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 JoinActions(kGrab, GetFramebufferAction(small_mode_.size(), &displays_[0], 401 JoinActions(kGrab, GetFramebufferAction(small_mode_.size(), &displays_[0],
402 nullptr).c_str(), 402 nullptr).c_str(),
403 GetCrtcAction(displays_[0], nullptr, gfx::Point()).c_str(), 403 GetCrtcAction(displays_[0], nullptr, gfx::Point()).c_str(),
404 kUngrab, NULL), 404 kUngrab, NULL),
405 log_.GetActionsAndClear()); 405 log_.GetActionsAndClear());
406 } 406 }
407 407
408 TEST_F(UpdateDisplayConfigurationTaskTest, NoopSoftwareMirrorConfiguration) { 408 TEST_F(UpdateDisplayConfigurationTaskTest, NoopSoftwareMirrorConfiguration) {
409 layout_manager_.set_should_mirror(false); 409 layout_manager_.set_should_mirror(false);
410 layout_manager_.set_software_mirroring_controller( 410 layout_manager_.set_software_mirroring_controller(
411 base::WrapUnique(new TestSoftwareMirroringController())); 411 base::MakeUnique<TestSoftwareMirroringController>());
412 UpdateDisplays(2); 412 UpdateDisplays(2);
413 413
414 { 414 {
415 UpdateDisplayConfigurationTask task( 415 UpdateDisplayConfigurationTask task(
416 &delegate_, &layout_manager_, MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED, 416 &delegate_, &layout_manager_, MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED,
417 chromeos::DISPLAY_POWER_ALL_ON, 0, 0, false, 417 chromeos::DISPLAY_POWER_ALL_ON, 0, 0, false,
418 base::Bind(&UpdateDisplayConfigurationTaskTest::ResponseCallback, 418 base::Bind(&UpdateDisplayConfigurationTaskTest::ResponseCallback,
419 base::Unretained(this))); 419 base::Unretained(this)));
420 task.Run(); 420 task.Run();
421 } 421 }
(...skipping 13 matching lines...) Expand all
435 EXPECT_EQ(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED, display_state_); 435 EXPECT_EQ(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED, display_state_);
436 EXPECT_TRUE(layout_manager_.GetSoftwareMirroringController() 436 EXPECT_TRUE(layout_manager_.GetSoftwareMirroringController()
437 ->SoftwareMirroringEnabled()); 437 ->SoftwareMirroringEnabled());
438 EXPECT_EQ(JoinActions(kGrab, kUngrab, NULL), log_.GetActionsAndClear()); 438 EXPECT_EQ(JoinActions(kGrab, kUngrab, NULL), log_.GetActionsAndClear());
439 } 439 }
440 440
441 TEST_F(UpdateDisplayConfigurationTaskTest, 441 TEST_F(UpdateDisplayConfigurationTaskTest,
442 ForceConfigurationWhileGoingToSoftwareMirror) { 442 ForceConfigurationWhileGoingToSoftwareMirror) {
443 layout_manager_.set_should_mirror(false); 443 layout_manager_.set_should_mirror(false);
444 layout_manager_.set_software_mirroring_controller( 444 layout_manager_.set_software_mirroring_controller(
445 base::WrapUnique(new TestSoftwareMirroringController())); 445 base::MakeUnique<TestSoftwareMirroringController>());
446 UpdateDisplays(2); 446 UpdateDisplays(2);
447 447
448 { 448 {
449 UpdateDisplayConfigurationTask task( 449 UpdateDisplayConfigurationTask task(
450 &delegate_, &layout_manager_, MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED, 450 &delegate_, &layout_manager_, MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED,
451 chromeos::DISPLAY_POWER_ALL_ON, 0, 0, false, 451 chromeos::DISPLAY_POWER_ALL_ON, 0, 0, false,
452 base::Bind(&UpdateDisplayConfigurationTaskTest::ResponseCallback, 452 base::Bind(&UpdateDisplayConfigurationTaskTest::ResponseCallback,
453 base::Unretained(this))); 453 base::Unretained(this)));
454 task.Run(); 454 task.Run();
455 } 455 }
(...skipping 21 matching lines...) Expand all
477 &displays_[0], &displays_[1]).c_str(), 477 &displays_[0], &displays_[1]).c_str(),
478 GetCrtcAction(displays_[0], &small_mode_, gfx::Point()).c_str(), 478 GetCrtcAction(displays_[0], &small_mode_, gfx::Point()).c_str(),
479 GetCrtcAction(displays_[1], &big_mode_, 479 GetCrtcAction(displays_[1], &big_mode_,
480 gfx::Point(0, small_mode_.size().height())).c_str(), 480 gfx::Point(0, small_mode_.size().height())).c_str(),
481 kUngrab, NULL), 481 kUngrab, NULL),
482 log_.GetActionsAndClear()); 482 log_.GetActionsAndClear());
483 } 483 }
484 484
485 } // namespace test 485 } // namespace test
486 } // namespace ui 486 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698