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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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 | Annotate | Revision Log
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base::RunLoop run_loop; 97 base::RunLoop run_loop;
98 run_loop.RunUntilIdle(); 98 run_loop.RunUntilIdle();
99 } 99 }
100 100
101 protected: 101 protected:
102 testing::StrictMock<device::MockBluetoothAdapter>* mock_adapter_; 102 testing::StrictMock<device::MockBluetoothAdapter>* mock_adapter_;
103 testing::NiceMock<device::MockBluetoothProfile> mock_audio_profile_; 103 testing::NiceMock<device::MockBluetoothProfile> mock_audio_profile_;
104 testing::NiceMock<device::MockBluetoothProfile> mock_health_profile_; 104 testing::NiceMock<device::MockBluetoothProfile> mock_health_profile_;
105 scoped_ptr<TestingProfile> test_profile_; 105 scoped_ptr<TestingProfile> test_profile_;
106 ExtensionBluetoothEventRouter router_; 106 ExtensionBluetoothEventRouter router_;
107 MessageLoopForUI message_loop_; 107 base::MessageLoopForUI message_loop_;
108 content::TestBrowserThread ui_thread_; 108 content::TestBrowserThread ui_thread_;
109 }; 109 };
110 110
111 TEST_F(ExtensionBluetoothEventRouterTest, BluetoothEventListener) { 111 TEST_F(ExtensionBluetoothEventRouterTest, BluetoothEventListener) {
112 router_.OnListenerAdded(); 112 router_.OnListenerAdded();
113 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); 113 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
114 router_.OnListenerRemoved(); 114 router_.OnListenerRemoved();
115 } 115 }
116 116
117 TEST_F(ExtensionBluetoothEventRouterTest, MultipleBluetoothEventListeners) { 117 TEST_F(ExtensionBluetoothEventRouterTest, MultipleBluetoothEventListeners) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 &mock_device, 202 &mock_device,
203 mock_socket); 203 mock_socket);
204 FakeEventRouter* fake_event_router = 204 FakeEventRouter* fake_event_router =
205 static_cast<FakeEventRouter*>(fake_extension_system->event_router()); 205 static_cast<FakeEventRouter*>(fake_extension_system->event_router());
206 EXPECT_TRUE(fake_event_router->event() == NULL); 206 EXPECT_TRUE(fake_event_router->event() == NULL);
207 207
208 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); 208 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
209 } 209 }
210 210
211 } // namespace extensions 211 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698