Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: chrome/browser/performance_monitor/performance_monitor_browsertest.cc

Issue 10837003: CPM Refactor and Cleanup (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_startup_times
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/performance_monitor/performance_monitor_browsertest.cc
diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
index e1606cc5bab704d9e41c8c5935061ba867bb8a54..eba3892bddc12d535d175dc25dbc494cf4508856 100644
--- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
+++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
@@ -386,23 +386,18 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest,
std::vector<ExtensionBasicInfo> extension_infos;
// There will be three events in all, each pertaining to the same extension:
// Extension Install
- // Extension Unload
+ // Extension Disable
// Extension Enable
for (int i = 0; i < kNumEvents; ++i)
extension_infos.push_back(ExtensionBasicInfo(extension));
std::vector<int> expected_event_types;
expected_event_types.push_back(EVENT_EXTENSION_INSTALL);
- expected_event_types.push_back(EVENT_EXTENSION_UNLOAD);
+ expected_event_types.push_back(EVENT_EXTENSION_DISABLE);
expected_event_types.push_back(EVENT_EXTENSION_ENABLE);
std::vector<linked_ptr<Event> > events = GetEvents();
CheckExtensionEvents(expected_event_types, events, extension_infos);
-
- // There will be an additional field on the unload event: Unload Reason.
- int unload_reason = -1;
- ASSERT_TRUE(events[1]->data()->GetInteger("unloadReason", &unload_reason));
- ASSERT_EQ(extension_misc::UNLOAD_REASON_DISABLE, unload_reason);
}
// Test that PerformanceMonitor correctly records an extension update event.
@@ -452,31 +447,23 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UpdateExtensionEvent) {
// The total series of events for this process will be:
// Extension Install - install version 1
// Extension Install - install version 2
- // Extension Unload - disable version 1
// Extension Update - signal the udate to version 2
// We push back the corresponding ExtensionBasicInfos.
extension_infos.push_back(ExtensionBasicInfo(extension));
- extension_infos.push_back(extension_infos[0]);
extension_infos.push_back(extension_infos[1]);
std::vector<int> expected_event_types;
expected_event_types.push_back(EVENT_EXTENSION_INSTALL);
expected_event_types.push_back(EVENT_EXTENSION_INSTALL);
- expected_event_types.push_back(EVENT_EXTENSION_UNLOAD);
expected_event_types.push_back(EVENT_EXTENSION_UPDATE);
std::vector<linked_ptr<Event> > events = GetEvents();
CheckExtensionEvents(expected_event_types, events, extension_infos);
-
- // There will be an additional field: The unload reason.
- int unload_reason = -1;
- ASSERT_TRUE(events[2]->data()->GetInteger("unloadReason", &unload_reason));
- ASSERT_EQ(extension_misc::UNLOAD_REASON_UPDATE, unload_reason);
}
IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UninstallExtensionEvent) {
- const int kNumEvents = 3;
+ const int kNumEvents = 2;
FilePath extension_path;
PathService::Get(chrome::DIR_TEST_DATA, &extension_path);
extension_path = extension_path.AppendASCII("performance_monitor")
@@ -485,9 +472,8 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UninstallExtensionEvent) {
const Extension* extension = LoadExtension(extension_path);
std::vector<ExtensionBasicInfo> extension_infos;
- // There will be three events in all, each pertaining to the same extension:
+ // There will be two events, both pertaining to the same extension:
// Extension Install
- // Extension Disable (Unload)
// Extension Uninstall
for (int i = 0; i < kNumEvents; ++i)
extension_infos.push_back(ExtensionBasicInfo(extension));
@@ -496,17 +482,11 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UninstallExtensionEvent) {
std::vector<int> expected_event_types;
expected_event_types.push_back(EVENT_EXTENSION_INSTALL);
- expected_event_types.push_back(EVENT_EXTENSION_UNLOAD);
expected_event_types.push_back(EVENT_EXTENSION_UNINSTALL);
std::vector<linked_ptr<Event> > events = GetEvents();
CheckExtensionEvents(expected_event_types, events, extension_infos);
-
- // There will be an additional field: The unload reason.
- int unload_reason = -1;
- ASSERT_TRUE(events[1]->data()->GetInteger("unloadReason", &unload_reason));
- ASSERT_EQ(extension_misc::UNLOAD_REASON_UNINSTALL, unload_reason);
}
IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, NewVersionEvent) {

Powered by Google App Engine
This is Rietveld 408576698