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

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

Issue 11275069: Perform install tasks for newly installed or upgraded component apps/extensions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase and move v2 component app added in r169911 (and r170087) into background section in componen… Created 8 years, 1 month 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 d5b3a353b5b072ece250f94ab7b62a3578d75b74..07573c0cc7574287104c29510b73518e81035f57 100644
--- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
+++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
@@ -674,16 +674,26 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorUncleanExitBrowserTest,
performance_monitor()->CheckForUncleanExits();
content::RunAllPendingInMessageLoop();
- // Load the second profile, which has also exited uncleanly.
+ // Load the second profile, which has also exited uncleanly. Note that since
+ // the second profile is new, component extensions will be installed as part
+ // of the browser startup for that profile, generating extra events.
g_browser_process->profile_manager()->GetProfile(second_profile_path);
content::RunAllPendingInMessageLoop();
Database::EventVector events = GetEvents();
- const size_t kNumEvents = 2;
- ASSERT_EQ(kNumEvents, events.size());
- CheckEventType(EVENT_UNCLEAN_EXIT, events[0]);
- CheckEventType(EVENT_UNCLEAN_EXIT, events[1]);
+ const size_t kNumUncleanExitEvents = 2;
+ size_t num_unclean_exit_events = 0;
+ for (size_t i = 0; i < events.size(); ++i) {
+ int event_type = -1;
+ if (events[i]->data()->GetInteger("eventType", &event_type) &&
+ event_type == EVENT_EXTENSION_INSTALL) {
+ continue;
+ }
+ CheckEventType(EVENT_UNCLEAN_EXIT, events[i]);
+ ++num_unclean_exit_events;
+ }
+ ASSERT_EQ(kNumUncleanExitEvents, num_unclean_exit_events);
std::string event_profile;
ASSERT_TRUE(events[0]->data()->GetString("profileName", &event_profile));

Powered by Google App Engine
This is Rietveld 408576698