blob: 95e4e6f6fe483dd6ce4e3f9182d32c0d41d57b1e [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {AutogeneratedThemeColorInfo, ManageProfilesBrowserProxy, ProfileState} from 'chrome://profile-picker/profile_picker.js';
import {TestBrowserProxy} from '../test_browser_proxy.m.js';
/** @implements {ManageProfilesBrowserProxy} */
export class TestManageProfilesBrowserProxy extends TestBrowserProxy {
constructor() {
super([
'initializeMainView',
'launchGuestProfile',
'openManageProfileSettingsSubPage',
'launchSelectedProfile',
'askOnStartupChanged',
'getNewProfileSuggestedThemeInfo',
'getProfileThemeInfo',
'removeProfile',
'getProfileStatistics',
'loadSignInProfileCreationFlow',
'createProfile',
'setProfileName',
'recordSignInPromoImpression',
]);
/** @type {!AutogeneratedThemeColorInfo} */
this.profileThemeInfo = {
colorId: 22,
color: -10799479,
themeFrameColor: 'rgb(70, 42, 104)',
themeShapeColor: 'rgb(109, 65, 161)',
themeFrameTextColor: 'rgb(255, 255, 255)',
themeGenericAvatar: 'AvatarUrl-22'
};
/** @type {!ProfileState} */
this.profileSample = {
profilePath: 'profile1',
localProfileName: 'Work',
needsSignin: false,
isSyncing: true,
gaiaName: 'Alice',
userName: 'Alice@gmail.com',
isManaged: false,
avatarIcon: 'url',
};
}
/** @param {!AutogeneratedThemeColorInfo} profileThemeInfo */
setProfileThemeInfo(profileThemeInfo) {
this.profileThemeInfo = profileThemeInfo;
}
/** @override */
initializeMainView() {
this.methodCalled('initializeMainView');
}
/** @override */
launchGuestProfile() {
this.methodCalled('launchGuestProfile');
}
/** @override */
openManageProfileSettingsSubPage(profilePath) {
this.methodCalled('openManageProfileSettingsSubPage', profilePath);
}
/** @override */
launchSelectedProfile(profilePath) {
this.methodCalled('launchSelectedProfile', profilePath);
}
/** @override */
askOnStartupChanged(shouldShow) {
this.methodCalled('askOnStartupChanged', shouldShow);
}
/** @override */
getNewProfileSuggestedThemeInfo() {
this.methodCalled('getNewProfileSuggestedThemeInfo');
return Promise.resolve(this.profileThemeInfo);
}
/** @override */
getProfileThemeInfo(theme) {
this.methodCalled('getProfileThemeInfo');
return Promise.resolve(this.profileThemeInfo);
}
/** @override */
removeProfile(profilePath) {
this.methodCalled('removeProfile', profilePath);
}
/** @override */
getProfileStatistics(profilePath) {
this.methodCalled('getProfileStatistics', profilePath);
}
/** @override */
loadSignInProfileCreationFlow(profileColor) {
this.methodCalled('loadSignInProfileCreationFlow', profileColor);
}
/** @override */
createProfile(
profileName, profileColor, avatarUrl, isGeneric, createShortcut) {
this.methodCalled(
'createProfile',
[profileName, profileColor, avatarUrl, isGeneric, createShortcut]);
}
/** @override */
setProfileName(profilePath, profileName) {
this.methodCalled('setProfileName', [profilePath, profileName]);
}
/** @override */
recordSignInPromoImpression() {
this.methodCalled('recordSignInPromoImpression');
}
}