| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 const char* kQualityNames[] = {"best", "good", "fast", }; | 52 const char* kQualityNames[] = {"best", "good", "fast", }; |
| 53 | 53 |
| 54 class GLHelperTest : public testing::Test { | 54 class GLHelperTest : public testing::Test { |
| 55 protected: | 55 protected: |
| 56 virtual void SetUp() { | 56 virtual void SetUp() { |
| 57 WebGraphicsContext3D::Attributes attributes; | 57 WebGraphicsContext3D::Attributes attributes; |
| 58 bool lose_context_when_out_of_memory = false; | 58 bool lose_context_when_out_of_memory = false; |
| 59 context_ = | 59 context_ = |
| 60 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 60 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
| 61 attributes, lose_context_when_out_of_memory); | 61 attributes, lose_context_when_out_of_memory); |
| 62 context_->makeContextCurrent(); | 62 context_->InitializeOnCurrentThread(); |
| 63 context_support_ = context_->GetContextSupport(); | 63 context_support_ = context_->GetContextSupport(); |
| 64 helper_.reset( | 64 helper_.reset( |
| 65 new content::GLHelper(context_->GetGLInterface(), context_support_)); | 65 new content::GLHelper(context_->GetGLInterface(), context_support_)); |
| 66 helper_scaling_.reset(new content::GLHelperScaling( | 66 helper_scaling_.reset(new content::GLHelperScaling( |
| 67 context_->GetGLInterface(), helper_.get())); | 67 context_->GetGLInterface(), helper_.get())); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual void TearDown() { | 70 virtual void TearDown() { |
| 71 helper_scaling_.reset(NULL); | 71 helper_scaling_.reset(NULL); |
| 72 helper_.reset(NULL); | 72 helper_.reset(NULL); |
| (...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 base::CommandLine::Init(argc, argv); | 1954 base::CommandLine::Init(argc, argv); |
| 1955 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1955 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 1956 #if defined(OS_MACOSX) | 1956 #if defined(OS_MACOSX) |
| 1957 base::mac::ScopedNSAutoreleasePool pool; | 1957 base::mac::ScopedNSAutoreleasePool pool; |
| 1958 #endif | 1958 #endif |
| 1959 | 1959 |
| 1960 content::UnitTestTestSuite runner(suite); | 1960 content::UnitTestTestSuite runner(suite); |
| 1961 base::MessageLoop message_loop; | 1961 base::MessageLoop message_loop; |
| 1962 return runner.Run(); | 1962 return runner.Run(); |
| 1963 } | 1963 } |
| OLD | NEW |