diff options
-rw-r--r-- | base/base.gyp | 2 | ||||
-rw-r--r-- | base/test/signaling_task.cc (renamed from chrome/test/base/signaling_task.cc) | 6 | ||||
-rw-r--r-- | base/test/signaling_task.h (renamed from chrome/test/base/signaling_task.h) | 11 | ||||
-rw-r--r-- | chrome/browser/extensions/test_extension_prefs.cc | 4 | ||||
-rw-r--r-- | chrome/browser/net/gaia/token_service_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/net/gaia/token_service_unittest.h | 1 | ||||
-rw-r--r-- | chrome/browser/password_manager/password_store_default_unittest.cc | 20 | ||||
-rw-r--r-- | chrome/browser/password_manager/password_store_win_unittest.cc | 14 | ||||
-rw-r--r-- | chrome/browser/password_manager/password_store_x_unittest.cc | 24 | ||||
-rw-r--r-- | chrome/browser/sync/signin_manager_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 2 |
11 files changed, 48 insertions, 41 deletions
diff --git a/base/base.gyp b/base/base.gyp index f60f943..4cabea5 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -379,6 +379,8 @@ 'test/perf_test_suite.h', 'test/scoped_locale.cc', 'test/scoped_locale.h', + 'test/signaling_task.cc', + 'test/signaling_task.h', 'test/test_file_util.h', 'test/test_file_util_linux.cc', 'test/test_file_util_mac.cc', diff --git a/chrome/test/base/signaling_task.cc b/base/test/signaling_task.cc index b4fa680..02fffb4 100644 --- a/chrome/test/base/signaling_task.cc +++ b/base/test/signaling_task.cc @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/test/base/signaling_task.h" +#include "base/test/signaling_task.h" #include "base/synchronization/waitable_event.h" +namespace base { + SignalingTask::SignalingTask(base::WaitableEvent* event) : event_(event) { } @@ -14,3 +16,5 @@ SignalingTask::~SignalingTask() {} void SignalingTask::Run() { event_->Signal(); } + +} // namespace base diff --git a/chrome/test/base/signaling_task.h b/base/test/signaling_task.h index 6264826..5e64bf8d 100644 --- a/chrome/test/base/signaling_task.h +++ b/base/test/signaling_task.h @@ -4,15 +4,15 @@ // A simple callback that you can use to wait for events on a thread. -#ifndef CHROME_TEST_BASE_SIGNALING_TASK_H_ -#define CHROME_TEST_BASE_SIGNALING_TASK_H_ +#ifndef BASE_TEST_SIGNALING_TASK_H_ +#define BASE_TEST_SIGNALING_TASK_H_ #pragma once #include "base/task.h" namespace base { + class WaitableEvent; -} class SignalingTask : public Task { public: @@ -23,6 +23,9 @@ class SignalingTask : public Task { private: base::WaitableEvent* event_; + DISALLOW_COPY_AND_ASSIGN(SignalingTask); }; -#endif // CHROME_TEST_BASE_SIGNALING_TASK_H_ +} // namespace base + +#endif // BASE_TEST_SIGNALING_TASK_H_ diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc index f6ddc0f..a95be59 100644 --- a/chrome/browser/extensions/test_extension_prefs.cc +++ b/chrome/browser/extensions/test_extension_prefs.cc @@ -9,6 +9,7 @@ #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/synchronization/waitable_event.h" +#include "base/test/signaling_task.h" #include "base/values.h" #include "chrome/browser/extensions/extension_pref_store.h" #include "chrome/browser/extensions/extension_pref_value_map.h" @@ -19,7 +20,6 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/json_pref_store.h" -#include "chrome/test/base/signaling_task.h" #include "content/public/browser/browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -74,7 +74,7 @@ void TestExtensionPrefs::RecreateExtensionPrefs() { base::WaitableEvent io_finished(false, false); pref_service_->SavePersistentPrefs(); EXPECT_TRUE(BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, - new SignalingTask(&io_finished))); + new base::SignalingTask(&io_finished))); // If the FILE thread is in fact the current thread (possible in testing // scenarios), we have to ensure the task has a chance to run. If the FILE diff --git a/chrome/browser/net/gaia/token_service_unittest.cc b/chrome/browser/net/gaia/token_service_unittest.cc index 4dc88c3..163d86a 100644 --- a/chrome/browser/net/gaia/token_service_unittest.cc +++ b/chrome/browser/net/gaia/token_service_unittest.cc @@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/synchronization/waitable_event.h" +#include "base/test/signaling_task.h" #include "chrome/browser/password_manager/encryptor.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -96,7 +97,7 @@ void TokenServiceTestHarness::WaitForDBLoadCompletion() { // operations should be complete. base::WaitableEvent done(false, false); BrowserThread::PostTask( - BrowserThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::DB, FROM_HERE, new base::SignalingTask(&done)); done.Wait(); // Notifications should be returned from the DB thread onto the UI thread. diff --git a/chrome/browser/net/gaia/token_service_unittest.h b/chrome/browser/net/gaia/token_service_unittest.h index fd3802b..87fbee7 100644 --- a/chrome/browser/net/gaia/token_service_unittest.h +++ b/chrome/browser/net/gaia/token_service_unittest.h @@ -12,7 +12,6 @@ #include "chrome/browser/net/gaia/token_service.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/net/gaia/gaia_auth_consumer.h" -#include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index ee3f832..006cb70 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -7,6 +7,7 @@ #include "base/stl_util.h" #include "base/string_util.h" #include "base/synchronization/waitable_event.h" +#include "base/test/signaling_task.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_form_data.h" @@ -17,7 +18,6 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" -#include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_registrar.h" @@ -191,7 +191,7 @@ TEST_F(PasswordStoreDefaultTest, NonASCIIData) { // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); MockPasswordStoreConsumer consumer; @@ -286,7 +286,7 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -302,7 +302,7 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -347,7 +347,7 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -361,7 +361,7 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -399,7 +399,7 @@ TEST_F(PasswordStoreDefaultTest, MigrationAlreadyDone) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Pretend that the migration has already taken place. @@ -479,7 +479,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Change the password. @@ -501,7 +501,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { // Wait for PasswordStore to send the notification. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); const PasswordStoreChange expected_delete_changes[] = { @@ -520,7 +520,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { // Wait for PasswordStore to send the notification. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); store->Shutdown(); diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index 3881bff..b5192c3 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -12,6 +12,7 @@ #include "base/scoped_temp_dir.h" #include "base/stl_util.h" #include "base/synchronization/waitable_event.h" +#include "base/test/signaling_task.h" #include "base/time.h" #include "chrome/browser/password_manager/ie7_password.h" #include "chrome/browser/password_manager/password_form_data.h" @@ -20,7 +21,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/pref_names.h" -#include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_profile.h" #include "content/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" @@ -166,7 +166,7 @@ TEST_F(PasswordStoreWinTest, DISABLED_ConvertIE7Login) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -278,7 +278,7 @@ TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -434,7 +434,7 @@ TEST_F(PasswordStoreWinTest, Migration) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -449,7 +449,7 @@ TEST_F(PasswordStoreWinTest, Migration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -494,7 +494,7 @@ TEST_F(PasswordStoreWinTest, Migration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -508,7 +508,7 @@ TEST_F(PasswordStoreWinTest, Migration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index a2df5ea..7bce400 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -11,6 +11,7 @@ #include "base/string_util.h" #include "base/stringprintf.h" #include "base/synchronization/waitable_event.h" +#include "base/test/signaling_task.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_form_data.h" @@ -21,7 +22,6 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" -#include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_details.h" @@ -360,7 +360,7 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -378,7 +378,7 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -423,7 +423,7 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -437,7 +437,7 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // Wait for the WDS methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -480,7 +480,7 @@ TEST_P(PasswordStoreXTest, WDSMigrationAlreadyDone) { // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Pretend that the migration has already taken place. @@ -565,7 +565,7 @@ TEST_P(PasswordStoreXTest, Notifications) { // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Change the password. @@ -587,7 +587,7 @@ TEST_P(PasswordStoreXTest, Notifications) { // Wait for PasswordStore to send the notification. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); const PasswordStoreChange expected_delete_changes[] = { @@ -606,7 +606,7 @@ TEST_P(PasswordStoreXTest, Notifications) { // Wait for PasswordStore to send the notification. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Public in PasswordStore, protected in PasswordStoreX. @@ -648,7 +648,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // carry on with the test. WaitableEvent done(false, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); // Get the new size of the login DB file. We expect it to be larger. @@ -713,7 +713,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // Wait for the login DB methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); if (GetParam() == WORKING_BACKEND) { @@ -733,7 +733,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // Wait for the login DB methods to execute on the DB thread. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - new SignalingTask(&done)); + new base::SignalingTask(&done)); done.Wait(); if (GetParam() == WORKING_BACKEND) { diff --git a/chrome/browser/sync/signin_manager_unittest.cc b/chrome/browser/sync/signin_manager_unittest.cc index 239c4aa..2ecad6e 100644 --- a/chrome/browser/sync/signin_manager_unittest.cc +++ b/chrome/browser/sync/signin_manager_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sync/signin_manager.h" +#include "base/test/signaling_task.h" #include "chrome/browser/net/gaia/token_service.h" #include "chrome/browser/net/gaia/token_service_unittest.h" #include "chrome/browser/password_manager/encryptor.h" @@ -11,7 +12,6 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/net/gaia/gaia_urls.h" -#include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_profile.h" #include "content/test/test_url_fetcher_factory.h" #include "net/url_request/url_request.h" diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index a726d00..ec435cb 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -196,8 +196,6 @@ 'test/base/model_test_utils.h', 'test/base/profile_mock.cc', 'test/base/profile_mock.h', - 'test/base/signaling_task.cc', - 'test/base/signaling_task.h', 'test/base/test_browser_window.cc', 'test/base/test_browser_window.h', 'test/base/test_html_dialog_observer.cc', |