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

Side by Side Diff: ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc

Issue 1438343002: Remove deprecated ScopedVector usage from ui/ozone and ui/events/ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove HDCI stuff Created 5 years, 1 month 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
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 <drm_fourcc.h> 5 #include <drm_fourcc.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" 10 #include "ui/ozone/platform/drm/gpu/crtc_controller.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 controller_->SchedulePageFlip( 301 controller_->SchedulePageFlip(
302 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, 302 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
303 base::Unretained(this))); 303 base::Unretained(this)));
304 drm_->RunCallbacks(); 304 drm_->RunCallbacks();
305 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); 305 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_);
306 EXPECT_EQ(1, page_flips_); 306 EXPECT_EQ(1, page_flips_);
307 307
308 const ui::HardwareDisplayPlane* owned_plane = nullptr; 308 const ui::HardwareDisplayPlane* owned_plane = nullptr;
309 for (const auto& plane : drm_->plane_manager()->planes()) { 309 for (const auto& plane : drm_->plane_manager()->planes()) {
310 if (plane->in_use()) 310 if (plane->in_use())
311 owned_plane = plane; 311 owned_plane = plane.get();
312 } 312 }
313 313
314 ASSERT_TRUE(owned_plane != nullptr); 314 ASSERT_TRUE(owned_plane != nullptr);
315 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc()); 315 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc());
316 316
317 // Removing the crtc should not free the plane or change ownership. 317 // Removing the crtc should not free the plane or change ownership.
318 scoped_ptr<ui::CrtcController> crtc = 318 scoped_ptr<ui::CrtcController> crtc =
319 controller_->RemoveCrtc(drm_, kPrimaryCrtc); 319 controller_->RemoveCrtc(drm_, kPrimaryCrtc);
320 EXPECT_TRUE(owned_plane->in_use()); 320 EXPECT_TRUE(owned_plane->in_use());
321 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc()); 321 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc());
(...skipping 18 matching lines...) Expand all
340 controller_->SchedulePageFlip( 340 controller_->SchedulePageFlip(
341 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, 341 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
342 base::Unretained(this))); 342 base::Unretained(this)));
343 drm_->RunCallbacks(); 343 drm_->RunCallbacks();
344 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); 344 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_);
345 EXPECT_EQ(1, page_flips_); 345 EXPECT_EQ(1, page_flips_);
346 346
347 const ui::HardwareDisplayPlane* owned_plane = nullptr; 347 const ui::HardwareDisplayPlane* owned_plane = nullptr;
348 for (const auto& plane : drm_->plane_manager()->planes()) 348 for (const auto& plane : drm_->plane_manager()->planes())
349 if (plane->in_use()) 349 if (plane->in_use())
350 owned_plane = plane; 350 owned_plane = plane.get();
351 ASSERT_TRUE(owned_plane != nullptr); 351 ASSERT_TRUE(owned_plane != nullptr);
352 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc()); 352 EXPECT_EQ(kPrimaryCrtc, owned_plane->owning_crtc());
353 scoped_ptr<ui::CrtcController> crtc = 353 scoped_ptr<ui::CrtcController> crtc =
354 controller_->RemoveCrtc(drm_, kPrimaryCrtc); 354 controller_->RemoveCrtc(drm_, kPrimaryCrtc);
355 // Destroying crtc should free the plane. 355 // Destroying crtc should free the plane.
356 crtc.reset(); 356 crtc.reset();
357 uint32_t crtc_nullid = 0; 357 uint32_t crtc_nullid = 0;
358 EXPECT_FALSE(owned_plane->in_use()); 358 EXPECT_FALSE(owned_plane->in_use());
359 EXPECT_EQ(crtc_nullid, owned_plane->owning_crtc()); 359 EXPECT_EQ(crtc_nullid, owned_plane->owning_crtc());
360 } 360 }
(...skipping 10 matching lines...) Expand all
371 controller_->SchedulePageFlip( 371 controller_->SchedulePageFlip(
372 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, 372 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
373 base::Unretained(this))); 373 base::Unretained(this)));
374 drm_->RunCallbacks(); 374 drm_->RunCallbacks();
375 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); 375 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_);
376 EXPECT_EQ(1, page_flips_); 376 EXPECT_EQ(1, page_flips_);
377 377
378 ui::HardwareDisplayPlane* primary_crtc_plane = nullptr; 378 ui::HardwareDisplayPlane* primary_crtc_plane = nullptr;
379 for (const auto& plane : drm_->plane_manager()->planes()) { 379 for (const auto& plane : drm_->plane_manager()->planes()) {
380 if (plane->in_use() && kPrimaryCrtc == plane->owning_crtc()) 380 if (plane->in_use() && kPrimaryCrtc == plane->owning_crtc())
381 primary_crtc_plane = plane; 381 primary_crtc_plane = plane.get();
382 } 382 }
383 383
384 ASSERT_TRUE(primary_crtc_plane != nullptr); 384 ASSERT_TRUE(primary_crtc_plane != nullptr);
385 385
386 scoped_ptr<ui::HardwareDisplayController> hdc_controller; 386 scoped_ptr<ui::HardwareDisplayController> hdc_controller;
387 hdc_controller.reset(new ui::HardwareDisplayController( 387 hdc_controller.reset(new ui::HardwareDisplayController(
388 controller_->RemoveCrtc(drm_, kPrimaryCrtc), controller_->origin())); 388 controller_->RemoveCrtc(drm_, kPrimaryCrtc), controller_->origin()));
389 controller_->SchedulePageFlip( 389 controller_->SchedulePageFlip(
390 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, 390 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
391 base::Unretained(this))); 391 base::Unretained(this)));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, 488 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
489 base::Unretained(this))); 489 base::Unretained(this)));
490 490
491 controller_->RemoveCrtc(drm_, kPrimaryCrtc); 491 controller_->RemoveCrtc(drm_, kPrimaryCrtc);
492 492
493 EXPECT_EQ(1, page_flips_); 493 EXPECT_EQ(1, page_flips_);
494 drm_->RunCallbacks(); 494 drm_->RunCallbacks();
495 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); 495 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_);
496 EXPECT_EQ(1, page_flips_); 496 EXPECT_EQ(1, page_flips_);
497 } 497 }
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_controller.cc ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698