diff options
author | mferreria@chromium.org <mferreria@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 19:50:30 +0000 |
---|---|---|
committer | mferreria@chromium.org <mferreria@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 19:50:30 +0000 |
commit | 0706341097163814a7bacf89aec118ebfd5ba69c (patch) | |
tree | b8b73237bb393fcf54f2c3410d3e08186e6ff819 /sync/internal_api/sync_manager_impl_unittest.cc | |
parent | e82a750a739a620495eaee902dd7759cdb1e20a1 (diff) | |
download | chromium_src-0706341097163814a7bacf89aec118ebfd5ba69c.zip chromium_src-0706341097163814a7bacf89aec118ebfd5ba69c.tar.gz chromium_src-0706341097163814a7bacf89aec118ebfd5ba69c.tar.bz2 |
Removed redundant notifications info from about:sync-internals
This patch removes the tab 'Notifications' from about:sync-internals.
This tab used to be useful for debugging notifications as they arrived,
but now that its functionality has been replaced and augmented
in the new about:invalidations, with more general functionality and extended
logging information, it is no longer necessary to have it here.
BUG=351559
Review URL: https://codereview.chromium.org/196373004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl_unittest.cc')
-rw-r--r-- | sync/internal_api/sync_manager_impl_unittest.cc | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index ca1167d..064db9e 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -938,20 +938,6 @@ class SyncManagerTest : public testing::Test, InternalComponentsFactory::Switches switches_; }; -TEST_F(SyncManagerTest, ProcessJsMessage) { - const JsArgList kNoArgs; - - StrictMock<MockJsReplyHandler> reply_handler; - - EXPECT_CALL(reply_handler, - HandleJsReply("getNotificationInfo", _)); - - // This message should be dropped. - SendJsMessage("unknownMessage", kNoArgs, reply_handler.AsWeakHandle()); - - SendJsMessage("getNotificationInfo", kNoArgs, reply_handler.AsWeakHandle()); -} - TEST_F(SyncManagerTest, GetAllNodesTest) { StrictMock<MockJsReplyHandler> reply_handler; JsArgList return_args; @@ -993,100 +979,6 @@ TEST_F(SyncManagerTest, GetAllNodesTest) { EXPECT_TRUE(first_result->HasKey("NON_UNIQUE_NAME")); } -// Simulate various invalidator state changes. Those should propagate -// JS events. -TEST_F(SyncManagerTest, OnInvalidatorStateChangeJsEvents) { - StrictMock<MockJsEventHandler> event_handler; - - base::DictionaryValue enabled_details; - enabled_details.SetString("state", "INVALIDATIONS_ENABLED"); - base::DictionaryValue credentials_rejected_details; - credentials_rejected_details.SetString( - "state", "INVALIDATION_CREDENTIALS_REJECTED"); - base::DictionaryValue transient_error_details; - transient_error_details.SetString("state", "TRANSIENT_INVALIDATION_ERROR"); - base::DictionaryValue auth_error_details; - auth_error_details.SetString("status", "CONNECTION_AUTH_ERROR"); - - EXPECT_CALL(event_handler, - HandleJsEvent("onNotificationStateChange", - HasDetailsAsDictionary(enabled_details))); - - EXPECT_CALL( - event_handler, - HandleJsEvent("onNotificationStateChange", - HasDetailsAsDictionary(credentials_rejected_details))) - .Times(2); - - EXPECT_CALL(event_handler, - HandleJsEvent("onNotificationStateChange", - HasDetailsAsDictionary(transient_error_details))); - - // Test needs to simulate INVALIDATION_CREDENTIALS_REJECTED with event handler - // attached because this is the only time when CONNECTION_AUTH_ERROR - // notification will be generated, therefore the only chance to verify that - // "onConnectionStatusChange" event is delivered - SetJsEventHandler(event_handler.AsWeakHandle()); - SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED); - SetJsEventHandler(WeakHandle<JsEventHandler>()); - - SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED); - SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED); - SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR); - - SetJsEventHandler(event_handler.AsWeakHandle()); - SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED); - SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED); - SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR); - SetJsEventHandler(WeakHandle<JsEventHandler>()); - - SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED); - SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED); - SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR); - - // Should trigger the replies. - PumpLoop(); -} - -TEST_F(SyncManagerTest, OnIncomingNotification) { - StrictMock<MockJsEventHandler> event_handler; - - const ModelTypeSet empty_model_types; - const ModelTypeSet model_types( - BOOKMARKS, THEMES); - - // Build expected_args to have a single argument with the string - // equivalents of model_types. - base::DictionaryValue expected_details; - { - base::ListValue* model_type_list = new base::ListValue(); - expected_details.SetString("source", "REMOTE_INVALIDATION"); - expected_details.Set("changedTypes", model_type_list); - for (ModelTypeSet::Iterator it = model_types.First(); - it.Good(); it.Inc()) { - model_type_list->Append( - new base::StringValue(ModelTypeToString(it.Get()))); - } - } - - EXPECT_CALL(event_handler, - HandleJsEvent("onIncomingNotification", - HasDetailsAsDictionary(expected_details))); - - TriggerOnIncomingNotificationForTest(empty_model_types); - TriggerOnIncomingNotificationForTest(model_types); - - SetJsEventHandler(event_handler.AsWeakHandle()); - TriggerOnIncomingNotificationForTest(model_types); - SetJsEventHandler(WeakHandle<JsEventHandler>()); - - TriggerOnIncomingNotificationForTest(empty_model_types); - TriggerOnIncomingNotificationForTest(model_types); - - // Should trigger the replies. - PumpLoop(); -} - TEST_F(SyncManagerTest, RefreshEncryptionReady) { EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION)); EXPECT_CALL(encryption_observer_, OnEncryptionComplete()); |