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

Unified Diff: chrome/test/base/chrome_test_launcher.cc

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 431863 Created 4 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/test/base/chrome_test_launcher.cc
diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc
index f9509ee41ee45f8f2cb80d23ab8dea7c3dd25501..a66e931fc313c4da0c14fe576f1175cff801e953 100644
--- a/chrome/test/base/chrome_test_launcher.cc
+++ b/chrome/test/base/chrome_test_launcher.cc
@@ -4,6 +4,9 @@
#include "chrome/test/base/chrome_test_launcher.h"
+#include <memory>
+#include <utility>
+
#include "base/command_line.h"
#include "base/debug/leak_annotations.h"
#include "base/files/file_path.h"
@@ -11,6 +14,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/process/process_metrics.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
@@ -19,6 +23,8 @@
#include "chrome/app/chrome_main_delegate.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/install_static/install_details.h"
+#include "chrome/install_static/install_modes.h"
#include "chrome/test/base/chrome_test_suite.h"
#include "components/crash/content/app/crashpad.h"
#include "content/public/app/content_main.h"
@@ -103,6 +109,16 @@ int LaunchChromeTests(int default_jobs,
chrome_browser_application_mac::RegisterBrowserCrApp();
#endif
+#if defined(OS_WIN)
+ // Create a primordial InstallDetails instance for the test.
+ std::unique_ptr<install_static::PrimaryInstallDetails> install_details =
+ base::MakeUnique<install_static::PrimaryInstallDetails>();
+ install_details->set_mode(&install_static::kInstallModes[0]);
+ install_details->set_channel(
+ install_static::kInstallModes[0].default_channel_name);
+ install_static::InstallDetails::SetForProcess(std::move(install_details));
+#endif
+
#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WIN)
// We leak this pointer intentionally. The crash client needs to outlive
// all other code.

Powered by Google App Engine
This is Rietveld 408576698