| 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 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 gfx::Point link_position(110, 110); | 730 gfx::Point link_position(110, 110); |
| 731 ConvertPageCoordToScreenCoord(guest_contents, &link_position); | 731 ConvertPageCoordToScreenCoord(guest_contents, &link_position); |
| 732 | 732 |
| 733 content::WebContents* web_contents = | 733 content::WebContents* web_contents = |
| 734 browser()->tab_strip_model()->GetActiveWebContents(); | 734 browser()->tab_strip_model()->GetActiveWebContents(); |
| 735 | 735 |
| 736 content::WindowedNotificationObserver observer( | 736 content::WindowedNotificationObserver observer( |
| 737 chrome::NOTIFICATION_TAB_ADDED, | 737 chrome::NOTIFICATION_TAB_ADDED, |
| 738 content::NotificationService::AllSources()); | 738 content::NotificationService::AllSources()); |
| 739 content::SimulateMouseClickAt(web_contents, kDefaultKeyModifier, | 739 content::SimulateMouseClickAt(web_contents, kDefaultKeyModifier, |
| 740 blink::WebMouseEvent::ButtonLeft, link_position); | 740 blink::WebMouseEvent::Button::Left, link_position); |
| 741 observer.Wait(); | 741 observer.Wait(); |
| 742 | 742 |
| 743 int tab_count = browser()->tab_strip_model()->count(); | 743 int tab_count = browser()->tab_strip_model()->count(); |
| 744 ASSERT_EQ(2, tab_count); | 744 ASSERT_EQ(2, tab_count); |
| 745 | 745 |
| 746 content::WebContents* active_web_contents = | 746 content::WebContents* active_web_contents = |
| 747 browser()->tab_strip_model()->GetActiveWebContents(); | 747 browser()->tab_strip_model()->GetActiveWebContents(); |
| 748 ASSERT_EQ(web_contents, active_web_contents); | 748 ASSERT_EQ(web_contents, active_web_contents); |
| 749 | 749 |
| 750 content::WebContents* new_web_contents = | 750 content::WebContents* new_web_contents = |
| (...skipping 16 matching lines...) Expand all Loading... |
| 767 gfx::Point link_position(110, 110); | 767 gfx::Point link_position(110, 110); |
| 768 ConvertPageCoordToScreenCoord(guest_contents, &link_position); | 768 ConvertPageCoordToScreenCoord(guest_contents, &link_position); |
| 769 | 769 |
| 770 content::WebContents* web_contents = | 770 content::WebContents* web_contents = |
| 771 browser()->tab_strip_model()->GetActiveWebContents(); | 771 browser()->tab_strip_model()->GetActiveWebContents(); |
| 772 | 772 |
| 773 content::WindowedNotificationObserver observer( | 773 content::WindowedNotificationObserver observer( |
| 774 chrome::NOTIFICATION_TAB_ADDED, | 774 chrome::NOTIFICATION_TAB_ADDED, |
| 775 content::NotificationService::AllSources()); | 775 content::NotificationService::AllSources()); |
| 776 content::SimulateMouseClickAt(web_contents, 0, | 776 content::SimulateMouseClickAt(web_contents, 0, |
| 777 blink::WebMouseEvent::ButtonMiddle, link_position); | 777 blink::WebMouseEvent::Button::Middle, link_position); |
| 778 observer.Wait(); | 778 observer.Wait(); |
| 779 | 779 |
| 780 int tab_count = browser()->tab_strip_model()->count(); | 780 int tab_count = browser()->tab_strip_model()->count(); |
| 781 ASSERT_EQ(2, tab_count); | 781 ASSERT_EQ(2, tab_count); |
| 782 | 782 |
| 783 content::WebContents* active_web_contents = | 783 content::WebContents* active_web_contents = |
| 784 browser()->tab_strip_model()->GetActiveWebContents(); | 784 browser()->tab_strip_model()->GetActiveWebContents(); |
| 785 ASSERT_EQ(web_contents, active_web_contents); | 785 ASSERT_EQ(web_contents, active_web_contents); |
| 786 | 786 |
| 787 content::WebContents* new_web_contents = | 787 content::WebContents* new_web_contents = |
| (...skipping 18 matching lines...) Expand all Loading... |
| 806 | 806 |
| 807 content::WebContents* web_contents = | 807 content::WebContents* web_contents = |
| 808 browser()->tab_strip_model()->GetActiveWebContents(); | 808 browser()->tab_strip_model()->GetActiveWebContents(); |
| 809 | 809 |
| 810 int modifiers = blink::WebInputEvent::ShiftKey | kDefaultKeyModifier; | 810 int modifiers = blink::WebInputEvent::ShiftKey | kDefaultKeyModifier; |
| 811 | 811 |
| 812 content::WindowedNotificationObserver observer( | 812 content::WindowedNotificationObserver observer( |
| 813 chrome::NOTIFICATION_TAB_ADDED, | 813 chrome::NOTIFICATION_TAB_ADDED, |
| 814 content::NotificationService::AllSources()); | 814 content::NotificationService::AllSources()); |
| 815 content::SimulateMouseClickAt(web_contents, modifiers, | 815 content::SimulateMouseClickAt(web_contents, modifiers, |
| 816 blink::WebMouseEvent::ButtonLeft, link_position); | 816 blink::WebMouseEvent::Button::Left, link_position); |
| 817 observer.Wait(); | 817 observer.Wait(); |
| 818 | 818 |
| 819 int tab_count = browser()->tab_strip_model()->count(); | 819 int tab_count = browser()->tab_strip_model()->count(); |
| 820 ASSERT_EQ(2, tab_count); | 820 ASSERT_EQ(2, tab_count); |
| 821 | 821 |
| 822 content::WebContents* active_web_contents = | 822 content::WebContents* active_web_contents = |
| 823 browser()->tab_strip_model()->GetActiveWebContents(); | 823 browser()->tab_strip_model()->GetActiveWebContents(); |
| 824 ASSERT_NE(web_contents, active_web_contents); | 824 ASSERT_NE(web_contents, active_web_contents); |
| 825 | 825 |
| 826 const GURL& url = active_web_contents->GetURL(); | 826 const GURL& url = active_web_contents->GetURL(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 838 gfx::Point link_position(110, 110); | 838 gfx::Point link_position(110, 110); |
| 839 ConvertPageCoordToScreenCoord(guest_contents, &link_position); | 839 ConvertPageCoordToScreenCoord(guest_contents, &link_position); |
| 840 | 840 |
| 841 content::WebContents* web_contents = | 841 content::WebContents* web_contents = |
| 842 browser()->tab_strip_model()->GetActiveWebContents(); | 842 browser()->tab_strip_model()->GetActiveWebContents(); |
| 843 | 843 |
| 844 content::WindowedNotificationObserver observer( | 844 content::WindowedNotificationObserver observer( |
| 845 chrome::NOTIFICATION_TAB_ADDED, | 845 chrome::NOTIFICATION_TAB_ADDED, |
| 846 content::NotificationService::AllSources()); | 846 content::NotificationService::AllSources()); |
| 847 content::SimulateMouseClickAt(web_contents, blink::WebInputEvent::ShiftKey, | 847 content::SimulateMouseClickAt(web_contents, blink::WebInputEvent::ShiftKey, |
| 848 blink::WebMouseEvent::ButtonMiddle, link_position); | 848 blink::WebMouseEvent::Button::Middle, link_position); |
| 849 observer.Wait(); | 849 observer.Wait(); |
| 850 | 850 |
| 851 int tab_count = browser()->tab_strip_model()->count(); | 851 int tab_count = browser()->tab_strip_model()->count(); |
| 852 ASSERT_EQ(2, tab_count); | 852 ASSERT_EQ(2, tab_count); |
| 853 | 853 |
| 854 content::WebContents* active_web_contents = | 854 content::WebContents* active_web_contents = |
| 855 browser()->tab_strip_model()->GetActiveWebContents(); | 855 browser()->tab_strip_model()->GetActiveWebContents(); |
| 856 ASSERT_NE(web_contents, active_web_contents); | 856 ASSERT_NE(web_contents, active_web_contents); |
| 857 | 857 |
| 858 const GURL& url = active_web_contents->GetURL(); | 858 const GURL& url = active_web_contents->GetURL(); |
| 859 ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); | 859 ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); |
| 860 } | 860 } |
| OLD | NEW |