OLD | NEW |
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 <stdio.h> | 5 #include <stdio.h> |
6 #include <cmath> | 6 #include <cmath> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 content::GLHelper::SCALER_QUALITY_BEST, | 53 content::GLHelper::SCALER_QUALITY_BEST, |
54 content::GLHelper::SCALER_QUALITY_GOOD, | 54 content::GLHelper::SCALER_QUALITY_GOOD, |
55 content::GLHelper::SCALER_QUALITY_FAST, }; | 55 content::GLHelper::SCALER_QUALITY_FAST, }; |
56 | 56 |
57 const char* kQualityNames[] = {"best", "good", "fast", }; | 57 const char* kQualityNames[] = {"best", "good", "fast", }; |
58 | 58 |
59 class GLHelperTest : public testing::Test { | 59 class GLHelperTest : public testing::Test { |
60 protected: | 60 protected: |
61 virtual void SetUp() { | 61 virtual void SetUp() { |
62 WebGraphicsContext3D::Attributes attributes; | 62 WebGraphicsContext3D::Attributes attributes; |
| 63 bool lose_context_when_out_of_memory = false; |
63 context_ = | 64 context_ = |
64 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 65 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
65 attributes); | 66 attributes, lose_context_when_out_of_memory); |
66 context_->makeContextCurrent(); | 67 context_->makeContextCurrent(); |
67 context_support_ = context_->GetContextSupport(); | 68 context_support_ = context_->GetContextSupport(); |
68 helper_.reset( | 69 helper_.reset( |
69 new content::GLHelper(context_->GetGLInterface(), context_support_)); | 70 new content::GLHelper(context_->GetGLInterface(), context_support_)); |
70 helper_scaling_.reset(new content::GLHelperScaling( | 71 helper_scaling_.reset(new content::GLHelperScaling( |
71 context_->GetGLInterface(), helper_.get())); | 72 context_->GetGLInterface(), helper_.get())); |
72 } | 73 } |
73 | 74 |
74 virtual void TearDown() { | 75 virtual void TearDown() { |
75 helper_scaling_.reset(NULL); | 76 helper_scaling_.reset(NULL); |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 #endif | 1673 #endif |
1673 #if defined(TOOLKIT_GTK) | 1674 #if defined(TOOLKIT_GTK) |
1674 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1675 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
1675 #endif | 1676 #endif |
1676 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); | 1677 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
1677 | 1678 |
1678 content::UnitTestTestSuite runner(suite); | 1679 content::UnitTestTestSuite runner(suite); |
1679 base::MessageLoop message_loop; | 1680 base::MessageLoop message_loop; |
1680 return runner.Run(); | 1681 return runner.Run(); |
1681 } | 1682 } |
OLD | NEW |