| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_TEST_GUEST_VIEW_MANAGER_H_ | |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_TEST_GUEST_VIEW_MANAGER_H_ | |
| 7 | |
| 8 #include "content/public/test/test_utils.h" | |
| 9 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 10 #include "extensions/browser/guest_view/guest_view_manager_factory.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 class TestGuestViewManager : public GuestViewManager { | |
| 15 public: | |
| 16 explicit TestGuestViewManager(content::BrowserContext* context); | |
| 17 virtual ~TestGuestViewManager(); | |
| 18 | |
| 19 content::WebContents* WaitForGuestCreated(); | |
| 20 void WaitForGuestDeleted(); | |
| 21 | |
| 22 private: | |
| 23 // GuestViewManager override: | |
| 24 virtual void AddGuest(int guest_instance_id, | |
| 25 content::WebContents* guest_web_contents) override; | |
| 26 virtual void RemoveGuest(int guest_instance_id) override; | |
| 27 | |
| 28 bool seen_guest_removed_; | |
| 29 content::WebContents* web_contents_; | |
| 30 scoped_refptr<content::MessageLoopRunner> created_message_loop_runner_; | |
| 31 scoped_refptr<content::MessageLoopRunner> deleted_message_loop_runner_; | |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManager); | |
| 34 }; | |
| 35 | |
| 36 // Test factory for creating test instances of GuestViewManager. | |
| 37 class TestGuestViewManagerFactory : public GuestViewManagerFactory { | |
| 38 public: | |
| 39 TestGuestViewManagerFactory(); | |
| 40 virtual ~TestGuestViewManagerFactory(); | |
| 41 | |
| 42 virtual GuestViewManager* CreateGuestViewManager( | |
| 43 content::BrowserContext* context) override; | |
| 44 | |
| 45 TestGuestViewManager* GetManager(content::BrowserContext* context); | |
| 46 | |
| 47 private: | |
| 48 TestGuestViewManager* test_guest_view_manager_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManagerFactory); | |
| 51 }; | |
| 52 | |
| 53 } // namespace extensions | |
| 54 | |
| 55 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_TEST_GUEST_VIEW_MANAGER_H_ | |
| OLD | NEW |