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

Unified Diff: ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc

Issue 26849004: [Ozone] Adding a software rendering implementation of SurfaceFactoryOzone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated SSO unittest Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc
diff --git a/ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc b/ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc
index e85fd86125ccd8abd17df40c6cf5ca4c141683fa..c5d54bd54d1a1420b3e3cc0f5504480746193781 100644
--- a/ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc
+++ b/ui/gfx/ozone/impl/hardware_display_controller_ozone_unittest.cc
@@ -199,11 +199,11 @@ TEST_F(HardwareDisplayControllerOzoneTest,
TEST_F(HardwareDisplayControllerOzoneTest, CheckStateAfterSurfaceIsBound) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_TRUE(controller_->BindSurfaceToController(surface));
+ EXPECT_TRUE(controller_->BindSurfaceToController(surface.Pass()));
EXPECT_EQ(2, drm_->get_add_framebuffer_call_count());
EXPECT_EQ(gfx::HardwareDisplayControllerOzone::SURFACE_INITIALIZED,
@@ -215,29 +215,25 @@ TEST_F(HardwareDisplayControllerOzoneTest, CheckStateIfBindingFails) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_FALSE(controller_->BindSurfaceToController(surface));
+ EXPECT_FALSE(controller_->BindSurfaceToController(surface.Pass()));
EXPECT_EQ(1, drm_->get_add_framebuffer_call_count());
EXPECT_EQ(gfx::HardwareDisplayControllerOzone::FAILED,
controller_->get_state());
-
- // Normally the controller would take ownership, but we failed to bind, so we
- // need to clean up.
- delete surface;
}
TEST_F(HardwareDisplayControllerOzoneTest, CheckStateAfterPageFlip) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_TRUE(controller_->BindSurfaceToController(surface));
+ EXPECT_TRUE(controller_->BindSurfaceToController(surface.Pass()));
controller_->SchedulePageFlip();
@@ -250,11 +246,11 @@ TEST_F(HardwareDisplayControllerOzoneTest, CheckStateIfModesetFails) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_TRUE(controller_->BindSurfaceToController(surface));
+ EXPECT_TRUE(controller_->BindSurfaceToController(surface.Pass()));
controller_->SchedulePageFlip();
@@ -267,11 +263,11 @@ TEST_F(HardwareDisplayControllerOzoneTest, CheckStateIfPageFlipFails) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_TRUE(controller_->BindSurfaceToController(surface));
+ EXPECT_TRUE(controller_->BindSurfaceToController(surface.Pass()));
controller_->SchedulePageFlip();
@@ -282,11 +278,11 @@ TEST_F(HardwareDisplayControllerOzoneTest, CheckStateIfPageFlipFails) {
TEST_F(HardwareDisplayControllerOzoneTest, CheckProperDestruction) {
controller_->SetControllerInfo(
drm_.get(), kConnectorId, kCrtcId, kDefaultMode);
- gfx::SoftwareSurfaceOzone* surface =
- new MockSoftwareSurfaceOzone(controller_.get());
+ scoped_ptr<gfx::SoftwareSurfaceOzone> surface(
+ new MockSoftwareSurfaceOzone(controller_.get()));
EXPECT_TRUE(surface->Initialize());
- EXPECT_TRUE(controller_->BindSurfaceToController(surface));
+ EXPECT_TRUE(controller_->BindSurfaceToController(surface.Pass()));
EXPECT_EQ(gfx::HardwareDisplayControllerOzone::SURFACE_INITIALIZED,
controller_->get_state());
« no previous file with comments | « ui/gfx/ozone/impl/hardware_display_controller_ozone.cc ('k') | ui/gfx/ozone/impl/software_surface_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698