| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 12 #include "chrome/common/notification_service.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 // The tests that are run by this extension are expected to record the following | 16 // The tests that are run by this extension are expected to record the following |
| 16 // user actions, with the specified counts. If the tests in test.js are | 17 // user actions, with the specified counts. If the tests in test.js are |
| 17 // modified, this array may need to be updated. | 18 // modified, this array may need to be updated. |
| 18 struct RecordedUserAction { | 19 struct RecordedUserAction { |
| 19 const char* name; // base name of metric without extension id. | 20 const char* name; // base name of metric without extension id. |
| 20 int count; // number of times the metric was recorded. | 21 int count; // number of times the metric was recorded. |
| 21 } g_user_actions[] = { | 22 } g_user_actions[] = { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 147 |
| 147 ASSERT_TRUE(RunExtensionTest("metrics")) << message_; | 148 ASSERT_TRUE(RunExtensionTest("metrics")) << message_; |
| 148 const Extension* extension = GetSingleLoadedExtension(); | 149 const Extension* extension = GetSingleLoadedExtension(); |
| 149 ASSERT_TRUE(extension); | 150 ASSERT_TRUE(extension); |
| 150 | 151 |
| 151 observer.ValidateUserActions(extension, | 152 observer.ValidateUserActions(extension, |
| 152 g_user_actions, | 153 g_user_actions, |
| 153 arraysize(g_user_actions)); | 154 arraysize(g_user_actions)); |
| 154 ValidateHistograms(extension, g_histograms, arraysize(g_histograms)); | 155 ValidateHistograms(extension, g_histograms, arraysize(g_histograms)); |
| 155 } | 156 } |
| OLD | NEW |