1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/app/chrome_watcher_command_line_win.h"
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "base/process/process_handle.h"
10 #include "base/win/scoped_handle.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 TEST(ChromeWatcherCommandLineTest
, BasicTest
) {
14 base::ProcessHandle current
= nullptr;
15 ASSERT_TRUE(base::OpenProcessHandle(base::GetCurrentProcId(), ¤t
));
16 base::CommandLine cmd_line
=
17 GenerateChromeWatcherCommandLine(base::FilePath(L
"example.exe"), current
);
18 base::win::ScopedHandle result
= InterpretChromeWatcherCommandLine(cmd_line
);
19 ASSERT_EQ(current
, result
.Get());