Commit 04f5901b authored by James Cook's avatar James Cook Committed by Commit Bot

Add tests for Management API for supervised user extension install

Test that if a child account attempts to enable an extension then the
parent permission dialog opens.

This is a unit test because there are existing browser tests that
exercise the JS/C++ communication for the management API.

Bug: 1059999
Test: added to unit_tests

Change-Id: I7604d4805f23637a3eb862b1b3a5874f7fcbbb4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129032
Commit-Queue: James Cook <jamescook@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarDan S <danan@chromium.org>
Auto-Submit: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756042}
parent 2817e5c8
...@@ -331,6 +331,14 @@ class ManagementAPI : public BrowserContextKeyedAPI, ...@@ -331,6 +331,14 @@ class ManagementAPI : public BrowserContextKeyedAPI,
return supervised_user_service_delegate_.get(); return supervised_user_service_delegate_.get();
} }
void set_delegate_for_test(std::unique_ptr<ManagementAPIDelegate> delegate) {
delegate_ = std::move(delegate);
}
void set_supervised_user_service_delegate_for_test(
std::unique_ptr<SupervisedUserServiceDelegate> delegate) {
supervised_user_service_delegate_ = std::move(delegate);
}
private: private:
friend class BrowserContextKeyedAPIFactory<ManagementAPI>; friend class BrowserContextKeyedAPIFactory<ManagementAPI>;
......
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