Commit 3cada461 authored by Toby Huang's avatar Toby Huang Committed by Commit Bot

Add example usage to LoggedInUserMixin class description comments

I added an example usage code snippet to the comments above
LoggedInUserMixin to further clarify how to use this class.

Bug: None
Change-Id: I22e13b93e736c5bc4fe3164815adf0ac49e42ccc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873136Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Commit-Queue: Toby Huang <tobyhuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708052}
parent baebfae2
...@@ -28,6 +28,22 @@ namespace chromeos { ...@@ -28,6 +28,22 @@ namespace chromeos {
// * Pass the inherited embedded_test_server() into the constructor // * Pass the inherited embedded_test_server() into the constructor
// as well. // as well.
// * Call LogInUser() or SetUpOnMainThreadHelper() to log in. // * Call LogInUser() or SetUpOnMainThreadHelper() to log in.
// Example:
/*
class MyBrowserTestClass : public MixinBasedInProcessBrowserTest {
protected:
void SetUpOnMainThread() override {
MixinBasedInProcessBrowserTest::SetUpOnMainThread();
// The call below logs in as child user.
logged_in_user_mixin_.SetUpOnMainThreadHelper(host_resolver(), this);
}
private:
LoggedInUserMixin logged_in_user_mixin_{&mixin_host_,
LoggedInUserMixin::LogInType::kChild,
embedded_test_server()};
};
*/
class LoggedInUserMixin { class LoggedInUserMixin {
public: public:
enum class LogInType { kRegular, kChild }; enum class LogInType { kRegular, kChild };
......
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