Commit 8d3eff59 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Use test assertions in ChildProcessLauncherBrowserTest instead of CHECKs

Per the style guide, we should use proper test assertions to report
failures gracefully.

Bug: None
Change-Id: I84be462364d6f310c08c591785d7f781a92251b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149376Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759052}
parent 49f9f7d5
...@@ -70,7 +70,7 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) { ...@@ -70,7 +70,7 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) {
NavigationEntry* last_entry = NavigationEntry* last_entry =
shell()->web_contents()->GetController().GetLastCommittedEntry(); shell()->web_contents()->GetController().GetLastCommittedEntry();
// Make sure we didn't navigate. // Make sure we didn't navigate.
CHECK(!last_entry); EXPECT_FALSE(last_entry);
// Navigate again and let the process spawn correctly. // Navigate again and let the process spawn correctly.
TestNavigationObserver nav_observer2(window->web_contents(), 1); TestNavigationObserver nav_observer2(window->web_contents(), 1);
...@@ -78,8 +78,9 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) { ...@@ -78,8 +78,9 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) {
nav_observer2.Wait(); nav_observer2.Wait();
last_entry = shell()->web_contents()->GetController().GetLastCommittedEntry(); last_entry = shell()->web_contents()->GetController().GetLastCommittedEntry();
// Make sure that we navigated to the proper URL. // Make sure that we navigated to the proper URL.
CHECK(last_entry && last_entry->GetPageType() == PAGE_TYPE_NORMAL); ASSERT_TRUE(last_entry);
CHECK(shell()->web_contents()->GetLastCommittedURL() == url); EXPECT_EQ(last_entry->GetPageType(), PAGE_TYPE_NORMAL);
EXPECT_EQ(shell()->web_contents()->GetLastCommittedURL(), url);
// Navigate again, using the same renderer. // Navigate again, using the same renderer.
url = GURL("data:text/html,dataurl"); url = GURL("data:text/html,dataurl");
...@@ -88,8 +89,9 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) { ...@@ -88,8 +89,9 @@ IN_PROC_BROWSER_TEST_F(ChildProcessLauncherBrowserTest, ChildSpawnFail) {
nav_observer3.Wait(); nav_observer3.Wait();
last_entry = shell()->web_contents()->GetController().GetLastCommittedEntry(); last_entry = shell()->web_contents()->GetController().GetLastCommittedEntry();
// Make sure that we navigated to the proper URL. // Make sure that we navigated to the proper URL.
CHECK(last_entry && last_entry->GetPageType() == PAGE_TYPE_NORMAL); ASSERT_TRUE(last_entry);
CHECK(shell()->web_contents()->GetLastCommittedURL() == url); EXPECT_EQ(last_entry->GetPageType(), PAGE_TYPE_NORMAL);
EXPECT_EQ(shell()->web_contents()->GetLastCommittedURL(), url);
} }
} // namespace content } // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment