| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "chrome/browser/media/router/media_router_ui_service.h" | 7 #include "chrome/browser/media/router/media_router_ui_service.h" |
| 8 #include "chrome/browser/media/router/media_router_ui_service_factory.h" | 8 #include "chrome/browser/media/router/media_router_ui_service_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 content::TestBrowserThreadBundle thread_bundle_; | 39 content::TestBrowserThreadBundle thread_bundle_; |
| 40 Profile* profile() { return profile_.get(); } | 40 Profile* profile() { return profile_.get(); } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 std::unique_ptr<Profile> profile_; | 43 std::unique_ptr<Profile> profile_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 TEST_F(MediaRouterUIServiceFactoryUnitTest, CreateService) { | 46 TEST_F(MediaRouterUIServiceFactoryUnitTest, CreateService) { |
| 47 MediaRouterUIService* service = | 47 // We call BuildServiceInstanceFor() directly because |
| 48 MediaRouterUIServiceFactory::GetForBrowserContext(profile()); | 48 // MediaRouterUIServiceFactory::GetForBrowserContext() is set to return a |
| 49 // nullptr for a test profile. |
| 50 std::unique_ptr<MediaRouterUIService> service( |
| 51 static_cast<MediaRouterUIService*>( |
| 52 MediaRouterUIServiceFactory::GetInstance()->BuildServiceInstanceFor( |
| 53 profile()))); |
| 49 ASSERT_TRUE(service); | 54 ASSERT_TRUE(service); |
| 50 } | 55 } |
| 51 | 56 |
| 52 } // namespace media_router | 57 } // namespace media_router |
| OLD | NEW |