From 0d411416a2899c54a22227a64d3c810632779786 Mon Sep 17 00:00:00 2001 From: "rsesek@chromium.org" Date: Fri, 19 Apr 2013 14:25:36 +0000 Subject: [Mac][MC] Fix bustage from various refactorings. BUG=179904 TEST=Compile locally. Still waiting for the bots to be updated. Review URL: https://chromiumcodereview.appspot.com/14141003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195181 0039d316-1c4b-4281-b951-d872f2087c98 --- .../cocoa/notification_controller_unittest.mm | 15 ++++++++------- ui/message_center/test/run_all_unittests.cc | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'ui') diff --git a/ui/message_center/cocoa/notification_controller_unittest.mm b/ui/message_center/cocoa/notification_controller_unittest.mm index ef304cb..24543cf 100644 --- a/ui/message_center/cocoa/notification_controller_unittest.mm +++ b/ui/message_center/cocoa/notification_controller_unittest.mm @@ -16,7 +16,7 @@ namespace { -class MockMessageCenter : public FakeMessageCenter { +class MockMessageCenter : public message_center::FakeMessageCenter { public: MockMessageCenter() : last_removed_by_user_(false), @@ -26,7 +26,8 @@ class MockMessageCenter : public FakeMessageCenter { virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE { last_removed_id_ = id; - last_removed_by_user_ = by_user_; + last_removed_by_user_ = by_user; + ++remove_count_; } const std::string& last_removed_id() const { return last_removed_id_; } @@ -82,7 +83,7 @@ TEST_F(NotificationControllerTest, BasicLayout) { scoped_nsobject controller( [[MCNotificationController alloc] initWithNotification:notification.get() - changeObserver:NULL]); + messageCenter:NULL]); [controller view]; EXPECT_EQ(TestIcon(), [[controller iconView] image]); @@ -108,7 +109,7 @@ TEST_F(NotificationControllerTest, OverflowText) { NULL)); scoped_nsobject controller( [[MCNotificationController alloc] initWithNotification:notification.get() - changeObserver:NULL]); + messageCenter:NULL]); [controller view]; EXPECT_GT(NSHeight([[controller view] frame]), @@ -132,9 +133,9 @@ TEST_F(NotificationControllerTest, Close) { messageCenter:&messageCenter]); [controller view]; - EXPECT_TRUE(1, messageCenter.remove_count()); + [[controller closeButton] performClick:nil]; + + EXPECT_EQ(1, messageCenter.remove_count()); EXPECT_EQ("an_id", messageCenter.last_removed_id()); EXPECT_TRUE(messageCenter.last_removed_by_user()); - - [[controller closeButton] performClick:nil]; } diff --git a/ui/message_center/test/run_all_unittests.cc b/ui/message_center/test/run_all_unittests.cc index c69a901..0c2e56a 100644 --- a/ui/message_center/test/run_all_unittests.cc +++ b/ui/message_center/test/run_all_unittests.cc @@ -4,16 +4,18 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "base/test/test_suite.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/compositor/compositor_setup.h" #include "ui/compositor/test/compositor_test_support.h" +#include "ui/test/test_suite.h" #include "ui/views/view.h" -class MessageCenterTestSuite : public base::TestSuite { +class MessageCenterTestSuite : public ui::test::UITestSuite { public: - MessageCenterTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} + MessageCenterTestSuite(int argc, char** argv) + : ui::test::UITestSuite(argc, argv) { + } protected: virtual void Initialize() OVERRIDE; @@ -24,17 +26,20 @@ class MessageCenterTestSuite : public base::TestSuite { }; void MessageCenterTestSuite::Initialize() { - base::TestSuite::Initialize(); - - ui::RegisterPathProvider(); - ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); + ui::test::UITestSuite::Initialize(); +#if !defined(OS_MACOSX) ui::CompositorTestSupport::Initialize(); ui::SetupTestCompositor(); +#endif } void MessageCenterTestSuite::Shutdown() { + ui::test::UITestSuite::Shutdown(); + +#if !defined(OS_MACOSX) ui::CompositorTestSupport::Terminate(); +#endif } int main(int argc, char** argv) { -- cgit v1.1