| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/message_loop/message_loop.h" | |
| 13 #include "chrome/browser/media/router/media_router_mojo_impl.h" | |
| 14 #include "chrome/browser/media/router/mock_media_router.h" | |
| 15 #include "chrome/browser/media/router/test_helper.h" | |
| 16 #include "chrome/test/base/testing_profile.h" | |
| 17 #include "extensions/common/extension.h" | |
| 18 #include "mojo/public/cpp/bindings/binding.h" | |
| 19 #include "testing/gmock/include/gmock/gmock.h" | |
| 20 #include "testing/gtest/include/gtest/gtest.h" | |
| 21 | |
| 22 namespace media_router { | |
| 23 | |
| 24 class MediaRouterMojoImpl; | |
| 25 class MessagePump; | |
| 26 | |
| 27 // Tests the API call flow between the MediaRouterMojoImpl and the Media Router | |
| 28 // Mojo service in both directions. | |
| 29 class MediaRouterMojoTest : public ::testing::Test { | |
| 30 public: | |
| 31 MediaRouterMojoTest(); | |
| 32 ~MediaRouterMojoTest() override; | |
| 33 | |
| 34 protected: | |
| 35 void SetUp() override; | |
| 36 | |
| 37 void ProcessEventLoop(); | |
| 38 | |
| 39 void ConnectProviderManagerService(); | |
| 40 | |
| 41 const std::string& extension_id() const { return extension_->id(); } | |
| 42 | |
| 43 MediaRouterMojoImpl* router() const { return mock_media_router_.get(); } | |
| 44 | |
| 45 // Mock objects. | |
| 46 MockMediaRouteProvider mock_media_route_provider_; | |
| 47 testing::NiceMock<MockEventPageTracker> mock_event_page_tracker_; | |
| 48 | |
| 49 // Mojo proxy object for |mock_media_router_| | |
| 50 media_router::interfaces::MediaRouterPtr media_router_proxy_; | |
| 51 | |
| 52 private: | |
| 53 scoped_refptr<extensions::Extension> extension_; | |
| 54 scoped_ptr<MediaRouterMojoImpl> mock_media_router_; | |
| 55 scoped_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; | |
| 56 base::MessageLoop message_loop_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); | |
| 59 }; | |
| 60 | |
| 61 } // namespace media_router | |
| 62 | |
| 63 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_TEST_H_ | |
| OLD | NEW |