| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {md_history.BrowserService} | 7 * @extends {md_history.BrowserService} |
| 8 */ | 8 */ |
| 9 var TestMetricsBrowserService = function() { | 9 var TestMetricsBrowserService = function() { |
| 10 this.histogramMap = {}; | 10 this.histogramMap = {}; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 }).then(() => { | 109 }).then(() => { |
| 110 items = polymerSelectAll(app.$.history, 'history-item'); | 110 items = polymerSelectAll(app.$.history, 'history-item'); |
| 111 MockInteractions.tap(items[0].$.title); | 111 MockInteractions.tap(items[0].$.title); |
| 112 assertEquals(1, actionMap['SearchResultClick']); | 112 assertEquals(1, actionMap['SearchResultClick']); |
| 113 assertEquals(1, histogramMap['HistoryPage.ClickPosition'][0]); | 113 assertEquals(1, histogramMap['HistoryPage.ClickPosition'][0]); |
| 114 assertEquals(1, histogramMap['HistoryPage.ClickPositionSubset'][0]); | 114 assertEquals(1, histogramMap['HistoryPage.ClickPositionSubset'][0]); |
| 115 MockInteractions.tap(items[0].$.checkbox); | 115 MockInteractions.tap(items[0].$.checkbox); |
| 116 MockInteractions.tap(items[4].$.checkbox); | 116 MockInteractions.tap(items[4].$.checkbox); |
| 117 return PolymerTest.flushTasks(); | 117 return PolymerTest.flushTasks(); |
| 118 }).then(() => { | 118 }).then(() => { |
| 119 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); | 119 app.$.toolbar.deleteSelectedItems(); |
| 120 assertEquals(1, actionMap['RemoveSelected']); | 120 assertEquals(1, actionMap['RemoveSelected']); |
| 121 return PolymerTest.flushTasks(); | 121 return PolymerTest.flushTasks(); |
| 122 }).then(() => { | 122 }).then(() => { |
| 123 MockInteractions.tap(app.$.history.$$('.cancel-button')); | 123 MockInteractions.tap(app.$.history.$$('.cancel-button')); |
| 124 assertEquals(1, actionMap['CancelRemoveSelected']); | 124 assertEquals(1, actionMap['CancelRemoveSelected']); |
| 125 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); | 125 app.$.toolbar.deleteSelectedItems(); |
| 126 return PolymerTest.flushTasks(); | 126 return PolymerTest.flushTasks(); |
| 127 }).then(() => { | 127 }).then(() => { |
| 128 MockInteractions.tap(app.$.history.$$('.action-button')); | 128 MockInteractions.tap(app.$.history.$$('.action-button')); |
| 129 assertEquals(1, actionMap['ConfirmRemoveSelected']); | 129 assertEquals(1, actionMap['ConfirmRemoveSelected']); |
| 130 return PolymerTest.flushTasks(); | 130 return PolymerTest.flushTasks(); |
| 131 }).then(() => { | 131 }).then(() => { |
| 132 items = polymerSelectAll(app.$.history, 'history-item'); | 132 items = polymerSelectAll(app.$.history, 'history-item'); |
| 133 MockInteractions.tap(items[0].$['menu-button']); | 133 MockInteractions.tap(items[0].$['menu-button']); |
| 134 return PolymerTest.flushTasks(); | 134 return PolymerTest.flushTasks(); |
| 135 }).then(() => { | 135 }).then(() => { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); | 185 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); |
| 186 | 186 |
| 187 MockInteractions.tap(menuButton); | 187 MockInteractions.tap(menuButton); |
| 188 return PolymerTest.flushTasks(); | 188 return PolymerTest.flushTasks(); |
| 189 }).then(() => { | 189 }).then(() => { |
| 190 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); | 190 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); |
| 191 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); | 191 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); |
| 192 }); | 192 }); |
| 193 }); | 193 }); |
| 194 }); | 194 }); |
| OLD | NEW |