diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-23 16:54:04 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-23 16:54:04 +0000 |
commit | 15da2dd0882f922610a842b58778c0fc9a1f3b5e (patch) | |
tree | e1e3cbbae955286bbe0f466c42aebcc6ec871acc /ui/message_center | |
parent | e9c42b37faeddeb37de40b0b96074f177cf50114 (diff) | |
download | chromium_src-15da2dd0882f922610a842b58778c0fc9a1f3b5e.zip chromium_src-15da2dd0882f922610a842b58778c0fc9a1f3b5e.tar.gz chromium_src-15da2dd0882f922610a842b58778c0fc9a1f3b5e.tar.bz2 |
ui: Break the dependency on run_ui_unittests target.
This makes three unit tests targets stop depending on run_ui_unittests
target. By depending on it brings an indirect dependency on
chrome/chrome_resources.gyp:packed_resources. And we don't want that.
Instead we make these independent test targets load the test pak
themselves, so they can depend only in ui_test.pak.
BUG=144345
TEST=app_list_unittests, message_center_unittests, keyboard_unittests
R=tony@chromium.org,xiyuan@chromium.org,sadrul@chromium.org,miket@chromium.org
Review URL: https://codereview.chromium.org/143393003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/message_center.gyp | 3 | ||||
-rw-r--r-- | ui/message_center/test/run_all_unittests.cc | 47 |
2 files changed, 43 insertions, 7 deletions
diff --git a/ui/message_center/message_center.gyp b/ui/message_center/message_center.gyp index fc06cdf..e05b78b 100644 --- a/ui/message_center/message_center.gyp +++ b/ui/message_center/message_center.gyp @@ -178,12 +178,11 @@ '../../skia/skia.gyp:skia', '../../testing/gtest.gyp:gtest', '../../url/url.gyp:url_lib', - '../../url/url.gyp:url_lib', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', '../resources/ui_resources.gyp:ui_resources', + '../resources/ui_resources.gyp:ui_test_pak', '../ui.gyp:ui', - '../ui_unittests.gyp:run_ui_unittests', 'message_center', 'message_center_test_support', ], diff --git a/ui/message_center/test/run_all_unittests.cc b/ui/message_center/test/run_all_unittests.cc index 32bd5cb..094e128 100644 --- a/ui/message_center/test/run_all_unittests.cc +++ b/ui/message_center/test/run_all_unittests.cc @@ -1,15 +1,52 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 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 "base/basictypes.h" #include "base/bind.h" +#include "base/compiler_specific.h" +#include "base/path_service.h" #include "base/test/launcher/unit_test_launcher.h" -#include "ui/test/test_suite.h" +#include "base/test/test_suite.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/base/ui_base_paths.h" + +namespace { + +class MessageCenterTestSuite : public base::TestSuite { + public: + MessageCenterTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} + + protected: + virtual void Initialize() OVERRIDE { + base::TestSuite::Initialize(); + ui::RegisterPathProvider(); + + base::FilePath pak_dir; + PathService::Get(base::DIR_MODULE, &pak_dir); + + base::FilePath pak_file; + pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); + + ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); + } + + virtual void Shutdown() OVERRIDE { + ui::ResourceBundle::CleanupSharedInstance(); + base::TestSuite::Shutdown(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(MessageCenterTestSuite); +}; + +} // namespace int main(int argc, char** argv) { - ui::test::UITestSuite test_suite(argc, argv); + MessageCenterTestSuite test_suite(argc, argv); return base::LaunchUnitTests( - argc, argv, base::Bind(&ui::test::UITestSuite::Run, - base::Unretained(&test_suite))); + argc, + argv, + base::Bind(&MessageCenterTestSuite::Run, base::Unretained(&test_suite))); } |