Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3984)

Unified Diff: chrome/browser/ui/webui/sync_internals_browsertest.js

Issue 212603007: sync: Buffer Protocol Events for about:sync page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/sync_internals_browsertest.js
diff --git a/chrome/browser/ui/webui/sync_internals_browsertest.js b/chrome/browser/ui/webui/sync_internals_browsertest.js
index 3e6aa24fbb4809812439851d0fc6143f8738835c..3a1160cbc04ed2a1b023258967da07404b68b0ec 100644
--- a/chrome/browser/ui/webui/sync_internals_browsertest.js
+++ b/chrome/browser/ui/webui/sync_internals_browsertest.js
@@ -227,6 +227,20 @@ HARD_CODED_ABOUT_INFO = {
"unrecoverable_error_detected": false
};
+NETWORK_EVENT_DETAILS_1 = {
+ "details":"Notified types: Bookmarks, Autofill",
+ "proto":{},
+ "time":1395874542192.407,
+ "type":"Normal GetUpdate request"
+};
+
+NETWORK_EVENT_DETAILS_2 = {
+ "details":"Received error: SYNC_AUTH_ERROR",
+ "proto":{},
+ "time":1395874542192.837,
+ "type":"GetUpdates Response"
+};
+
TEST_F('SyncInternalsWebUITest', 'Uninitialized', function() {
assertNotEquals(null, chrome.sync.aboutInfo);
expectTrue(this.hasInDetails(true, 'Username', ''));
@@ -246,6 +260,22 @@ TEST_F('SyncInternalsWebUITest', 'LoadPastedAboutInfo', function() {
expectTrue(this.hasInDetails(true, 'Summary', 'Sync service initialized'));
});
+TEST_F('SyncInternalsWebUITest', 'NetworkEventsTest', function() {
+ networkEvent1 = new Event('onProtocolEvent');
+ networkEvent1.details = NETWORK_EVENT_DETAILS_1;
+ networkEvent2 = new Event('onProtocolEvent');
+ networkEvent2.details = NETWORK_EVENT_DETAILS_2;
+
+ chrome.sync.events.dispatchEvent(networkEvent1);
+ chrome.sync.events.dispatchEvent(networkEvent2);
+
+ expectEquals(2, $('traffic-event-container').children.length);
+
+ // Test that repeated events are not re-displayed.
+ chrome.sync.events.dispatchEvent(networkEvent1);
+ expectEquals(2, $('traffic-event-container').children.length);
+});
+
TEST_F('SyncInternalsWebUITest', 'SearchTabDoesntChangeOnItemSelect',
function() {
// Select the search tab.
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/ui/webui/sync_internals_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698