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

Unified Diff: chrome/browser/first_run/first_run.cc

Issue 12314093: Capture the exit status of the first-run AutoImport and make it available to tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable WaitForImport on Linux Created 7 years, 10 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/first_run/first_run.cc
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 860dcec84748facd93e445d596587f7334191dcc..b2e65b6f8a26930c9417299172e9dfba7123cd3e 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -65,6 +65,11 @@ namespace {
bool should_show_welcome_page_ = false;
bool should_do_autofill_personal_data_manager_first_run_ = false;
+// Flags indicating whether a first-run profile auto import was performed, and
+// whether the importer process exited successfully.
+bool did_perform_profile_import = false;
+bool profile_import_exited_successfully = false;
+
// Helper class that performs delayed first-run tasks that need more of the
// chrome infrastructure to be up and running before they can be attempted.
class FirstRunDelayedTasks : public content::NotificationObserver {
@@ -695,7 +700,9 @@ void AutoImport(
importer::FAVORITES,
items);
- internal::ImportSettings(profile, importer_host, importer_list, items);
+ profile_import_exited_successfully =
+ internal::ImportSettings(profile, importer_host, importer_list, items);
+ DCHECK(profile_import_exited_successfully);
}
content::RecordAction(UserMetricsAction("FirstRunDef_Accept"));
@@ -703,6 +710,7 @@ void AutoImport(
process_singleton->Unlock();
first_run::CreateSentinel();
#endif // !defined(USE_AURA)
+ did_perform_profile_import = true;
}
void DoPostImportTasks(Profile* profile, bool make_chrome_default) {
@@ -735,4 +743,10 @@ void DoPostImportTasks(Profile* profile, bool make_chrome_default) {
internal::DoPostImportPlatformSpecificTasks();
}
+bool DidPerformProfileImport(bool* exited_successfully) {
+ if (exited_successfully)
+ *exited_successfully = profile_import_exited_successfully;
+ return did_perform_profile_import;
+}
+
} // namespace first_run

Powered by Google App Engine
This is Rietveld 408576698