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

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

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 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/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // BluetoothAdapter in the constructor. 125 // BluetoothAdapter in the constructor.
126 class TestChromeOSMetricsProvider : public ChromeOSMetricsProvider { 126 class TestChromeOSMetricsProvider : public ChromeOSMetricsProvider {
127 public: 127 public:
128 TestChromeOSMetricsProvider() { 128 TestChromeOSMetricsProvider() {
129 InitTaskGetBluetoothAdapter( 129 InitTaskGetBluetoothAdapter(
130 base::Bind(&TestChromeOSMetricsProvider::GetBluetoothAdapterCallback, 130 base::Bind(&TestChromeOSMetricsProvider::GetBluetoothAdapterCallback,
131 base::Unretained(this))); 131 base::Unretained(this)));
132 base::RunLoop().Run(); 132 base::RunLoop().Run();
133 } 133 }
134 void GetBluetoothAdapterCallback() { 134 void GetBluetoothAdapterCallback() {
135 ASSERT_TRUE(base::MessageLoop::current()->is_running()); 135 ASSERT_TRUE(base::RunLoop::IsRunningOnCurrentThread());
136 base::MessageLoop::current()->QuitWhenIdle(); 136 base::MessageLoop::current()->QuitWhenIdle();
137 } 137 }
138 }; 138 };
139 139
140 TEST_F(ChromeOSMetricsProviderTest, MultiProfileUserCount) { 140 TEST_F(ChromeOSMetricsProviderTest, MultiProfileUserCount) {
141 const AccountId account_id1(AccountId::FromUserEmail("user1@example.com")); 141 const AccountId account_id1(AccountId::FromUserEmail("user1@example.com"));
142 const AccountId account_id2(AccountId::FromUserEmail("user2@example.com")); 142 const AccountId account_id2(AccountId::FromUserEmail("user2@example.com"));
143 const AccountId account_id3(AccountId::FromUserEmail("user3@example.com")); 143 const AccountId account_id3(AccountId::FromUserEmail("user3@example.com"));
144 144
145 // |scoped_enabler| takes over the lifetime of |user_manager|. 145 // |scoped_enabler| takes over the lifetime of |user_manager|.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 EXPECT_EQ(0x030DU, device1.product_id()); 280 EXPECT_EQ(0x030DU, device1.product_id());
281 EXPECT_EQ(0x0306U, device1.device_id()); 281 EXPECT_EQ(0x0306U, device1.device_id());
282 282
283 // The Confirm Passkey object, this has no Device ID information. 283 // The Confirm Passkey object, this has no Device ID information.
284 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass, 284 EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass,
285 device2.bluetooth_class()); 285 device2.bluetooth_class());
286 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type()); 286 EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type());
287 EXPECT_EQ(0x207D74U, device2.vendor_prefix()); 287 EXPECT_EQ(0x207D74U, device2.vendor_prefix());
288 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source()); 288 EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source());
289 } 289 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/ui/views/simple_message_box_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698