| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 // Tests the API call flow between the MediaRouterMojoImpl and the Media Router | 128 // Tests the API call flow between the MediaRouterMojoImpl and the Media Router |
| 129 // Mojo service in both directions. | 129 // Mojo service in both directions. |
| 130 class MediaRouterMojoTest : public ::testing::Test { | 130 class MediaRouterMojoTest : public ::testing::Test { |
| 131 public: | 131 public: |
| 132 MediaRouterMojoTest(); | 132 MediaRouterMojoTest(); |
| 133 ~MediaRouterMojoTest() override; | 133 ~MediaRouterMojoTest() override; |
| 134 | 134 |
| 135 protected: | 135 protected: |
| 136 void SetUp() override; | 136 void SetUp() override; |
| 137 void TearDown() override; |
| 137 | 138 |
| 138 void ProcessEventLoop(); | 139 void ProcessEventLoop(); |
| 139 | 140 |
| 140 void ConnectProviderManagerService(); | 141 void ConnectProviderManagerService(); |
| 141 | 142 |
| 142 const std::string& extension_id() const { return extension_->id(); } | 143 const std::string& extension_id() const { return extension_->id(); } |
| 143 | 144 |
| 144 MediaRouterMojoImpl* router() const { return mock_media_router_.get(); } | 145 MediaRouterMojoImpl* router() const { return mock_media_router_.get(); } |
| 145 | 146 |
| 146 // Mock objects. | 147 // Mock objects. |
| 147 MockMediaRouteProvider mock_media_route_provider_; | 148 MockMediaRouteProvider mock_media_route_provider_; |
| 148 testing::NiceMock<MockEventPageTracker> mock_event_page_tracker_; | 149 testing::NiceMock<MockEventPageTracker> mock_event_page_tracker_; |
| 149 | 150 |
| 150 // Mojo proxy object for |mock_media_router_| | 151 // Mojo proxy object for |mock_media_router_| |
| 151 media_router::interfaces::MediaRouterPtr media_router_proxy_; | 152 media_router::interfaces::MediaRouterPtr media_router_proxy_; |
| 152 | 153 |
| 153 private: | 154 private: |
| 154 content::TestBrowserThreadBundle test_thread_bundle_; | 155 content::TestBrowserThreadBundle test_thread_bundle_; |
| 155 scoped_refptr<extensions::Extension> extension_; | 156 scoped_refptr<extensions::Extension> extension_; |
| 156 std::unique_ptr<MediaRouterMojoImpl> mock_media_router_; | 157 std::unique_ptr<MediaRouterMojoImpl> mock_media_router_; |
| 157 std::unique_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; | 158 std::unique_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; |
| 158 | 159 |
| 159 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); | 160 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 } // namespace media_router | 163 } // namespace media_router |
| 163 | 164 |
| 164 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 165 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| OLD | NEW |