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

Unified Diff: net/tools/testserver/chromiumsync.py

Issue 7669073: [Sync] Add support for enabling session sync remotely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DOUBLE R..ebase Created 9 years, 4 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
« no previous file with comments | « chrome/test/live_sync/migration_errors_test.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/chromiumsync.py
diff --git a/net/tools/testserver/chromiumsync.py b/net/tools/testserver/chromiumsync.py
index cc71d47b2de1a9d17c9c3b9e9acff85f5a6ac2d5..166dff140b68cfed86a9af6c87097a1e692693a0 100755
--- a/net/tools/testserver/chromiumsync.py
+++ b/net/tools/testserver/chromiumsync.py
@@ -863,6 +863,23 @@ class SyncDataModel(object):
entry.parent_id_string)
self._entries[entry.id_string] = entry
+ def TriggerSyncTabs(self):
+ """Set the 'sync_tabs' field to this account's nigori node.
+
+ If the field is not currently set, will write a new nigori node entry
+ with the field set. Else does nothing.
+ """
+
+ nigori_tag = "google_chrome_nigori"
+ nigori_original = self._entries.get(self._ServerTagToId(nigori_tag))
+ if (nigori_original.specifics.Extensions[nigori_specifics_pb2.nigori].
+ sync_tabs):
+ return
+ nigori_new = copy.deepcopy(nigori_original)
+ nigori_new.specifics.Extensions[nigori_specifics_pb2.nigori].sync_tabs = (
+ True)
+ self._SaveEntry(nigori_new)
+
class TestServer(object):
"""An object to handle requests for one (and only one) Chrome Sync account.
@@ -939,6 +956,13 @@ class TestServer(object):
200,
'<html><title>Transient error</title><H1>Transient error</H1></html>')
+ def HandleSetSyncTabs(self):
+ """Set the 'sync_tab' field of the nigori node for this account."""
+ self.account.TriggerSyncTabs()
+ return (
+ 200,
+ '<html><title>Sync Tabs</title><H1>Sync Tabs</H1></html>')
+
def HandleCommand(self, query, raw_request):
"""Decode and handle a sync command from a raw input of bytes.
« no previous file with comments | « chrome/test/live_sync/migration_errors_test.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698