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_->BindToCurrentThread(); |
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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 base::CommandLine::Init(argc, argv); | 1701 base::CommandLine::Init(argc, argv); |
1702 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1702 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
1703 #if defined(OS_MACOSX) | 1703 #if defined(OS_MACOSX) |
1704 base::mac::ScopedNSAutoreleasePool pool; | 1704 base::mac::ScopedNSAutoreleasePool pool; |
1705 #endif | 1705 #endif |
1706 | 1706 |
1707 content::UnitTestTestSuite runner(suite); | 1707 content::UnitTestTestSuite runner(suite); |
1708 base::MessageLoop message_loop; | 1708 base::MessageLoop message_loop; |
1709 return runner.Run(); | 1709 return runner.Run(); |
1710 } | 1710 } |
OLD | NEW |