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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
720 guest_manager->ForEachGuest(contents, | 720 guest_manager->ForEachGuest(contents, |
721 base::Bind(&RetrieveGuestContents, | 721 base::Bind(&RetrieveGuestContents, |
722 &guest_contents)); | 722 &guest_contents)); |
723 ASSERT_TRUE(guest_contents); | 723 ASSERT_TRUE(guest_contents); |
724 | 724 |
725 ui::AXTreeUpdate ax_tree = GetAccessibilityTreeSnapshot(guest_contents); | 725 ui::AXTreeUpdate ax_tree = GetAccessibilityTreeSnapshot(guest_contents); |
726 std::string ax_tree_dump = DumpPdfAccessibilityTree(ax_tree); | 726 std::string ax_tree_dump = DumpPdfAccessibilityTree(ax_tree); |
727 ASSERT_MULTILINE_STREQ(kExpectedPDFAXTree, ax_tree_dump); | 727 ASSERT_MULTILINE_STREQ(kExpectedPDFAXTree, ax_tree_dump); |
728 } | 728 } |
729 | 729 |
730 #if defined(GOOGLE_CHROME_BUILD) | |
731 // Test a particular PDF encountered in the wild that encountered a crash | |
raymes
2017/01/30 18:57:25
nit: encountered a crash->triggered a crash
| |
732 // when accessibility is enabled. (http://crbug.com/668724) | |
733 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityTextRunCrash) { | |
734 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | |
735 GURL test_pdf_url(embedded_test_server()->GetURL( | |
736 "/pdf_private/accessibility_crash_2.pdf")); | |
737 | |
738 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | |
739 ASSERT_TRUE(guest_contents); | |
740 | |
741 WaitForAccessibilityTreeToContainNodeWithName(guest_contents, "Page 1"); | |
742 } | |
743 #endif | |
744 | |
745 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityCrash) { | |
746 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | |
747 | |
748 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-crash.pdf")); | |
749 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | |
750 ASSERT_TRUE(guest_contents); | |
751 | |
752 WaitForAccessibilityTreeToContainNodeWithName(guest_contents, "Page 1"); | |
753 } | |
raymes
2017/01/30 18:57:25
Hmm is this meant to be here?
| |
754 | |
730 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkCtrlLeftClick) { | 755 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkCtrlLeftClick) { |
731 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 756 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
732 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-link.pdf")); | 757 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-link.pdf")); |
733 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | 758 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); |
734 ASSERT_TRUE(guest_contents); | 759 ASSERT_TRUE(guest_contents); |
735 | 760 |
736 // The link position of the test-link.pdf in page coordinates is (110, 110). | 761 // The link position of the test-link.pdf in page coordinates is (110, 110). |
737 // Convert the link position from page coordinates to screen coordinates. | 762 // Convert the link position from page coordinates to screen coordinates. |
738 gfx::Point link_position(110, 110); | 763 gfx::Point link_position(110, 110); |
739 ConvertPageCoordToScreenCoord(guest_contents, &link_position); | 764 ConvertPageCoordToScreenCoord(guest_contents, &link_position); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
990 ASSERT_EQ(web_contents, active_web_contents); | 1015 ASSERT_EQ(web_contents, active_web_contents); |
991 | 1016 |
992 content::WebContents* new_web_contents = | 1017 content::WebContents* new_web_contents = |
993 browser()->tab_strip_model()->GetWebContentsAt(1); | 1018 browser()->tab_strip_model()->GetWebContentsAt(1); |
994 ASSERT_TRUE(new_web_contents); | 1019 ASSERT_TRUE(new_web_contents); |
995 ASSERT_NE(web_contents, new_web_contents); | 1020 ASSERT_NE(web_contents, new_web_contents); |
996 | 1021 |
997 const GURL& url = new_web_contents->GetURL(); | 1022 const GURL& url = new_web_contents->GetURL(); |
998 ASSERT_EQ(GURL("http://www.example.com"), url); | 1023 ASSERT_EQ(GURL("http://www.example.com"), url); |
999 } | 1024 } |
OLD | NEW |