| Index: chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
|
| diff --git a/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc b/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
|
| index 3ed1ccc09bcbe25343da65bcc8b9c621d1b756e0..516b3891225d0146fd53dfe36e6a3485e65b0ee3 100644
|
| --- a/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
|
| +++ b/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
|
| @@ -16,7 +16,8 @@
|
| #include "chrome/browser/sync/notifier/sync_notifier.h"
|
| #include "chrome/browser/sync/syncable/model_type.h"
|
| #include "chrome/browser/sync/syncable/model_type_payload_map.h"
|
| -#include "chrome/common/chrome_switches.h"
|
| +#include "jingle/notifier/base/notification_method.h"
|
| +#include "jingle/notifier/base/notifier_options.h"
|
| #include "net/url_request/url_request_test_util.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -30,34 +31,31 @@ using ::testing::StrictMock;
|
|
|
| class SyncNotifierFactoryTest : public testing::Test {
|
| protected:
|
| - SyncNotifierFactoryTest()
|
| - : command_line_(CommandLine::NO_PROGRAM) {}
|
| - virtual ~SyncNotifierFactoryTest() {}
|
|
|
| virtual void SetUp() OVERRIDE {
|
| - factory_.reset(new SyncNotifierFactory(
|
| - "fake_client_info",
|
| - new TestURLRequestContextGetter(message_loop_.message_loop_proxy()),
|
| - base::WeakPtr<sync_notifier::InvalidationVersionTracker>(),
|
| - command_line_));
|
| - message_loop_.RunAllPending();
|
| + notifier_options_.request_context_getter =
|
| + new TestURLRequestContextGetter(message_loop_.message_loop_proxy());
|
| }
|
|
|
| virtual void TearDown() OVERRIDE {
|
| Mock::VerifyAndClearExpectations(&mock_observer_);
|
| message_loop_.RunAllPending();
|
| - command_line_ = CommandLine(CommandLine::NO_PROGRAM);
|
| }
|
|
|
| MessageLoop message_loop_;
|
| StrictMock<MockSyncNotifierObserver> mock_observer_;
|
| + notifier::NotifierOptions notifier_options_;
|
| scoped_ptr<SyncNotifierFactory> factory_;
|
| - CommandLine command_line_;
|
| };
|
|
|
| // Test basic creation of a NonBlockingInvalidationNotifier.
|
| TEST_F(SyncNotifierFactoryTest, Basic) {
|
| - scoped_ptr<SyncNotifier> notifier(factory_->CreateSyncNotifier());
|
| + notifier_options_.notification_method = notifier::NOTIFICATION_SERVER;
|
| + SyncNotifierFactory factory(
|
| + notifier_options_,
|
| + "test client info",
|
| + base::WeakPtr<sync_notifier::InvalidationVersionTracker>());
|
| + scoped_ptr<SyncNotifier> notifier(factory.CreateSyncNotifier());
|
| ASSERT_TRUE(notifier.get());
|
| notifier->AddObserver(&mock_observer_);
|
| notifier->RemoveObserver(&mock_observer_);
|
| @@ -65,8 +63,12 @@ TEST_F(SyncNotifierFactoryTest, Basic) {
|
|
|
| // Test basic creation of a P2PNotifier.
|
| TEST_F(SyncNotifierFactoryTest, Basic_P2P) {
|
| - command_line_.AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p");
|
| - scoped_ptr<SyncNotifier> notifier(factory_->CreateSyncNotifier());
|
| + notifier_options_.notification_method = notifier::NOTIFICATION_P2P;
|
| + SyncNotifierFactory factory(
|
| + notifier_options_,
|
| + "test client info",
|
| + base::WeakPtr<sync_notifier::InvalidationVersionTracker>());
|
| + scoped_ptr<SyncNotifier> notifier(factory.CreateSyncNotifier());
|
| ASSERT_TRUE(notifier.get());
|
| notifier->AddObserver(&mock_observer_);
|
| notifier->RemoveObserver(&mock_observer_);
|
|
|