Commit a3a87516 authored by Reka Norman's avatar Reka Norman Committed by Commit Bot

[App Management] Fix FakePageHandler

This CL updates the FakePageHandler to use generated Mojo types.

Bug: 906508
Change-Id: Ib04a9118e7ad7de6ac1aa9dfdf2d232c3280034a
Reviewed-on: https://chromium-review.googlesource.com/c/1370232
Commit-Queue: Reka Norman <rekanorman@google.com>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615454}
parent 5acf485f
......@@ -8,20 +8,38 @@ cr.define('app_management', function() {
constructor(page) {
/** @type {appManagement.mojom.PageInterface} */
this.page = page;
/** @type {!Array<appManagement.mojom.App>} */
this.apps_ = [
this.createApp('ahfgeienlihckogmohjhadlkjgocpleb'),
this.createApp(
'aohghmighlieiainnegkcijnfilokake',
{type: apps.mojom.AppType.kArc}),
this.createApp('blpcfgokakmgnkcojhhkbfbldkacnbeo'),
this.createApp('pjkljhegncpnkpknbcohdijeoejaedia'),
this.createApp('aapocclcgogkmnckokdopfmhonfmgoek'),
];
}
getApps() {
const fakeAppIdList = [
'ahfgeienlihckogmohjhadlkjgocpleb',
'aohghmighlieiainnegkcijnfilokake',
'blpcfgokakmgnkcojhhkbfbldkacnbeo',
'pjkljhegncpnkpknbcohdijeoejaedia',
'aapocclcgogkmnckokdopfmhonfmgoek',
'kbfnbcaeplbcioakkpcpgfkobkghlhen',
'gmbgaklkmjakoegficnlkhebmhkjfich',
];
this.page.onAppsAdded(this.apps_);
}
/**
* @param {string} id
* @param {Object=} config
* @return {!appManagement.mojom.App}
*/
createApp(id, config) {
const app = /** @type {!appManagement.mojom.App} */ ({
id: id,
type: apps.mojom.AppType.kUnknown,
title: 'App Title',
});
if (config)
Object.assign(app, config);
this.page.onAppsAdded(fakeAppIdList);
return app;
}
}
......
......@@ -91,8 +91,8 @@
<div id="app-list-title">$i18n{appListTitle}</div>
<template is="dom-repeat" items="[[displayedApps_]]">
<div class="app-list-item">
<img class="app-icon" src="[[iconUrlFromId_(item)]]">
<div class="app-title">[[item]]</div>
<img class="app-icon" src="[[iconUrlFromId_(item.id)]]">
<div class="app-title">[[item.id]]</div>
<img class="subpage-arrow"
src="chrome://resources/images/arrow_right.svg">
</div>
......
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