Commit 5be40566 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

CrOS FileManager UMA ClickBreadCrumbs

Added ClickBreadcrumbs user action for click in breadcrumb.

Fixed handling of MockFileSystem root to always include trailing slash.
The root dir is referenced in the breadcrumb and causes errors
in tests  with inconsistency of trailing slash.



Bug: 824607
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I5ff72f4d2542c25f87fd495bdb088d0d3315424f
Reviewed-on: https://chromium-review.googlesource.com/977381
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarSasha Morrissey <sashab@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545740}
parent ebabf635
...@@ -5003,6 +5003,13 @@ should be able to be added at any place in this file. ...@@ -5003,6 +5003,13 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="FileBrowser.ClickBreadcrumbs">
<owner>joelhockey@chromium.org</owner>
<description>
User clicked the breadcrumbs in order to return to a parent directory.
</description>
</action>
<action name="FileBrowser.CreateNewFolder"> <action name="FileBrowser.CreateNewFolder">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
......
...@@ -268,6 +268,7 @@ ...@@ -268,6 +268,7 @@
'dependencies': [ 'dependencies': [
'../../../../externs/compiled_resources2.gyp:platform', '../../../../externs/compiled_resources2.gyp:platform',
'../../../../externs/compiled_resources2.gyp:volume_manager', '../../../../externs/compiled_resources2.gyp:volume_manager',
'../../../common/js/compiled_resources2.gyp:metrics',
'../../../common/js/compiled_resources2.gyp:util', '../../../common/js/compiled_resources2.gyp:util',
'../../../common/js/compiled_resources2.gyp:volume_manager_common', '../../../common/js/compiled_resources2.gyp:volume_manager_common',
'../compiled_resources2.gyp:volume_manager_wrapper', '../compiled_resources2.gyp:volume_manager_wrapper',
......
...@@ -336,6 +336,7 @@ LocationLine.prototype.onClick_ = function(index, event) { ...@@ -336,6 +336,7 @@ LocationLine.prototype.onClick_ = function(index, event) {
pathClickEvent.entry = entry; pathClickEvent.entry = entry;
this.dispatchEvent(pathClickEvent); this.dispatchEvent(pathClickEvent);
}.bind(this)); }.bind(this));
metrics.recordUserAction('ClickBreadcrumbs');
}; };
/** /**
......
...@@ -69,6 +69,7 @@ chrome = { ...@@ -69,6 +69,7 @@ chrome = {
}, },
metricsPrivate: { metricsPrivate: {
userActions_: [],
MetricTypeType: { MetricTypeType: {
HISTOGRAM_LINEAR: 'histogram-linear', HISTOGRAM_LINEAR: 'histogram-linear',
}, },
...@@ -76,7 +77,9 @@ chrome = { ...@@ -76,7 +77,9 @@ chrome = {
recordPercentage: () => {}, recordPercentage: () => {},
recordSmallCount: () => {}, recordSmallCount: () => {},
recordTime: () => {}, recordTime: () => {},
recordUserAction: () => {}, recordUserAction: (action) => {
chrome.metricsPrivate.userActions_.push(action);
},
recordValue: () => {}, recordValue: () => {},
}, },
......
// Copyright 2018 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.
function testClickBreadcrumb(done) {
test.setupAndWaitUntilReady()
.then(() => {
// Reset metrics.
chrome.metricsPrivate.userActions_ = [];
// Click first row which is 'photos' dir, wait for breadcrumb to show.
assertTrue(test.fakeMouseDoubleClick('#file-list li.table-row'));
return test.waitForElement(
'#location-breadcrumbs .breadcrumb-path:nth-of-type(2)');
})
.then(result => {
// Click breadcrumb to return to parent dir.
assertTrue(test.fakeMouseClick(
'#location-breadcrumbs .breadcrumb-path:nth-of-type(1)'));
return test.waitForFiles(
test.TestEntryInfo.getExpectedRows(test.BASIC_LOCAL_ENTRY_SET));
})
.then(result => {
assertArrayEquals(
['FileBrowser.ClickBreadcrumbs'],
chrome.metricsPrivate.userActions_);
done();
});
}
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