Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Side by Side Diff: chrome/browser/metrics/chromeos_metrics_provider_unittest.cc

Issue 301633006: Move ChromeOS hardware class init out of MetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos_metrics_provider.h" 5 #include "chrome/browser/metrics/chromeos_metrics_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" 10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 new FakeBluetoothAgentManagerClient)); 70 new FakeBluetoothAgentManagerClient));
71 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager.release()); 71 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager.release());
72 72
73 // Grab pointers to members of the thread manager for easier testing. 73 // Grab pointers to members of the thread manager for easier testing.
74 fake_bluetooth_adapter_client_ = static_cast<FakeBluetoothAdapterClient*>( 74 fake_bluetooth_adapter_client_ = static_cast<FakeBluetoothAdapterClient*>(
75 DBusThreadManager::Get()->GetBluetoothAdapterClient()); 75 DBusThreadManager::Get()->GetBluetoothAdapterClient());
76 fake_bluetooth_device_client_ = static_cast<FakeBluetoothDeviceClient*>( 76 fake_bluetooth_device_client_ = static_cast<FakeBluetoothDeviceClient*>(
77 DBusThreadManager::Get()->GetBluetoothDeviceClient()); 77 DBusThreadManager::Get()->GetBluetoothDeviceClient());
78 78
79 // Initialize the login state trackers. 79 // Initialize the login state trackers.
80 chromeos::LoginState::Initialize(); 80 if (!chromeos::LoginState::IsInitialized())
81 chromeos::LoginState::Initialize();
81 } 82 }
82 83
83 virtual void TearDown() OVERRIDE { DBusThreadManager::Shutdown(); } 84 virtual void TearDown() OVERRIDE { DBusThreadManager::Shutdown(); }
84 85
85 protected: 86 protected:
86 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_; 87 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_;
87 FakeBluetoothDeviceClient* fake_bluetooth_device_client_; 88 FakeBluetoothDeviceClient* fake_bluetooth_device_client_;
88 89
89 private: 90 private:
90 content::TestBrowserThreadBundle thread_bundle_; 91 content::TestBrowserThreadBundle thread_bundle_;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // Second device should match the Confirm Passkey object, this has 219 // Second device should match the Confirm Passkey object, this has
219 // no Device ID information. 220 // no Device ID information.
220 PairedDevice device2 = system_profile.hardware().bluetooth().paired_device(1); 221 PairedDevice device2 = system_profile.hardware().bluetooth().paired_device(1);
221 222
222 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass, 223 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass,
223 device2.bluetooth_class()); 224 device2.bluetooth_class());
224 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type()); 225 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type());
225 EXPECT_EQ(0x207D74U, device2.vendor_prefix()); 226 EXPECT_EQ(0x207D74U, device2.vendor_prefix());
226 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source()); 227 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source());
227 } 228 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chromeos_metrics_provider.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698