OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/port.h" | 12 #include "base/port.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/prefs/scoped_user_pref_update.h" | 14 #include "base/prefs/scoped_user_pref_update.h" |
15 #include "base/prefs/testing_pref_service.h" | 15 #include "base/prefs/testing_pref_service.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/threading/sequenced_worker_pool.h" |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "base/tracked_objects.h" | 22 #include "base/tracked_objects.h" |
23 #include "chrome/browser/google/google_util.h" | 23 #include "chrome/browser/google/google_util.h" |
24 #include "chrome/browser/prefs/browser_prefs.h" | 24 #include "chrome/browser/prefs/browser_prefs.h" |
25 #include "chrome/common/chrome_switches.h" | |
26 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/chrome_version_info.h" |
27 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
28 #include "chrome/installer/util/google_update_settings.h" | 27 #include "chrome/installer/util/google_update_settings.h" |
29 #include "components/metrics/metrics_hashes.h" | 28 #include "components/metrics/metrics_hashes.h" |
30 #include "components/metrics/proto/profiler_event.pb.h" | 29 #include "components/metrics/proto/profiler_event.pb.h" |
31 #include "components/metrics/proto/system_profile.pb.h" | 30 #include "components/metrics/proto/system_profile.pb.h" |
32 #include "components/variations/active_field_trials.h" | 31 #include "components/variations/active_field_trials.h" |
33 #include "components/variations/metrics_util.h" | 32 #include "components/variations/metrics_util.h" |
34 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/common/process_type.h" | 34 #include "content/public/common/process_type.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 215 |
217 } // namespace | 216 } // namespace |
218 | 217 |
219 class MetricsLogTest : public testing::Test { | 218 class MetricsLogTest : public testing::Test { |
220 public: | 219 public: |
221 MetricsLogTest() {} | 220 MetricsLogTest() {} |
222 | 221 |
223 protected: | 222 protected: |
224 virtual void SetUp() OVERRIDE { | 223 virtual void SetUp() OVERRIDE { |
225 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
226 // Enable multi-profiles. | |
227 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kMultiProfiles); | |
228 | |
229 // Set up the fake Bluetooth environment, | 225 // Set up the fake Bluetooth environment, |
230 scoped_ptr<FakeDBusThreadManager> fake_dbus_thread_manager( | 226 scoped_ptr<FakeDBusThreadManager> fake_dbus_thread_manager( |
231 new FakeDBusThreadManager); | 227 new FakeDBusThreadManager); |
232 fake_dbus_thread_manager->SetBluetoothAdapterClient( | 228 fake_dbus_thread_manager->SetBluetoothAdapterClient( |
233 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); | 229 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); |
234 fake_dbus_thread_manager->SetBluetoothDeviceClient( | 230 fake_dbus_thread_manager->SetBluetoothDeviceClient( |
235 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient)); | 231 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient)); |
236 fake_dbus_thread_manager->SetBluetoothGattCharacteristicClient( | 232 fake_dbus_thread_manager->SetBluetoothGattCharacteristicClient( |
237 scoped_ptr<BluetoothGattCharacteristicClient>( | 233 scoped_ptr<BluetoothGattCharacteristicClient>( |
238 new FakeBluetoothGattCharacteristicClient)); | 234 new FakeBluetoothGattCharacteristicClient)); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 PairedDevice device2 = | 783 PairedDevice device2 = |
788 log.system_profile().hardware().bluetooth().paired_device(1); | 784 log.system_profile().hardware().bluetooth().paired_device(1); |
789 | 785 |
790 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass, | 786 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass, |
791 device2.bluetooth_class()); | 787 device2.bluetooth_class()); |
792 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type()); | 788 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type()); |
793 EXPECT_EQ(0x207D74U, device2.vendor_prefix()); | 789 EXPECT_EQ(0x207D74U, device2.vendor_prefix()); |
794 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source()); | 790 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source()); |
795 } | 791 } |
796 #endif // OS_CHROMEOS | 792 #endif // OS_CHROMEOS |
OLD | NEW |