Chromium Code Reviews| Index: chrome/app/chrome_watcher_command_line_unittest_win.cc |
| diff --git a/chrome/app/chrome_watcher_command_line_unittest_win.cc b/chrome/app/chrome_watcher_command_line_unittest_win.cc |
| index 0cf692734b12b35b39860b5fda982bd84a64342f..0e6095390e129e4bd8139ec688063aa8c02abf83 100644 |
| --- a/chrome/app/chrome_watcher_command_line_unittest_win.cc |
| +++ b/chrome/app/chrome_watcher_command_line_unittest_win.cc |
| @@ -4,6 +4,8 @@ |
| #include "chrome/app/chrome_watcher_command_line_win.h" |
| +#include <windows.h> |
| + |
| #include "base/command_line.h" |
| #include "base/files/file_path.h" |
| #include "base/process/process_handle.h" |
| @@ -13,8 +15,15 @@ |
| TEST(ChromeWatcherCommandLineTest, BasicTest) { |
| base::ProcessHandle current = nullptr; |
|
grt (UTC plus 2)
2015/02/04 03:04:48
// Ownership of these handles is passed to the Sco
erikwright (departed)
2015/02/04 04:19:18
Done.
|
| ASSERT_TRUE(base::OpenProcessHandle(base::GetCurrentProcId(), ¤t)); |
| - base::CommandLine cmd_line = |
| - GenerateChromeWatcherCommandLine(base::FilePath(L"example.exe"), current); |
| - base::win::ScopedHandle result = InterpretChromeWatcherCommandLine(cmd_line); |
| - ASSERT_EQ(current, result.Get()); |
| + HANDLE event = ::CreateEvent(nullptr, FALSE, FALSE, nullptr); |
| + |
| + base::CommandLine cmd_line = GenerateChromeWatcherCommandLine( |
| + base::FilePath(L"example.exe"), event, current); |
| + |
| + base::win::ScopedHandle current_result; |
| + base::win::ScopedHandle event_result; |
| + ASSERT_TRUE(InterpretChromeWatcherCommandLine(cmd_line, &event_result, |
| + ¤t_result)); |
| + ASSERT_EQ(current, current_result.Get()); |
| + ASSERT_EQ(event, event_result.Get()); |
| } |