Chromium Code Reviews| 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 "content/test/content_test_suite.h" | 5 #include "content/test/content_test_suite.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/public/test/test_content_client_initializer.h" | 8 #include "content/public/test/test_content_client_initializer.h" |
| 9 #include "content/test/test_content_client.h" | 9 #include "content/test/test_content_client.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 #include "ui/test/ui_test_initializer.h" |
| 12 #if defined(USE_AURA) | |
| 13 #include "ui/aura/test/test_aura_initializer.h" | |
| 14 #endif | |
| 15 | 12 |
| 16 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
| 17 #include "base/mac/scoped_nsautorelease_pool.h" | 14 #include "base/mac/scoped_nsautorelease_pool.h" |
| 18 #endif | 15 #endif |
| 19 | 16 |
| 20 namespace { | 17 namespace { |
| 21 | 18 |
| 22 class TestInitializationListener : public testing::EmptyTestEventListener { | 19 class TestInitializationListener : public testing::EmptyTestEventListener { |
| 23 public: | 20 public: |
| 24 TestInitializationListener() : test_content_client_initializer_(NULL) { | 21 TestInitializationListener() : test_content_client_initializer_(NULL) { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 38 | 35 |
| 39 DISALLOW_COPY_AND_ASSIGN(TestInitializationListener); | 36 DISALLOW_COPY_AND_ASSIGN(TestInitializationListener); |
| 40 }; | 37 }; |
| 41 | 38 |
| 42 } // namespace | 39 } // namespace |
| 43 | 40 |
| 44 namespace content { | 41 namespace content { |
| 45 | 42 |
| 46 ContentTestSuite::ContentTestSuite(int argc, char** argv) | 43 ContentTestSuite::ContentTestSuite(int argc, char** argv) |
| 47 : ContentTestSuiteBase(argc, argv) { | 44 : ContentTestSuiteBase(argc, argv) { |
| 48 #if defined(USE_AURA) | 45 ui_test_initializer_.reset(new ui::test::UITestInitializer); |
|
tony
2013/10/31 19:48:34
I'm a bit surprised that none of the content tests
| |
| 49 aura_initializer_.reset(new aura::test::TestAuraInitializer); | |
| 50 #endif | |
| 51 } | 46 } |
| 52 | 47 |
| 53 ContentTestSuite::~ContentTestSuite() { | 48 ContentTestSuite::~ContentTestSuite() { |
| 54 } | 49 } |
| 55 | 50 |
| 56 void ContentTestSuite::Initialize() { | 51 void ContentTestSuite::Initialize() { |
| 57 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 58 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 53 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 59 #endif | 54 #endif |
| 60 | 55 |
| 61 ContentTestSuiteBase::Initialize(); | 56 ContentTestSuiteBase::Initialize(); |
| 62 | 57 |
| 63 testing::TestEventListeners& listeners = | 58 testing::TestEventListeners& listeners = |
| 64 testing::UnitTest::GetInstance()->listeners(); | 59 testing::UnitTest::GetInstance()->listeners(); |
| 65 listeners.Append(new TestInitializationListener); | 60 listeners.Append(new TestInitializationListener); |
| 66 } | 61 } |
| 67 | 62 |
| 68 ContentClient* ContentTestSuite::CreateClientForInitialization() { | 63 ContentClient* ContentTestSuite::CreateClientForInitialization() { |
| 69 return new TestContentClient(); | 64 return new TestContentClient(); |
| 70 } | 65 } |
| 71 | 66 |
| 72 } // namespace content | 67 } // namespace content |
| OLD | NEW |