Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Unified Diff: tracing/tracing/ui/side_panel/side_panel_container_test.html

Issue 3001613002: Fix trace-viewer's side-panel-container's tab-strip. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/ui/side_panel/side_panel_container.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/side_panel/side_panel_container_test.html
diff --git a/tracing/tracing/ui/side_panel/side_panel_container_test.html b/tracing/tracing/ui/side_panel/side_panel_container_test.html
index bfad7ee5a37961298d0c7d4d049b3b67d3449e4d..a51be6204269df68af04b38ef6ada771d7b8b888 100644
--- a/tracing/tracing/ui/side_panel/side_panel_container_test.html
+++ b/tracing/tracing/ui/side_panel/side_panel_container_test.html
@@ -8,9 +8,13 @@ found in the LICENSE file.
<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/model/event_set.html">
<link rel="import" href="/tracing/model/model.html">
+<link rel="import" href="/tracing/ui/base/deep_utils.html">
<link rel="import" href="/tracing/ui/side_panel/side_panel.html">
<link rel="import" href="/tracing/ui/side_panel/side_panel_container.html">
+<dom-module id="tr-ui-sp-disabled-side-panel"></dom-module>
+<dom-module id="tr-ui-sp-enabled-side-panel"></dom-module>
+
<script>
'use strict';
@@ -45,6 +49,36 @@ tr.b.unittest.testSuite(function() {
return m;
}
+ Polymer({
+ is: 'tr-ui-sp-disabled-test-panel',
+ behaviors: [tr.ui.behaviors.SidePanel],
+ supportsModel(m) {
+ return {supported: false};
+ },
+ get textLabel() {
+ return 'Disabled';
+ }
+ });
+
+ tr.ui.side_panel.SidePanelRegistry.register(function disabled() {
+ return document.createElement('tr-ui-sp-disabled-test-panel');
+ });
+
+ Polymer({
+ is: 'tr-ui-sp-enabled-test-panel',
+ behaviors: [tr.ui.behaviors.SidePanel],
+ supportsModel(m) {
+ return {supported: true};
+ },
+ get textLabel() {
+ return 'Enabled';
+ },
+ });
+
+ tr.ui.side_panel.SidePanelRegistry.register(function enabled() {
+ return document.createElement('tr-ui-sp-enabled-test-panel');
+ });
+
test('instantiateCollapsed', function() {
const brushingStateController = new FakeBrushingStateController();
brushingStateController.model = createModel();
@@ -52,6 +86,13 @@ tr.b.unittest.testSuite(function() {
const container = document.createElement('tr-ui-side-panel-container');
container.brushingStateController = brushingStateController;
this.addHTMLOutput(container);
+
+ // The Enabled tab should appear first in the tab strip even though the
+ // disabled side panel was registered first.
+ // There may be other side panels.
+ const labels = tr.ui.b.findDeepElementsMatching(container,
+ 'TAB-STRIP-LABEL').map(e => e.textContent);
+ assert.isBelow(labels.indexOf('Enabled'), labels.indexOf('Disabled'));
});
});
</script>
« no previous file with comments | « tracing/tracing/ui/side_panel/side_panel_container.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698