| 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_MEDIA_ROUTER_MOJO_TEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_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" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/run_loop.h" |
| 12 #include "chrome/browser/media/router/media_router_mojo_impl.h" | 13 #include "chrome/browser/media/router/media_router_mojo_impl.h" |
| 13 #include "chrome/browser/media/router/mock_media_router.h" | 14 #include "chrome/browser/media/router/mock_media_router.h" |
| 14 #include "chrome/browser/media/router/test_helper.h" | 15 #include "chrome/browser/media/router/test_helper.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
| 17 #include "content/public/test/test_browser_thread_bundle.h" |
| 16 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 21 |
| 20 namespace media_router { | 22 namespace media_router { |
| 21 | 23 |
| 22 class MediaRouterMojoImpl; | 24 class MediaRouterMojoImpl; |
| 23 class MessagePump; | 25 class MessagePump; |
| 24 | 26 |
| 25 // Tests the API call flow between the MediaRouterMojoImpl and the Media Router | 27 // Tests the API call flow between the MediaRouterMojoImpl and the Media Router |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 MediaRouterMojoImpl* router() const { return mock_media_router_.get(); } | 43 MediaRouterMojoImpl* router() const { return mock_media_router_.get(); } |
| 42 | 44 |
| 43 // Mock objects. | 45 // Mock objects. |
| 44 MockMediaRouteProvider mock_media_route_provider_; | 46 MockMediaRouteProvider mock_media_route_provider_; |
| 45 testing::NiceMock<MockEventPageTracker> mock_event_page_tracker_; | 47 testing::NiceMock<MockEventPageTracker> mock_event_page_tracker_; |
| 46 | 48 |
| 47 // Mojo proxy object for |mock_media_router_| | 49 // Mojo proxy object for |mock_media_router_| |
| 48 media_router::interfaces::MediaRouterPtr media_router_proxy_; | 50 media_router::interfaces::MediaRouterPtr media_router_proxy_; |
| 49 | 51 |
| 50 private: | 52 private: |
| 53 content::TestBrowserThreadBundle test_thread_bundle_; |
| 51 std::string extension_id_; | 54 std::string extension_id_; |
| 52 scoped_ptr<MediaRouterMojoImpl> mock_media_router_; | 55 scoped_ptr<MediaRouterMojoImpl> mock_media_router_; |
| 53 scoped_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; | 56 scoped_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; |
| 54 base::MessageLoop message_loop_; | |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); | 58 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace media_router | 61 } // namespace media_router |
| 60 | 62 |
| 61 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ | 63 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ |
| OLD | NEW |