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

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: comments 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..d09164f5fd9befdbefc73da5bd33012c00d83288 100755
--- a/net/tools/testserver/chromiumsync.py
+++ b/net/tools/testserver/chromiumsync.py
@@ -863,6 +863,22 @@ 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.
ncarter (slow) 2011/08/25 00:05:09 No space after """
Nicolas Zea 2011/08/25 23:36:23 Done.
+
+ 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):
ncarter (slow) 2011/08/25 00:05:09 Each top-level definition should be preceded by 2
Nicolas Zea 2011/08/25 23:36:23 Done.
"""An object to handle requests for one (and only one) Chrome Sync account.
@@ -939,6 +955,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. """
ncarter (slow) 2011/08/25 00:05:09 No space after opening """ and no space between .
Nicolas Zea 2011/08/25 23:36:23 Done.
+ self.account.TriggerSyncTabs();
ncarter (slow) 2011/08/25 00:05:09 SEMICOLON?!?!
Nicolas Zea 2011/08/25 23:36:23 Done.
+ 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