Skip to content

Commit

Permalink
Get updater_unittests to build with std::u16string.
Browse files Browse the repository at this point in the history
Bug: 911896
Change-Id: I0f1218e2ee7412cb7f87b70e23d1eff8c9e96ee2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2693855
Reviewed-by: Joshua Pawlicki <[email protected]>
Commit-Queue: Peter Kasting <[email protected]>
Cr-Commit-Position: refs/heads/master@{#854283}
  • Loading branch information
pkasting authored and Chromium LUCI CQ committed Feb 16, 2021
1 parent 51aa487 commit 7420c01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions chrome/updater/win/task_scheduler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ TEST_F(TaskSchedulerTests, RunAProgramNow) {

// Create a unique name for a shared event to be waited for in this process
// and signaled in the test process to confirm it was scheduled and ran.
const base::string16 event_name =
const std::wstring event_name =
base::StrCat({kTestProcessExecutableName, L"-",
base::NumberToString16(::GetCurrentProcessId())});
base::NumberToWString(::GetCurrentProcessId())});
base::WaitableEvent event(base::win::ScopedHandle(
::CreateEvent(nullptr, FALSE, FALSE, event_name.c_str())));
ASSERT_NE(event.handle(), nullptr);
Expand Down Expand Up @@ -206,7 +206,7 @@ TEST_F(TaskSchedulerTests, GetTaskNameList) {
TaskScheduler::TRIGGER_TYPE_HOURLY, false));
EXPECT_TRUE(task_scheduler_->IsTaskRegistered(kTaskName2));

std::vector<base::string16> task_names;
std::vector<std::wstring> task_names;
EXPECT_TRUE(task_scheduler_->GetTaskNameList(&task_names));
EXPECT_TRUE(base::Contains(task_names, kTaskName1));
EXPECT_TRUE(base::Contains(task_names, kTaskName2));
Expand All @@ -227,7 +227,7 @@ TEST_F(TaskSchedulerTests, GetTasksIncludesHidden) {

EXPECT_TRUE(task_scheduler_->IsTaskRegistered(kTaskName1));

std::vector<base::string16> task_names;
std::vector<std::wstring> task_names;
EXPECT_TRUE(task_scheduler_->GetTaskNameList(&task_names));
EXPECT_TRUE(base::Contains(task_names, kTaskName1));

Expand Down
4 changes: 2 additions & 2 deletions chrome/updater/win/test/test_executables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace updater {

// If you add another test executable here, also add it to the data_deps in
// the "test_executables" target of updater/win/test/BUILD.gn.
const base::char16 kTestProcessExecutableName[] = L"updater_test_process.exe";
const wchar_t kTestProcessExecutableName[] = L"updater_test_process.exe";

base::Process LongRunningProcess(base::CommandLine* cmd) {
base::FilePath exe_dir;
Expand All @@ -43,7 +43,7 @@ base::Process LongRunningProcess(base::CommandLine* cmd) {
base::WaitableEvent::InitialState::NOT_SIGNALED);
command_line.AppendSwitchNative(
updater::kInitDoneNotifierSwitch,
base::NumberToString16(
base::NumberToWString(
base::win::HandleToUint32(init_done_event->handle())));

if (cmd)
Expand Down
4 changes: 2 additions & 2 deletions chrome/updater/win/test/test_executables.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class CommandLine;
namespace updater {

// The name of the service executable used for tests.
extern const base::char16 kTestServiceExecutableName[];
extern const wchar_t kTestServiceExecutableName[];

// The name of the executable used for tests.
extern const base::char16 kTestProcessExecutableName[];
extern const wchar_t kTestProcessExecutableName[];

// Creates a process that will run for a minute, which is long enough to be
// killed by a reasonably fast unit or integration test.
Expand Down
2 changes: 1 addition & 1 deletion chrome/updater/win/test/test_process_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main(int, char**) {
if (command_line->HasSwitch(updater::kTestEventToSignal)) {
VLOG(1) << "Process is signaling event '" << updater::kTestEventToSignal
<< "'";
base::string16 event_name =
std::wstring event_name =
command_line->GetSwitchValueNative(updater::kTestEventToSignal);
base::win::ScopedHandle handle(
::OpenEvent(EVENT_ALL_ACCESS, TRUE, event_name.c_str()));
Expand Down

0 comments on commit 7420c01

Please sign in to comment.