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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() { |
75 helper_scaling_.reset(NULL); | 75 helper_scaling_.reset(nullptr); |
76 helper_.reset(NULL); | 76 helper_.reset(nullptr); |
77 context_.reset(NULL); | 77 context_.reset(nullptr); |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 void LoadPngFileToSkBitmap(const base::FilePath& filename, | 81 void LoadPngFileToSkBitmap(const base::FilePath& filename, |
82 SkBitmap* bitmap) { | 82 SkBitmap* bitmap) { |
83 std::string compressed; | 83 std::string compressed; |
84 base::ReadFileToString(base::MakeAbsoluteFilePath(filename), &compressed); | 84 base::ReadFileToString(base::MakeAbsoluteFilePath(filename), &compressed); |
85 ASSERT_TRUE(compressed.size()); | 85 ASSERT_TRUE(compressed.size()); |
86 ASSERT_TRUE(gfx::PNGCodec::Decode( | 86 ASSERT_TRUE(gfx::PNGCodec::Decode( |
87 reinterpret_cast<const unsigned char*>(compressed.data()), | 87 reinterpret_cast<const unsigned char*>(compressed.data()), |
(...skipping 210 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 |