| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file looks like a unit test, but it contains benchmarks and test | 5 // This file looks like a unit test, but it contains benchmarks and test |
| 6 // utilities intended for manual evaluation of the scalers in | 6 // utilities intended for manual evaluation of the scalers in |
| 7 // gl_helper*. These tests produce output in the form of files and printouts, | 7 // gl_helper*. These tests produce output in the form of files and printouts, |
| 8 // but cannot really "fail". There is no point in making these tests part | 8 // but cannot really "fail". There is no point in making these tests part |
| 9 // of any test automation run. | 9 // of any test automation run. |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 "fast", | 54 "fast", |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 class GLHelperTest : public testing::Test { | 57 class GLHelperTest : public testing::Test { |
| 58 protected: | 58 protected: |
| 59 virtual void SetUp() { | 59 virtual void SetUp() { |
| 60 WebGraphicsContext3D::Attributes attributes; | 60 WebGraphicsContext3D::Attributes attributes; |
| 61 bool lose_context_when_out_of_memory = false; | 61 bool lose_context_when_out_of_memory = false; |
| 62 context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: | 62 context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 63 CreateOffscreenContext(attributes, lose_context_when_out_of_memory); | 63 CreateOffscreenContext(attributes, lose_context_when_out_of_memory); |
| 64 context_->makeContextCurrent(); | 64 context_->InitializeOnCurrentThread(); |
| 65 | 65 |
| 66 helper_.reset( | 66 helper_.reset( |
| 67 new content::GLHelper(context_->GetGLInterface(), | 67 new content::GLHelper(context_->GetGLInterface(), |
| 68 context_->GetContextSupport())); | 68 context_->GetContextSupport())); |
| 69 helper_scaling_.reset(new content::GLHelperScaling( | 69 helper_scaling_.reset(new content::GLHelperScaling( |
| 70 context_->GetGLInterface(), | 70 context_->GetGLInterface(), |
| 71 helper_.get())); | 71 helper_.get())); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void TearDown() { | 74 virtual void TearDown() { |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 int main(int argc, char** argv) { | 298 int main(int argc, char** argv) { |
| 299 base::CommandLine::Init(argc, argv); | 299 base::CommandLine::Init(argc, argv); |
| 300 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 300 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 301 #if defined(OS_MACOSX) | 301 #if defined(OS_MACOSX) |
| 302 base::mac::ScopedNSAutoreleasePool pool; | 302 base::mac::ScopedNSAutoreleasePool pool; |
| 303 #endif | 303 #endif |
| 304 gfx::GLSurface::InitializeOneOff(); | 304 gfx::GLSurface::InitializeOneOff(); |
| 305 | 305 |
| 306 return content::UnitTestTestSuite(suite).Run(); | 306 return content::UnitTestTestSuite(suite).Run(); |
| 307 } | 307 } |
| OLD | NEW |