| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ |
| 6 #define COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ | 6 #define COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/linked_ptr.h" | |
| 15 #include "components/guest_view/browser/guest_view_manager.h" | 14 #include "components/guest_view/browser/guest_view_manager.h" |
| 16 #include "components/guest_view/browser/guest_view_manager_factory.h" | 15 #include "components/guest_view/browser/guest_view_manager_factory.h" |
| 17 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
| 18 | 17 |
| 19 namespace guest_view { | 18 namespace guest_view { |
| 20 | 19 |
| 21 class TestGuestViewManager : public GuestViewManager { | 20 class TestGuestViewManager : public GuestViewManager { |
| 22 public: | 21 public: |
| 23 TestGuestViewManager(content::BrowserContext* context, | 22 TestGuestViewManager(content::BrowserContext* context, |
| 24 std::unique_ptr<GuestViewManagerDelegate> delegate); | 23 std::unique_ptr<GuestViewManagerDelegate> delegate); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 92 |
| 94 using GuestViewManager::last_instance_id_removed_; | 93 using GuestViewManager::last_instance_id_removed_; |
| 95 using GuestViewManager::removed_instance_ids_; | 94 using GuestViewManager::removed_instance_ids_; |
| 96 | 95 |
| 97 int num_embedder_processes_destroyed_; | 96 int num_embedder_processes_destroyed_; |
| 98 size_t num_guests_created_; | 97 size_t num_guests_created_; |
| 99 size_t expected_num_guests_created_; | 98 size_t expected_num_guests_created_; |
| 100 int num_views_garbage_collected_; | 99 int num_views_garbage_collected_; |
| 101 bool waiting_for_guests_created_; | 100 bool waiting_for_guests_created_; |
| 102 | 101 |
| 103 std::vector<linked_ptr<content::WebContentsDestroyedWatcher>> | 102 std::vector<std::unique_ptr<content::WebContentsDestroyedWatcher>> |
| 104 guest_web_contents_watchers_; | 103 guest_web_contents_watchers_; |
| 105 scoped_refptr<content::MessageLoopRunner> created_message_loop_runner_; | 104 scoped_refptr<content::MessageLoopRunner> created_message_loop_runner_; |
| 106 scoped_refptr<content::MessageLoopRunner> num_created_message_loop_runner_; | 105 scoped_refptr<content::MessageLoopRunner> num_created_message_loop_runner_; |
| 107 scoped_refptr<content::MessageLoopRunner> gc_message_loop_runner_; | 106 scoped_refptr<content::MessageLoopRunner> gc_message_loop_runner_; |
| 108 | 107 |
| 109 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManager); | 108 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManager); |
| 110 }; | 109 }; |
| 111 | 110 |
| 112 // Test factory for creating test instances of GuestViewManager. | 111 // Test factory for creating test instances of GuestViewManager. |
| 113 class TestGuestViewManagerFactory : public GuestViewManagerFactory { | 112 class TestGuestViewManagerFactory : public GuestViewManagerFactory { |
| 114 public: | 113 public: |
| 115 TestGuestViewManagerFactory(); | 114 TestGuestViewManagerFactory(); |
| 116 ~TestGuestViewManagerFactory() override; | 115 ~TestGuestViewManagerFactory() override; |
| 117 | 116 |
| 118 GuestViewManager* CreateGuestViewManager( | 117 GuestViewManager* CreateGuestViewManager( |
| 119 content::BrowserContext* context, | 118 content::BrowserContext* context, |
| 120 std::unique_ptr<GuestViewManagerDelegate> delegate) override; | 119 std::unique_ptr<GuestViewManagerDelegate> delegate) override; |
| 121 | 120 |
| 122 private: | 121 private: |
| 123 TestGuestViewManager* test_guest_view_manager_; | 122 TestGuestViewManager* test_guest_view_manager_; |
| 124 | 123 |
| 125 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManagerFactory); | 124 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManagerFactory); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace guest_view | 127 } // namespace guest_view |
| 129 | 128 |
| 130 #endif // COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ | 129 #endif // COMPONENTS_GUEST_VIEW_BROWSER_TEST_GUEST_VIEW_MANAGER_H_ |
| OLD | NEW |