Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ private void VerifyNotepadMainWindowTitle(Process process, string filename)
string expected = Path.GetFileNameWithoutExtension(filename);

process.WaitForInputIdle(); // Give the file a chance to load
Assert.Equal("notepad", process.ProcessName);
Assert.Equal("notepad", process.ProcessName.ToLower());

// Notepad calls CreateWindowEx with pWindowName of empty string, then calls SetWindowTextW
// with "Untitled - Notepad" then finally if you're opening a file, calls SetWindowTextW
Expand Down
15 changes: 10 additions & 5 deletions src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,16 @@ public void ProcessStart_UseShellExecute_OnWindows_DoesNotThrow(bool isFolder)
{
if (px != null) // sometimes process is null
{
Assert.Equal("notepad", px.ProcessName);

px.Kill();
Assert.True(px.WaitForExit(WaitInMS));
px.WaitForExit(); // wait for event handlers to complete
try
{
Assert.Equal("notepad", px.ProcessName.ToLower());
}
finally
{
px.Kill();
Assert.True(px.WaitForExit(WaitInMS));
px.WaitForExit(); // wait for event handlers to complete
}
}
}
}
Expand Down