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

Side by Side Diff: chrome/app/chrome_watcher_command_line_unittest_win.cc

Issue 868543002: Move OpenProcessHandle to Process::Open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/app/chrome_watcher_command_line_win.h" 5 #include "chrome/app/chrome_watcher_command_line_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 TEST(ChromeWatcherCommandLineTest, BasicTest) { 13 TEST(ChromeWatcherCommandLineTest, BasicTest) {
14 base::ProcessHandle current = nullptr; 14 base::Process current = base::Process::Open(base::GetCurrentProcId());
15 ASSERT_TRUE(base::OpenProcessHandle(base::GetCurrentProcId(), &current)); 15 ASSERT_TRUE(current.IsValid());
16 base::CommandLine cmd_line = 16 base::CommandLine cmd_line =
17 GenerateChromeWatcherCommandLine(base::FilePath(L"example.exe"), current); 17 GenerateChromeWatcherCommandLine(base::FilePath(L"example.exe"),
18 current.Handle());
18 base::win::ScopedHandle result = InterpretChromeWatcherCommandLine(cmd_line); 19 base::win::ScopedHandle result = InterpretChromeWatcherCommandLine(cmd_line);
19 ASSERT_EQ(current, result.Get()); 20 ASSERT_EQ(current.Handle(), result.Get());
20 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698