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

Unified Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 9348036: Trim code from sync's ServerConnectionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after Fred's patch Created 8 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
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.h ('k') | sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/sync_test.cc
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 77cf4769b6a1c4954e1fc774992bbd1deb3c54da..7c6defe5427d57a1875d27b20ecf99ed61ebe83a 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -116,6 +116,7 @@ SyncTest::SyncTest(TestType test_type)
server_type_(SERVER_TYPE_UNDECIDED),
num_clients_(-1),
use_verifier_(true),
+ notifications_enabled_(true),
test_server_handle_(base::kNullProcessHandle),
number_of_default_sync_items_(0) {
InProcessBrowserTest::set_show_window(true);
@@ -561,11 +562,15 @@ bool SyncTest::IsTestServerRunning() {
void SyncTest::EnableNetwork(Profile* profile) {
SetProxyConfig(profile->GetRequestContext(),
net::ProxyConfig::CreateDirect());
+ if (notifications_enabled_) {
+ EnableNotificationsImpl();
+ }
// TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed.
net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
}
void SyncTest::DisableNetwork(Profile* profile) {
+ DisableNotificationsImpl();
// Set the current proxy configuration to a nonexistent proxy to effectively
// disable networking.
net::ProxyConfig config;
@@ -594,7 +599,7 @@ bool SyncTest::ServerSupportsNotificationControl() const {
return server_type_ == LOCAL_PYTHON_SERVER;
}
-void SyncTest::DisableNotifications() {
+void SyncTest::DisableNotificationsImpl() {
ASSERT_TRUE(ServerSupportsNotificationControl());
std::string path = "chromiumsync/disablenotifications";
ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path));
@@ -602,7 +607,12 @@ void SyncTest::DisableNotifications() {
UTF16ToASCII(browser()->GetSelectedWebContents()->GetTitle()));
}
-void SyncTest::EnableNotifications() {
+void SyncTest::DisableNotifications() {
+ DisableNotificationsImpl();
+ notifications_enabled_ = false;
+}
+
+void SyncTest::EnableNotificationsImpl() {
ASSERT_TRUE(ServerSupportsNotificationControl());
std::string path = "chromiumsync/enablenotifications";
ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path));
@@ -610,6 +620,11 @@ void SyncTest::EnableNotifications() {
UTF16ToASCII(browser()->GetSelectedWebContents()->GetTitle()));
}
+void SyncTest::EnableNotifications() {
+ EnableNotificationsImpl();
+ notifications_enabled_ = true;
+}
+
void SyncTest::TriggerNotification(
syncable::ModelTypeSet changed_types) {
ASSERT_TRUE(ServerSupportsNotificationControl());
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.h ('k') | sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698