Commit 0d411416 authored by rsesek@chromium.org's avatar rsesek@chromium.org

[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
parent 135f5943
......@@ -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<MCNotificationController> 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<MCNotificationController> 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];
}
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment