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 4d7cd184d404146a5b9d4477ab3ef92adc0ff682..13ecc98fffacdd88fa9edae747af6986dd55fdce 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-free'd pointer. |
+class TestUpdateNotificationTracker : public TestNotificationTracker { |
+public: |
+ TestUpdateNotificationTracker(); |
+ virtual ~TestUpdateNotificationTracker(); |
+ |
+ ComponentUpdateService::UpdateSource 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<ComponentUpdateService::UpdateSource> 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_; |
}; |