summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/test
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 01:42:49 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 01:42:49 +0000
commit8ff3cddc8a9b817ae7c9ccba743cab0d25eccd33 (patch)
tree0a9d91ad6c0b4b8dfe3ab3b254e66e7146a05296 /sync/internal_api/test
parentee060d4042c1a7803510c6ed31f4840d1eb9d080 (diff)
downloadchromium_src-8ff3cddc8a9b817ae7c9ccba743cab0d25eccd33.zip
chromium_src-8ff3cddc8a9b817ae7c9ccba743cab0d25eccd33.tar.gz
chromium_src-8ff3cddc8a9b817ae7c9ccba743cab0d25eccd33.tar.bz2
Revert 239615 "Retry: Clean up TestProfileSyncService tests"
Failed on CrOS: http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28x86%29/builds/18496/steps/BuildPackages/logs/stdio chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:417:11: error: 'MetaInfo' in namespace 'sync_pb' does not name a type chromeos-chrome-33.0.1734.0_alpha-r1: const sync_pb::MetaInfo& proto) { chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:417:30: error: ISO C++ forbids declaration of 'proto' with no type [-fpermissive] chromeos-chrome-33.0.1734.0_alpha-r1: const sync_pb::MetaInfo& proto) { chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc: In function 'base::DictionaryValue* syncer::MetaInfoToValue(const int&)': chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:419:13: error: request for member 'has_key' in 'proto', which is of non-class type 'const int' chromeos-chrome-33.0.1734.0_alpha-r1: SET_STR(key); chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:419:72: error: request for member 'key' in 'proto', which is of non-class type 'const int' chromeos-chrome-33.0.1734.0_alpha-r1: SET_STR(key); chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:420:13: error: request for member 'has_value' in 'proto', which is of non-class type 'const int' chromeos-chrome-33.0.1734.0_alpha-r1: SET_STR(value); chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:420:76: error: request for member 'value' in 'proto', which is of non-class type 'const int' chromeos-chrome-33.0.1734.0_alpha-r1: SET_STR(value); chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc: In function 'base::DictionaryValue* syncer::BookmarkSpecificsToValue(const sync_pb::BookmarkSpecifics&)': chromeos-chrome-33.0.1734.0_alpha-r1: sync/protocol/proto_value_conversions.cc:432:51: error: 'const class sync_pb::BookmarkSpecifics' has no member named 'meta_info' chromeos-chrome-33.0.1734.0_alpha-r1: SET_REP(meta_info, &MetaInfoToValue); chromeos-chrome-33.0.1734.0_alpha-r1: ^ chromeos-chrome-33.0.1734.0_alpha-r1: make: *** [c/Release/obj.target/sync_core/sync/protocol/proto_value_conversions.o] Error 1 chromeos-chrome-33.0.1734.0_alpha-r1: make: *** Waiting for unfinished jobs.... chromeos-chrome-33.0.1734.0_alpha-r1: * ERROR: chromeos-base/chromeos-chrome-33.0.1734.0_alpha-r1 failed (compile phase): chromeos-chrome-33.0.1734.0_alpha-r1: * emake failed chromeos-chrome-33.0.1734.0_alpha-r1: * > Retry: Clean up TestProfileSyncService tests > > This is a retry of r238348, which was reverted in r238368. I believe > the build failure that led to the revert, though related to my change, > was a flake caused by stale object files on the build bot. > > This CL refactors many of the tests in profile_sync_service_unittest.cc. > It continues the refactoring work begun in r233533, r235661, and > r235854. > > The JsController tests have been deleted. There is not much point in > testing the JsController here; it can be more easily tested on its own > in sync_js_controller_uniittest.cc. The SyncJsController unit tests have > been updated so they now cover the few cases that were formerly only > exercised in the ProfileSyncService unit tests. > > It converts all remaining uncoverted tests from relying on the > TestProfileSyncService to using a real ProfileSyncService with an > injected backend. The injected backend makes it easier to create the > scenarios we want to test. We can inject a specially crafted SBH rather > than fiddling with "synchronous init" and "fail initial download" flags. > > Since the TestProfileSyncService no longer needs to support the wide > variety of test scenarios required by the tests in > profile_sync_service_unittest.cc, we can greatly simplify its > implementation. Many of its parameters and associated code have been > removed. > > BUG=140354,312994 > > Review URL: https://codereview.chromium.org/102513002 TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/110993003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/test')
-rw-r--r--sync/internal_api/test/sync_manager_factory_for_profile_sync_test.cc9
-rw-r--r--sync/internal_api/test/sync_manager_for_profile_sync_test.cc24
-rw-r--r--sync/internal_api/test/sync_manager_for_profile_sync_test.h4
3 files changed, 24 insertions, 13 deletions
diff --git a/sync/internal_api/test/sync_manager_factory_for_profile_sync_test.cc b/sync/internal_api/test/sync_manager_factory_for_profile_sync_test.cc
index 34289c4..df4073b 100644
--- a/sync/internal_api/test/sync_manager_factory_for_profile_sync_test.cc
+++ b/sync/internal_api/test/sync_manager_factory_for_profile_sync_test.cc
@@ -9,8 +9,10 @@
namespace syncer {
SyncManagerFactoryForProfileSyncTest::SyncManagerFactoryForProfileSyncTest(
- base::Closure init_callback)
- : init_callback_(init_callback) {
+ base::Closure init_callback,
+ bool set_initial_sync_ended)
+ : init_callback_(init_callback),
+ set_initial_sync_ended_(set_initial_sync_ended) {
}
SyncManagerFactoryForProfileSyncTest::~SyncManagerFactoryForProfileSyncTest() {}
@@ -20,7 +22,8 @@ SyncManagerFactoryForProfileSyncTest::CreateSyncManager(std::string name) {
return scoped_ptr<syncer::SyncManager>(
new SyncManagerForProfileSyncTest(
name,
- init_callback_));
+ init_callback_,
+ set_initial_sync_ended_));
}
} // namespace syncer
diff --git a/sync/internal_api/test/sync_manager_for_profile_sync_test.cc b/sync/internal_api/test/sync_manager_for_profile_sync_test.cc
index e552c2f..aaa6c8d 100644
--- a/sync/internal_api/test/sync_manager_for_profile_sync_test.cc
+++ b/sync/internal_api/test/sync_manager_for_profile_sync_test.cc
@@ -12,9 +12,11 @@ namespace syncer {
SyncManagerForProfileSyncTest::SyncManagerForProfileSyncTest(
std::string name,
- base::Closure init_callback)
+ base::Closure init_callback,
+ bool set_initial_sync_ended)
: SyncManagerImpl(name),
- init_callback_(init_callback) {}
+ init_callback_(init_callback),
+ set_initial_sync_ended_(set_initial_sync_ended) {}
SyncManagerForProfileSyncTest::~SyncManagerForProfileSyncTest() {}
@@ -25,14 +27,18 @@ void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() {
if (!init_callback_.is_null())
init_callback_.Run();
- ModelTypeSet early_download_types;
- early_download_types.PutAll(ControlTypes());
- early_download_types.PutAll(PriorityUserTypes());
- for (ModelTypeSet::Iterator it = early_download_types.First();
- it.Good(); it.Inc()) {
- if (!directory->InitialSyncEndedForType(it.Get())) {
- syncer::TestUserShare::CreateRoot(it.Get(), user_share);
+ if (set_initial_sync_ended_) {
+ ModelTypeSet early_download_types;
+ early_download_types.PutAll(ControlTypes());
+ early_download_types.PutAll(PriorityUserTypes());
+ for (ModelTypeSet::Iterator it = early_download_types.First();
+ it.Good(); it.Inc()) {
+ if (!directory->InitialSyncEndedForType(it.Get())) {
+ syncer::TestUserShare::CreateRoot(it.Get(), user_share);
+ }
}
+ } else {
+ VLOG(2) << "Skipping directory init";
}
SyncManagerImpl::NotifyInitializationSuccess();
diff --git a/sync/internal_api/test/sync_manager_for_profile_sync_test.h b/sync/internal_api/test/sync_manager_for_profile_sync_test.h
index 8493386..c9af22d 100644
--- a/sync/internal_api/test/sync_manager_for_profile_sync_test.h
+++ b/sync/internal_api/test/sync_manager_for_profile_sync_test.h
@@ -19,12 +19,14 @@ class SyncManagerForProfileSyncTest
: public syncer::SyncManagerImpl {
public:
SyncManagerForProfileSyncTest(std::string name,
- base::Closure init_callback);
+ base::Closure init_callback,
+ bool set_initial_sync_ended);
virtual ~SyncManagerForProfileSyncTest();
virtual void NotifyInitializationSuccess() OVERRIDE;
private:
base::Closure init_callback_;
+ bool set_initial_sync_ended_;
};
} // namespace syncer