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

Side by Side Diff: content/browser/compositor/software_output_device_ozone_unittest.cc

Issue 1373033004: aura: Defer OutputSurface creation until widget is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "content/browser/compositor/software_output_device_ozone.h" 8 #include "content/browser/compositor/software_output_device_ozone.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/skia/include/core/SkDevice.h" 10 #include "third_party/skia/include/core/SkDevice.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 void SoftwareOutputDeviceOzoneTest::SetUp() { 83 void SoftwareOutputDeviceOzoneTest::SetUp() {
84 ui::ContextFactory* context_factory = 84 ui::ContextFactory* context_factory =
85 ui::InitializeContextFactoryForTests(enable_pixel_output_); 85 ui::InitializeContextFactoryForTests(enable_pixel_output_);
86 86
87 const gfx::Size size(500, 400); 87 const gfx::Size size(500, 400);
88 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( 88 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow(
89 &window_delegate_, gfx::Rect(size)); 89 &window_delegate_, gfx::Rect(size));
90 compositor_.reset( 90 compositor_.reset(
91 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); 91 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get()));
92 compositor_->SetAcceleratedWidgetAndStartCompositor( 92 compositor_->SetAcceleratedWidget(window_delegate_.GetAcceleratedWidget());
93 window_delegate_.GetAcceleratedWidget());
94 compositor_->SetScaleAndSize(1.0f, size); 93 compositor_->SetScaleAndSize(1.0f, size);
95 94
96 output_device_.reset(new content::SoftwareOutputDeviceOzone( 95 output_device_.reset(new content::SoftwareOutputDeviceOzone(
97 compositor_.get())); 96 compositor_.get()));
98 output_device_->Resize(size, 1.f); 97 output_device_->Resize(size, 1.f);
99 } 98 }
100 99
101 void SoftwareOutputDeviceOzoneTest::TearDown() { 100 void SoftwareOutputDeviceOzoneTest::TearDown() {
102 output_device_.reset(); 101 output_device_.reset();
103 compositor_.reset(); 102 compositor_.reset();
(...skipping 27 matching lines...) Expand all
131 // Increase size. 130 // Increase size.
132 output_device_->Resize(size, 1.f); 131 output_device_->Resize(size, 1.f);
133 132
134 canvas = output_device_->BeginPaint(damage); 133 canvas = output_device_->BeginPaint(damage);
135 canvas_size.SetSize(canvas->getDeviceSize().width(), 134 canvas_size.SetSize(canvas->getDeviceSize().width(),
136 canvas->getDeviceSize().height()); 135 canvas->getDeviceSize().height());
137 EXPECT_EQ(size.ToString(), canvas_size.ToString()); 136 EXPECT_EQ(size.ToString(), canvas_size.ToString());
138 137
139 } 138 }
140 139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698