| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ash/metrics/user_metrics_recorder.h" | 5 #include "ash/metrics/user_metrics_recorder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/login_status.h" | 9 #include "ash/login_status.h" |
| 10 #include "ash/public/cpp/config.h" | 10 #include "ash/public/cpp/config.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 SetSessionStarted(true); | 140 SetSessionStarted(true); |
| 141 | 141 |
| 142 // Make sure the shelf contains the app list launcher button. | 142 // Make sure the shelf contains the app list launcher button. |
| 143 ShelfModel* shelf_model = Shell::Get()->shelf_model(); | 143 ShelfModel* shelf_model = Shell::Get()->shelf_model(); |
| 144 ASSERT_EQ(1u, shelf_model->items().size()); | 144 ASSERT_EQ(1u, shelf_model->items().size()); |
| 145 ASSERT_EQ(TYPE_APP_LIST, shelf_model->items()[0].type); | 145 ASSERT_EQ(TYPE_APP_LIST, shelf_model->items()[0].type); |
| 146 | 146 |
| 147 ShelfItem shelf_item; | 147 ShelfItem shelf_item; |
| 148 shelf_item.type = ash::TYPE_PINNED_APP; | 148 shelf_item.type = ash::TYPE_PINNED_APP; |
| 149 shelf_item.app_launch_id = AppLaunchId("app_id_1"); | 149 shelf_item.id = ShelfID("app_id_1"); |
| 150 shelf_model->Add(shelf_item); | 150 shelf_model->Add(shelf_item); |
| 151 shelf_item.app_launch_id = AppLaunchId("app_id_2"); | 151 shelf_item.id = ShelfID("app_id_2"); |
| 152 shelf_model->Add(shelf_item); | 152 shelf_model->Add(shelf_item); |
| 153 | 153 |
| 154 shelf_item.type = ash::TYPE_APP; | 154 shelf_item.type = ash::TYPE_APP; |
| 155 shelf_item.app_launch_id = AppLaunchId("app_id_3"); | 155 shelf_item.id = ShelfID("app_id_3"); |
| 156 shelf_model->Add(shelf_item); | 156 shelf_model->Add(shelf_item); |
| 157 shelf_item.app_launch_id = AppLaunchId("app_id_4"); | 157 shelf_item.id = ShelfID("app_id_4"); |
| 158 shelf_model->Add(shelf_item); | 158 shelf_model->Add(shelf_item); |
| 159 shelf_item.app_launch_id = AppLaunchId("app_id_5"); | 159 shelf_item.id = ShelfID("app_id_5"); |
| 160 shelf_model->Add(shelf_item); | 160 shelf_model->Add(shelf_item); |
| 161 | 161 |
| 162 test_api().RecordPeriodicMetrics(); | 162 test_api().RecordPeriodicMetrics(); |
| 163 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfItems, 5, 1); | 163 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfItems, 5, 1); |
| 164 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfPinnedItems, 2, 1); | 164 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfPinnedItems, 2, 1); |
| 165 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfUnpinnedItems, 3, 1); | 165 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfUnpinnedItems, 3, 1); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace ash | 168 } // namespace ash |
| OLD | NEW |