Commit 55ebc7db authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions] Mark ResultCatcher::GetNextResult() as WARN_UNUSED_RESULT

Callers of ResultCatcher::GetNextResult() should always, always check
the result. Typically, a return value of `false` means that something
went wrong (because it is returned when a test fails), so it should
be explicitly checked. (Note that we don't just assert in the
ResultCatcher itself, because some tests do expect to fail).

Update the one call site that didn't already check the result.

Bug: None
Change-Id: I690b794b0c1ac07cb0a30b5d3078ffdb258195a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1980752Reviewed-by: default avatarDavid Bertoni <dbertoni@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727473}
parent 38db0052
...@@ -111,7 +111,7 @@ IN_PROC_BROWSER_TEST_F(ShellDesktopControllerAuraBrowserTest, TwoAppWindows) { ...@@ -111,7 +111,7 @@ IN_PROC_BROWSER_TEST_F(ShellDesktopControllerAuraBrowserTest, TwoAppWindows) {
browser_context(), app_->id(), browser_context(), app_->id(),
"chrome.app.window.create('/hello.html');")); "chrome.app.window.create('/hello.html');"));
ResultCatcher catcher; ResultCatcher catcher;
catcher.GetNextResult(); ASSERT_TRUE(catcher.GetNextResult());
// Close the first app window. // Close the first app window.
GetAppWindow()->OnNativeClose(); GetAppWindow()->OnNativeClose();
......
...@@ -31,7 +31,7 @@ class ResultCatcher : public content::NotificationObserver { ...@@ -31,7 +31,7 @@ class ResultCatcher : public content::NotificationObserver {
// Pumps the UI loop until a notification is received that an API test // Pumps the UI loop until a notification is received that an API test
// succeeded or failed. Returns true if the test succeeded, false otherwise. // succeeded or failed. Returns true if the test succeeded, false otherwise.
bool GetNextResult(); bool GetNextResult() WARN_UNUSED_RESULT;
void RestrictToBrowserContext(content::BrowserContext* context) { void RestrictToBrowserContext(content::BrowserContext* context) {
browser_context_restriction_ = context; browser_context_restriction_ = context;
......
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