From 5b3e88a0e4aaecdebb16af89f1e24635973a1f4c Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Wed, 11 Dec 2013 04:28:07 +0000 Subject: [PATCH] Get rid of TestAuraInitializer. This is a followup to crrev.com/238564 where we reused ui_test_pak in aura_test_support. We remove TestAuraInitializer and just merge the code into ContentTestSuite, that seems to be the most suitable approach. BUG=None TEST=content_unittests,ash_unittests R=ben@chromium.org,tony@chromium.org Review URL: https://codereview.chromium.org/109093002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240011 0039d316-1c4b-4281-b951-d872f2087c98 --- content/content_tests.gypi | 1 + content/test/DEPS | 4 ++-- content/test/content_test_suite.cc | 15 ++++++++++----- content/test/content_test_suite.h | 12 ------------ ui/aura/aura.gyp | 3 --- ui/aura/test/test_aura_initializer.cc | 26 -------------------------- ui/aura/test/test_aura_initializer.h | 27 --------------------------- 7 files changed, 13 insertions(+), 75 deletions(-) delete mode 100644 ui/aura/test/test_aura_initializer.cc delete mode 100644 ui/aura/test/test_aura_initializer.h diff --git a/content/content_tests.gypi b/content/content_tests.gypi index bcf6ef3ea7f1d5..c71dc3d47dbdbd 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -278,6 +278,7 @@ 'dependencies': [ '../ui/aura/aura.gyp:aura_test_support', '../ui/compositor/compositor.gyp:compositor', + '../ui/resources/ui_resources.gyp:ui_test_pak', ], }], ['OS=="win"', { diff --git a/content/test/DEPS b/content/test/DEPS index 1949e27f82dcd1..6e063e848f2536 100644 --- a/content/test/DEPS +++ b/content/test/DEPS @@ -3,8 +3,8 @@ include_rules = [ "+content", "+media/audio", # For AudioParameters in WebRTC tests. "+media/base", # For ChannelLayout in WebRTC tests. - "+ui/aura/test/test_aura_initializer.h", - "+ui/base/resource/data_pack.h", "+third_party/WebKit/public/testing", + "+ui/base/resource/data_pack.h", + "+ui/base/resource/resource_bundle.h", "!v8/include/v8.h", ] diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc index 1fc9d3590d5ba4..3618365785381a 100644 --- a/content/test/content_test_suite.cc +++ b/content/test/content_test_suite.cc @@ -4,14 +4,13 @@ #include "content/test/content_test_suite.h" +#include "base/base_paths.h" #include "base/logging.h" +#include "base/path_service.h" #include "content/public/test/test_content_client_initializer.h" #include "content/test/test_content_client.h" #include "testing/gtest/include/gtest/gtest.h" - -#if defined(USE_AURA) -#include "ui/aura/test/test_aura_initializer.h" -#endif +#include "ui/base/resource/resource_bundle.h" #if defined(OS_MACOSX) #include "base/mac/scoped_nsautorelease_pool.h" @@ -46,11 +45,17 @@ namespace content { ContentTestSuite::ContentTestSuite(int argc, char** argv) : ContentTestSuiteBase(argc, argv) { #if defined(USE_AURA) - aura_initializer_.reset(new aura::test::TestAuraInitializer); + base::FilePath pak_file; + PathService::Get(base::DIR_MODULE, &pak_file); + pak_file = pak_file.AppendASCII("ui_test.pak"); + ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); #endif } ContentTestSuite::~ContentTestSuite() { +#if defined(USE_AURA) + ui::ResourceBundle::CleanupSharedInstance(); +#endif } void ContentTestSuite::Initialize() { diff --git a/content/test/content_test_suite.h b/content/test/content_test_suite.h index 510ab2d9aac702..346f4aace2b68e 100644 --- a/content/test/content_test_suite.h +++ b/content/test/content_test_suite.h @@ -12,14 +12,6 @@ #include "base/win/scoped_com_initializer.h" #endif -#if defined(USE_AURA) -namespace aura { -namespace test { -class TestAuraInitializer; -} // namespace test -} // namespace aura -#endif - namespace content { class ContentTestSuite : public ContentTestSuiteBase { @@ -37,10 +29,6 @@ class ContentTestSuite : public ContentTestSuiteBase { base::win::ScopedCOMInitializer com_initializer_; #endif -#if defined(USE_AURA) - scoped_ptr aura_initializer_; -#endif - DISALLOW_COPY_AND_ASSIGN(ContentTestSuite); }; diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp index 64807a10657a07..5cd992228bd100 100644 --- a/ui/aura/aura.gyp +++ b/ui/aura/aura.gyp @@ -148,7 +148,6 @@ '../events/events.gyp:events_base', '../events/events.gyp:events_test_support', '../gfx/gfx.gyp:gfx', - '../resources/ui_resources.gyp:ui_test_pak', '../ui.gyp:ui', '../ui_unittests.gyp:ui_test_support', 'aura', @@ -164,8 +163,6 @@ 'test/env_test_helper.h', 'test/event_generator.cc', 'test/event_generator.h', - 'test/test_aura_initializer.cc', - 'test/test_aura_initializer.h', 'test/test_cursor_client.cc', 'test/test_cursor_client.h', 'test/test_event_handler.cc', diff --git a/ui/aura/test/test_aura_initializer.cc b/ui/aura/test/test_aura_initializer.cc deleted file mode 100644 index ab6e1f54bdbd92..00000000000000 --- a/ui/aura/test/test_aura_initializer.cc +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/aura/test/test_aura_initializer.h" - -#include "base/base_paths.h" -#include "base/path_service.h" -#include "ui/base/resource/resource_bundle.h" - -namespace aura { -namespace test { - -TestAuraInitializer::TestAuraInitializer() { - base::FilePath pak_file; - PathService::Get(base::DIR_MODULE, &pak_file); - pak_file = pak_file.AppendASCII("ui_test.pak"); - ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); -} - -TestAuraInitializer::~TestAuraInitializer() { - ui::ResourceBundle::CleanupSharedInstance(); -} - -} // namespace test -} // namespace aura diff --git a/ui/aura/test/test_aura_initializer.h b/ui/aura/test/test_aura_initializer.h deleted file mode 100644 index bfbfe2f320d20a..00000000000000 --- a/ui/aura/test/test_aura_initializer.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_AURA_TEST_TEST_AURA_INITIALIZER_H_ -#define UI_AURA_TEST_TEST_AURA_INITIALIZER_H_ - -#include "base/basictypes.h" - -namespace aura { -namespace test { - -// Initializes various objects needed to run unit tests that use aura::* -// objects. -class TestAuraInitializer { - public: - TestAuraInitializer(); - virtual ~TestAuraInitializer(); - - private: - DISALLOW_COPY_AND_ASSIGN(TestAuraInitializer); -}; - -} // namespace test -} // namespace aura - -#endif // UI_AURA_TEST_TEST_AURA_INITIALIZER_H_