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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent, and remove some redundant using declarations Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/sync_test.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 DisableNotificationsImpl(); 587 DisableNotificationsImpl();
588 // Set the current proxy configuration to a nonexistent proxy to effectively 588 // Set the current proxy configuration to a nonexistent proxy to effectively
589 // disable networking. 589 // disable networking.
590 net::ProxyConfig config; 590 net::ProxyConfig config;
591 config.proxy_rules().ParseFromString("http=127.0.0.1:0"); 591 config.proxy_rules().ParseFromString("http=127.0.0.1:0");
592 SetProxyConfig(profile->GetRequestContext(), config); 592 SetProxyConfig(profile->GetRequestContext(), config);
593 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed. 593 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed.
594 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 594 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
595 } 595 }
596 596
597 bool SyncTest::EnableEncryption(int index, syncable::ModelType type) { 597 bool SyncTest::EnableEncryption(int index, syncer::ModelType type) {
598 return GetClient(index)->EnableEncryptionForType(type); 598 return GetClient(index)->EnableEncryptionForType(type);
599 } 599 }
600 600
601 bool SyncTest::IsEncrypted(int index, syncable::ModelType type) { 601 bool SyncTest::IsEncrypted(int index, syncer::ModelType type) {
602 return GetClient(index)->IsTypeEncrypted(type); 602 return GetClient(index)->IsTypeEncrypted(type);
603 } 603 }
604 604
605 bool SyncTest::AwaitQuiescence() { 605 bool SyncTest::AwaitQuiescence() {
606 return ProfileSyncServiceHarness::AwaitQuiescence(clients()); 606 return ProfileSyncServiceHarness::AwaitQuiescence(clients());
607 } 607 }
608 608
609 bool SyncTest::ServerSupportsNotificationControl() const { 609 bool SyncTest::ServerSupportsNotificationControl() const {
610 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); 610 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_);
611 611
(...skipping 21 matching lines...) Expand all
633 ASSERT_EQ("Notifications enabled", 633 ASSERT_EQ("Notifications enabled",
634 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle())); 634 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle()));
635 } 635 }
636 636
637 void SyncTest::EnableNotifications() { 637 void SyncTest::EnableNotifications() {
638 EnableNotificationsImpl(); 638 EnableNotificationsImpl();
639 notifications_enabled_ = true; 639 notifications_enabled_ = true;
640 } 640 }
641 641
642 void SyncTest::TriggerNotification( 642 void SyncTest::TriggerNotification(
643 syncable::ModelTypeSet changed_types) { 643 syncer::ModelTypeSet changed_types) {
644 ASSERT_TRUE(ServerSupportsNotificationControl()); 644 ASSERT_TRUE(ServerSupportsNotificationControl());
645 const std::string& data = 645 const std::string& data =
646 syncer::P2PNotificationData("from_server", 646 syncer::P2PNotificationData("from_server",
647 syncer::NOTIFY_ALL, 647 syncer::NOTIFY_ALL,
648 changed_types).ToString(); 648 changed_types).ToString();
649 const std::string& path = 649 const std::string& path =
650 std::string("chromiumsync/sendnotification?channel=") + 650 std::string("chromiumsync/sendnotification?channel=") +
651 syncer::kSyncP2PNotificationChannel + "&data=" + data; 651 syncer::kSyncP2PNotificationChannel + "&data=" + data;
652 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); 652 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path));
653 ASSERT_EQ("Notification sent", 653 ASSERT_EQ("Notification sent",
654 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle())); 654 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle()));
655 } 655 }
656 656
657 bool SyncTest::ServerSupportsErrorTriggering() const { 657 bool SyncTest::ServerSupportsErrorTriggering() const {
658 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); 658 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_);
659 659
660 // Supported only if we're using the python testserver. 660 // Supported only if we're using the python testserver.
661 return server_type_ == LOCAL_PYTHON_SERVER; 661 return server_type_ == LOCAL_PYTHON_SERVER;
662 } 662 }
663 663
664 void SyncTest::TriggerMigrationDoneError( 664 void SyncTest::TriggerMigrationDoneError(
665 syncable::ModelTypeSet model_types) { 665 syncer::ModelTypeSet model_types) {
666 ASSERT_TRUE(ServerSupportsErrorTriggering()); 666 ASSERT_TRUE(ServerSupportsErrorTriggering());
667 std::string path = "chromiumsync/migrate"; 667 std::string path = "chromiumsync/migrate";
668 char joiner = '?'; 668 char joiner = '?';
669 for (syncable::ModelTypeSet::Iterator it = model_types.First(); 669 for (syncer::ModelTypeSet::Iterator it = model_types.First();
670 it.Good(); it.Inc()) { 670 it.Good(); it.Inc()) {
671 path.append( 671 path.append(
672 base::StringPrintf( 672 base::StringPrintf(
673 "%ctype=%d", joiner, 673 "%ctype=%d", joiner,
674 syncable::GetSpecificsFieldNumberFromModelType(it.Get()))); 674 syncer::GetSpecificsFieldNumberFromModelType(it.Get())));
675 joiner = '&'; 675 joiner = '&';
676 } 676 }
677 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); 677 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path));
678 ASSERT_EQ("Migration: 200", 678 ASSERT_EQ("Migration: 200",
679 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle())); 679 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle()));
680 } 680 }
681 681
682 void SyncTest::TriggerBirthdayError() { 682 void SyncTest::TriggerBirthdayError() {
683 ASSERT_TRUE(ServerSupportsErrorTriggering()); 683 ASSERT_TRUE(ServerSupportsErrorTriggering());
684 std::string path = "chromiumsync/birthdayerror"; 684 std::string path = "chromiumsync/birthdayerror";
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, 789 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter,
790 const net::ProxyConfig& proxy_config) { 790 const net::ProxyConfig& proxy_config) {
791 base::WaitableEvent done(false, false); 791 base::WaitableEvent done(false, false);
792 BrowserThread::PostTask( 792 BrowserThread::PostTask(
793 BrowserThread::IO, FROM_HERE, 793 BrowserThread::IO, FROM_HERE,
794 base::Bind(&SetProxyConfigCallback, &done, 794 base::Bind(&SetProxyConfigCallback, &done,
795 make_scoped_refptr(context_getter), proxy_config)); 795 make_scoped_refptr(context_getter), proxy_config));
796 done.Wait(); 796 done.Wait();
797 } 797 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698