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 <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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class BluetoothEventRouterTest : public ExtensionsTest { | 36 class BluetoothEventRouterTest : public ExtensionsTest { |
37 public: | 37 public: |
38 BluetoothEventRouterTest() | 38 BluetoothEventRouterTest() |
39 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 39 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
40 mock_adapter_(new testing::StrictMock<device::MockBluetoothAdapter>()), | 40 mock_adapter_(new testing::StrictMock<device::MockBluetoothAdapter>()), |
41 notification_service_(content::NotificationService::Create()), | 41 notification_service_(content::NotificationService::Create()), |
42 router_(new BluetoothEventRouter(browser_context())) { | 42 router_(new BluetoothEventRouter(browser_context())) { |
43 router_->SetAdapterForTest(mock_adapter_); | 43 router_->SetAdapterForTest(mock_adapter_); |
44 } | 44 } |
45 | 45 |
46 virtual void TearDown() OVERRIDE { | 46 virtual void TearDown() override { |
47 // It's important to destroy the router before the browser context keyed | 47 // It's important to destroy the router before the browser context keyed |
48 // services so it removes itself as an ExtensionRegistry observer. | 48 // services so it removes itself as an ExtensionRegistry observer. |
49 router_.reset(NULL); | 49 router_.reset(NULL); |
50 ExtensionsTest::TearDown(); | 50 ExtensionsTest::TearDown(); |
51 } | 51 } |
52 | 52 |
53 protected: | 53 protected: |
54 base::MessageLoopForUI message_loop_; | 54 base::MessageLoopForUI message_loop_; |
55 // Note: |ui_thread_| must be declared before |router_|. | 55 // Note: |ui_thread_| must be declared before |router_|. |
56 content::TestBrowserThread ui_thread_; | 56 content::TestBrowserThread ui_thread_; |
(...skipping 28 matching lines...) Expand all Loading... |
85 .SetID(kTestExtensionId) | 85 .SetID(kTestExtensionId) |
86 .Build(); | 86 .Build(); |
87 | 87 |
88 ExtensionRegistry::Get(browser_context())->TriggerOnUnloaded( | 88 ExtensionRegistry::Get(browser_context())->TriggerOnUnloaded( |
89 extension.get(), UnloadedExtensionInfo::REASON_DISABLE); | 89 extension.get(), UnloadedExtensionInfo::REASON_DISABLE); |
90 | 90 |
91 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); | 91 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); |
92 } | 92 } |
93 | 93 |
94 } // namespace extensions | 94 } // namespace extensions |
OLD | NEW |