| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
| 8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "content/public/test/test_content_client_initializer.h" | 9 #include "content/public/test/test_content_client_initializer.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 class ComponentsTestSuite : public base::TestSuite { | 25 class ComponentsTestSuite : public base::TestSuite { |
| 26 public: | 26 public: |
| 27 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 27 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 virtual void Initialize() OVERRIDE { | 30 virtual void Initialize() OVERRIDE { |
| 31 base::TestSuite::Initialize(); | 31 base::TestSuite::Initialize(); |
| 32 #if !defined(OS_IOS) | 32 #if !defined(OS_IOS) |
| 33 gfx::GLSurface::InitializeOneOffForTests(true); | 33 gfx::GLSurface::InitializeOneOffForTests(); |
| 34 #endif | 34 #endif |
| 35 #if defined(OS_ANDROID) | 35 #if defined(OS_ANDROID) |
| 36 // Register JNI bindings for android. | 36 // Register JNI bindings for android. |
| 37 JNIEnv* env = base::android::AttachCurrentThread(); | 37 JNIEnv* env = base::android::AttachCurrentThread(); |
| 38 gfx::android::RegisterJni(env); | 38 gfx::android::RegisterJni(env); |
| 39 ui::android::RegisterJni(env); | 39 ui::android::RegisterJni(env); |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() | 42 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() |
| 43 // so we can load our pak file instead of chrome.pak. | 43 // so we can load our pak file instead of chrome.pak. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // The listener will set up common test environment for all components unit | 79 // The listener will set up common test environment for all components unit |
| 80 // tests. | 80 // tests. |
| 81 testing::TestEventListeners& listeners = | 81 testing::TestEventListeners& listeners = |
| 82 testing::UnitTest::GetInstance()->listeners(); | 82 testing::UnitTest::GetInstance()->listeners(); |
| 83 listeners.Append(new ComponentsUnitTestEventListener()); | 83 listeners.Append(new ComponentsUnitTestEventListener()); |
| 84 | 84 |
| 85 return base::LaunchUnitTests( | 85 return base::LaunchUnitTests( |
| 86 argc, argv, base::Bind(&base::TestSuite::Run, | 86 argc, argv, base::Bind(&base::TestSuite::Run, |
| 87 base::Unretained(&test_suite))); | 87 base::Unretained(&test_suite))); |
| 88 } | 88 } |
| OLD | NEW |