| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 mojo::Binding<mojom::VisitedLinkNotificationSink> binding_; | 590 mojo::Binding<mojom::VisitedLinkNotificationSink> binding_; |
| 591 }; | 591 }; |
| 592 | 592 |
| 593 // Stub out as little as possible, borrowing from RenderProcessHost. | 593 // Stub out as little as possible, borrowing from RenderProcessHost. |
| 594 class VisitRelayingRenderProcessHost : public MockRenderProcessHost { | 594 class VisitRelayingRenderProcessHost : public MockRenderProcessHost { |
| 595 public: | 595 public: |
| 596 explicit VisitRelayingRenderProcessHost( | 596 explicit VisitRelayingRenderProcessHost( |
| 597 content::BrowserContext* browser_context, | 597 content::BrowserContext* browser_context, |
| 598 VisitCountingContext* context) | 598 VisitCountingContext* context) |
| 599 : MockRenderProcessHost(browser_context), widgets_(0) { | 599 : MockRenderProcessHost(browser_context), widgets_(0) { |
| 600 SetRemoteInterfaces(base::MakeUnique<shell::InterfaceProvider>()); | 600 SetRemoteInterfaces(base::MakeUnique<service_manager::InterfaceProvider>()); |
| 601 shell::InterfaceProvider::TestApi test_api(GetRemoteInterfaces()); | 601 service_manager::InterfaceProvider::TestApi test_api(GetRemoteInterfaces()); |
| 602 test_api.SetBinderForName( | 602 test_api.SetBinderForName( |
| 603 mojom::VisitedLinkNotificationSink::Name_, | 603 mojom::VisitedLinkNotificationSink::Name_, |
| 604 base::Bind(&VisitCountingContext::Bind, base::Unretained(context))); | 604 base::Bind(&VisitCountingContext::Bind, base::Unretained(context))); |
| 605 content::NotificationService::current()->Notify( | 605 content::NotificationService::current()->Notify( |
| 606 content::NOTIFICATION_RENDERER_PROCESS_CREATED, | 606 content::NOTIFICATION_RENDERER_PROCESS_CREATED, |
| 607 content::Source<RenderProcessHost>(this), | 607 content::Source<RenderProcessHost>(this), |
| 608 content::NotificationService::NoDetails()); | 608 content::NotificationService::NoDetails()); |
| 609 } | 609 } |
| 610 ~VisitRelayingRenderProcessHost() override { | 610 ~VisitRelayingRenderProcessHost() override { |
| 611 content::NotificationService::current()->Notify( | 611 content::NotificationService::current()->Notify( |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // Waiting complete loading the table. | 878 // Waiting complete loading the table. |
| 879 content::RunAllBlockingPoolTasksUntilIdle(); | 879 content::RunAllBlockingPoolTasksUntilIdle(); |
| 880 | 880 |
| 881 context()->binding().FlushForTesting(); | 881 context()->binding().FlushForTesting(); |
| 882 | 882 |
| 883 // After load table expect completely reset event. | 883 // After load table expect completely reset event. |
| 884 EXPECT_EQ(1, context()->completely_reset_event_count()); | 884 EXPECT_EQ(1, context()->completely_reset_event_count()); |
| 885 } | 885 } |
| 886 | 886 |
| 887 } // namespace visitedlink | 887 } // namespace visitedlink |
| OLD | NEW |