[base] Support mutable Lambdas in BindLambdaForTesting

This change adds support for mutable lambdas to
base::BindLambdaForTesting. Since a mutable lambda might invalidate its
state after being run once, the returned Callback is a
base::OnceCallback instead of a base::RepeatingCallback.

Bug: 789805
Change-Id: Ie8a1ffe2f8001ca7f75a9e3626638feb11c5c9d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617452
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662083}
3 files changed