| Index: chrome/browser/component_updater/test/component_updater_service_unittest.h
|
| diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.h b/chrome/browser/component_updater/test/component_updater_service_unittest.h
|
| index ba98102137d871c08448c68634ec7dc664b4ac03..573e1a323d26491a3094faa200ad403d04bf909c 100644
|
| --- a/chrome/browser/component_updater/test/component_updater_service_unittest.h
|
| +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.h
|
| @@ -93,6 +93,27 @@ class TestConfigurator : public ComponentUpdateService::Configurator {
|
| ComponentUpdateService* cus_;
|
| };
|
|
|
| +// TestNotificationTracker does not keep a deep copy of the source,
|
| +// so we will need to for testing. The test does not inspect the observations
|
| +// as they occur -- only post mortem. Otherwise, the tester will end up
|
| +// dereferencing an already-deallocated pointer.
|
| +class TestUpdateNotificationTracker : public TestNotificationTracker {
|
| +public:
|
| + TestUpdateNotificationTracker();
|
| + virtual ~TestUpdateNotificationTracker();
|
| +
|
| + std::string SourceAt(size_t num);
|
| +
|
| + virtual void Reset() OVERRIDE;
|
| +
|
| +private:
|
| + virtual void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) OVERRIDE;
|
| +
|
| + std::vector<std::string> sources_;
|
| +};
|
| +
|
| class ComponentUpdaterTest : public testing::Test {
|
| public:
|
| enum TestComponents {
|
| @@ -112,7 +133,7 @@ class ComponentUpdaterTest : public testing::Test {
|
| // Makes the full path to a component updater test file.
|
| const base::FilePath test_file(const char* file);
|
|
|
| - TestNotificationTracker& notification_tracker();
|
| + TestUpdateNotificationTracker& notification_tracker();
|
|
|
| TestConfigurator* test_configurator();
|
|
|
| @@ -124,7 +145,7 @@ class ComponentUpdaterTest : public testing::Test {
|
| private:
|
| scoped_ptr<ComponentUpdateService> component_updater_;
|
| base::FilePath test_data_dir_;
|
| - TestNotificationTracker notification_tracker_;
|
| + TestUpdateNotificationTracker notification_tracker_;
|
| TestConfigurator* test_config_;
|
| };
|
|
|
|
|