Skip to content

Commit

Permalink
[dPWA] Refactoring relative manifest id to absolute id.
Browse files Browse the repository at this point in the history
This patch refactors the manifest parser & id handling to use the
computed manifest_id defined in the spec, which simplifies a lot of
code. This patch:
- Makes changes to the ManifestParser to output the id as a full url.
- Always populates the manifest_id web app representations.
- Fixes a variety of tests, including some small mistakes in the sub app
  tests that are hopefully minor.
- Adds a number of checks to ensure that things are created correctly.
- Updates the web_app_helper methods appropriately.

This change should have no functional impact.

Bug: 1231765,1442799,b/280606515
Change-Id: I6d69e2d94af9278d796df4efb3e275416e4ad59e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4515997
Reviewed-by: Dibyajyoti Pal <[email protected]>
Reviewed-by: Maksim Moskvitin <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Commit-Queue: Daniel Murphy <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1144248}
  • Loading branch information
dmurph authored and chromium-wpt-export-bot committed May 15, 2023
1 parent 3d7f60f commit cb1e542
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions subapps/add-error.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
};

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.FAILURE },
{ "unhashedAppIdPath": url_2, "resultCode": Status.FAILURE }
{ "manifestIdPath": url_1, "resultCode": Status.FAILURE },
{ "manifestIdPath": url_2, "resultCode": Status.FAILURE }
];

let expected_results = {
Expand All @@ -106,8 +106,8 @@
};

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_2, "resultCode": Status.FAILURE }
{ "manifestIdPath": url_1, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_2, "resultCode": Status.FAILURE }
];

let expected_results = {
Expand Down
6 changes: 3 additions & 3 deletions subapps/add-success.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
};

let mocked_response = [
{ "unhashedAppIdPath": install_url, "resultCode": Status.SUCCESS }
{ "manifestIdPath": install_url, "resultCode": Status.SUCCESS }
];

let expected_results = {
Expand All @@ -38,8 +38,8 @@
};

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_2, "resultCode": Status.SUCCESS }
{ "manifestIdPath": url_1, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_2, "resultCode": Status.SUCCESS }
];

let expected_results = {
Expand Down
4 changes: 2 additions & 2 deletions subapps/list-success.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
const url_2 = '/sub-app-2';

const mocked_response = [
{ "unhashedAppIdPath": url_1, "appName": "App 1" },
{ "unhashedAppIdPath": url_2, "appName": "App 2" },
{ "manifestIdPath": url_1, "appName": "App 1" },
{ "manifestIdPath": url_2, "appName": "App 2" },
];

let expected_results = {
Expand Down
12 changes: 6 additions & 6 deletions subapps/remove-error.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
let remove_call_params = [url_1, url_2, url_3];

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.FAILURE },
{ "unhashedAppIdPath": url_2, "resultCode": Status.FAILURE },
{ "unhashedAppIdPath": url_3, "resultCode": Status.FAILURE }
{ "manifestIdPath": url_1, "resultCode": Status.FAILURE },
{ "manifestIdPath": url_2, "resultCode": Status.FAILURE },
{ "manifestIdPath": url_3, "resultCode": Status.FAILURE }
];

let expected_results = {
Expand All @@ -70,9 +70,9 @@
let remove_call_params = [url_1, url_2, url_3];

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_2, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_3, "resultCode": Status.FAILURE }
{ "manifestIdPath": url_1, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_2, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_3, "resultCode": Status.FAILURE }
];

let expected_results = {
Expand Down
8 changes: 4 additions & 4 deletions subapps/remove-success.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const url = '/sub-app';
let remove_call_params = [url];
let mocked_response = [{ "unhashedAppIdPath": url, "resultCode": Status.SUCCESS }];
let mocked_response = [{ "manifestIdPath": url, "resultCode": Status.SUCCESS }];
let expected_results = {[url]: "success"};

await subapps_remove_expect_success_with_result(t, remove_call_params, mocked_response, expected_results);
Expand All @@ -24,9 +24,9 @@
let remove_call_params = [url_1, url_2, url_3];

let mocked_response = [
{ "unhashedAppIdPath": url_1, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_2, "resultCode": Status.SUCCESS },
{ "unhashedAppIdPath": url_3, "resultCode": Status.SUCCESS }
{ "manifestIdPath": url_1, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_2, "resultCode": Status.SUCCESS },
{ "manifestIdPath": url_3, "resultCode": Status.SUCCESS }
];

let expected_results = {
Expand Down

0 comments on commit cb1e542

Please sign in to comment.