diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 20:18:17 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 20:18:17 +0000 |
commit | 403b4053ba97a92194f0a76d0f105bca3313bb11 (patch) | |
tree | 5c61b5d7759ee3948b358d74c051b275678b53e9 /chrome/test/ui_test_utils.cc | |
parent | 9b5fe303ff7f97595594e1dec04ce5b96610c748 (diff) | |
download | chromium_src-403b4053ba97a92194f0a76d0f105bca3313bb11.zip chromium_src-403b4053ba97a92194f0a76d0f105bca3313bb11.tar.gz chromium_src-403b4053ba97a92194f0a76d0f105bca3313bb11.tar.bz2 |
Refactoring the sync integration tests.
The sync integration tests were written over a 2 year period, and were designed at a time when bookmarks were the only data-type being synced. Since then, they have mushroomed and resulted in significant duplication of code and non-uniformity in coding style.
This changelist is the first step towards reorganizing the integration tests for all sync data types into a levelized class hierarchy, where there is a class containing all the data and functionality required to test each data-type. This should make adding tests for new data-types significantly easier.
BUG=46052,43917
TEST=sync_integration_tests
Review URL: http://codereview.chromium.org/2863008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50376 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui_test_utils.cc')
-rw-r--r-- | chrome/test/ui_test_utils.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index b564c9f..f9f2d04 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -28,6 +28,7 @@ #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" #include "chrome/test/automation/javascript_execution_controller.h" +#include "chrome/test/bookmark_load_observer.h" #if defined(TOOLKIT_VIEWS) #include "views/focus/accelerator_handler.h" #endif @@ -539,6 +540,16 @@ void RegisterAndWait(NotificationObserver* observer, RunMessageLoop(); } +void WaitForBookmarkModelToLoad(BookmarkModel* model) { + if (model->IsLoaded()) + return; + BookmarkLoadObserver observer; + model->AddObserver(&observer); + RunMessageLoop(); + model->RemoveObserver(&observer); + ASSERT_TRUE(model->IsLoaded()); +} + TimedMessageLoopRunner::TimedMessageLoopRunner() : loop_(new MessageLoopForUI()), owned_(true), |