| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/browser/mock_content_browser_client.h" | 9 #include "content/browser/mock_content_browser_client.h" |
| 10 #include "content/browser/notification_service_impl.h" | 10 #include "content/browser/notification_service_impl.h" |
| 11 #include "content/public/common/content_client.h" | 11 #include "content/public/common/content_client.h" |
| 12 #include "content/public/common/content_paths.h" | 12 #include "content/public/common/content_paths.h" |
| 13 #include "content/test/test_content_client.h" | 13 #include "content/test/test_content_client.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/base/ui_base_paths.h" | 15 #include "ui/base/ui_base_paths.h" |
| 16 #include "ui/gfx/test/gfx_test_utils.h" | 16 #include "ui/gfx/test/gfx_test_utils.h" |
| 17 | 17 |
| 18 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
| 19 #include "base/mac/scoped_nsautorelease_pool.h" | 19 #include "base/mac/scoped_nsautorelease_pool.h" |
| 20 #include "content/test/mock_chrome_application_mac.h" | |
| 21 #endif | 20 #endif |
| 22 | 21 |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 class TestContentClientInitializer : public testing::EmptyTestEventListener { | 24 class TestContentClientInitializer : public testing::EmptyTestEventListener { |
| 26 public: | 25 public: |
| 27 TestContentClientInitializer() { | 26 TestContentClientInitializer() { |
| 28 } | 27 } |
| 29 | 28 |
| 30 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { | 29 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 61 ContentTestSuite::ContentTestSuite(int argc, char** argv) | 60 ContentTestSuite::ContentTestSuite(int argc, char** argv) |
| 62 : base::TestSuite(argc, argv) { | 61 : base::TestSuite(argc, argv) { |
| 63 } | 62 } |
| 64 | 63 |
| 65 ContentTestSuite::~ContentTestSuite() { | 64 ContentTestSuite::~ContentTestSuite() { |
| 66 } | 65 } |
| 67 | 66 |
| 68 void ContentTestSuite::Initialize() { | 67 void ContentTestSuite::Initialize() { |
| 69 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
| 70 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 69 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 71 mock_cr_app::RegisterMockCrControlApp(); | |
| 72 #endif | 70 #endif |
| 73 | 71 |
| 74 base::TestSuite::Initialize(); | 72 base::TestSuite::Initialize(); |
| 75 | 73 |
| 76 content::RegisterPathProvider(); | 74 content::RegisterPathProvider(); |
| 77 ui::RegisterPathProvider(); | 75 ui::RegisterPathProvider(); |
| 78 | 76 |
| 79 // Mock out the compositor on platforms that use it. | 77 // Mock out the compositor on platforms that use it. |
| 80 ui::gfx_test_utils::SetupTestCompositor(); | 78 ui::gfx_test_utils::SetupTestCompositor(); |
| 81 | 79 |
| 82 testing::TestEventListeners& listeners = | 80 testing::TestEventListeners& listeners = |
| 83 testing::UnitTest::GetInstance()->listeners(); | 81 testing::UnitTest::GetInstance()->listeners(); |
| 84 listeners.Append(new TestContentClientInitializer); | 82 listeners.Append(new TestContentClientInitializer); |
| 85 } | 83 } |
| OLD | NEW |