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

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

Issue 1538923004: [win] Change Chrome Watcher configuration API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix outdated comment. Created 4 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
« no previous file with comments | « no previous file | chrome/app/chrome_watcher_command_line_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "chrome/app/chrome_watcher_command_line_win.h"
6
7 #include <windows.h>
8
9 #include "base/command_line.h"
10 #include "base/files/file_path.h"
11 #include "base/process/process_handle.h"
12 #include "base/win/scoped_handle.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14
15 TEST(ChromeWatcherCommandLineTest, BasicTest) {
16 // Ownership of these handles is passed to the ScopedHandles below via
17 // InterpretChromeWatcherCommandLine().
18 base::ProcessHandle current =
19 ::OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE,
20 TRUE, // Inheritable
21 ::GetCurrentProcessId());
22 ASSERT_NE(nullptr, current);
23
24 HANDLE event = ::CreateEvent(nullptr, FALSE, FALSE, nullptr);
25 ASSERT_NE(nullptr, event);
26 DWORD current_thread_id = ::GetCurrentThreadId();
27 base::CommandLine cmd_line = GenerateChromeWatcherCommandLine(
28 base::FilePath(L"example.exe"), current, current_thread_id, event);
29
30 base::win::ScopedHandle current_result;
31 DWORD current_thread_id_result = 0;
32 base::win::ScopedHandle event_result;
33 ASSERT_TRUE(InterpretChromeWatcherCommandLine(
34 cmd_line, &current_result, &current_thread_id_result, &event_result));
35 ASSERT_EQ(current, current_result.Get());
36 ASSERT_EQ(current_thread_id, current_thread_id_result);
37 ASSERT_EQ(event, event_result.Get());
38 }
OLDNEW
« no previous file with comments | « no previous file | chrome/app/chrome_watcher_command_line_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698