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..eb9a53c56ff26cf764312a7362517ba1f4b688d1 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. |
Sorin Jianu
2013/07/03 21:17:32
free'd
perhaps use a different word such as delet
jvoung (off chromium)
2013/07/03 22:51:51
Done.
|
+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_; |
}; |