Commit 8f2502b2 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[DevTools] Fix Background Service metadata entry order.

According to https://developers.google.com/protocol-buffers/docs/proto#maps
iteration ordering of map values is undefined. This CL sorts the
metadata entries before in the DevTools frontend so
they can be presented in a consistent order.

Also remove redundant test formatting, fix the OWNERS Background Service
regexp to include the handler, and make the row counting start from 1.

Change-Id: I36024f23fbb307b1160cd67120dcf67ca8697aa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615251
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: default avatarAlexei Filippov <alph@chromium.org>
Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664458}
parent 5d9d0113
caseq@chromium.org caseq@chromium.org
alph@chromium.org alph@chromium.org
per-file *background_services*=rayankans@chromium.org per-file *background_service*=rayankans@chromium.org
# COMPONENT: Platform>DevTools # COMPONENT: Platform>DevTools
...@@ -234,7 +234,7 @@ Resources.BackgroundServiceView = class extends UI.VBox { ...@@ -234,7 +234,7 @@ Resources.BackgroundServiceView = class extends UI.VBox {
swScope = registration.scopeURL.substr(registration.securityOrigin.length); swScope = registration.scopeURL.substr(registration.securityOrigin.length);
return { return {
id: this._dataGrid.rootNode().children.length, id: this._dataGrid.rootNode().children.length + 1,
timestamp: UI.formatTimestamp(serviceEvent.timestamp * 1000, /* full= */ true), timestamp: UI.formatTimestamp(serviceEvent.timestamp * 1000, /* full= */ true),
origin: serviceEvent.origin, origin: serviceEvent.origin,
swScope, swScope,
...@@ -339,7 +339,7 @@ Resources.BackgroundServiceView.EventDataNode = class extends DataGrid.DataGridN ...@@ -339,7 +339,7 @@ Resources.BackgroundServiceView.EventDataNode = class extends DataGrid.DataGridN
super(data); super(data);
/** @const {!Array<!Protocol.BackgroundService.EventMetadata>} */ /** @const {!Array<!Protocol.BackgroundService.EventMetadata>} */
this._eventMetadata = eventMetadata; this._eventMetadata = eventMetadata.sort((m1, m2) => m1.key.compareTo(m2.key));
} }
/** /**
......
...@@ -3,16 +3,16 @@ Tests that the grid shows information as expected. ...@@ -3,16 +3,16 @@ Tests that the grid shows information as expected.
Grid Entries: Grid Entries:
[empty] [empty]
Grid Entries: Grid Entries:
0, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank] 1, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank]
Grid Entries: Grid Entries:
0, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank] 1, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank]
Grid Entries: Grid Entries:
0, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank] 1, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank]
Grid Entries: Grid Entries:
0, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank] 1, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank]
1, 1556889085000, Event2, http://127.0.0.1:8080/, [blank], Instance1, [blank] 2, 1556889085000, Event2, http://127.0.0.1:8080/, [blank], Instance1, [blank]
Grid Entries: Grid Entries:
0, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank] 1, 1556889085000, Event1, http://127.0.0.1:8000/, [blank], Instance1, [blank]
Grid Entries: Grid Entries:
[empty] [empty]
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