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 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityCrash) { | |
raymes
2017/01/24 23:13:14
nit: please add a link to the bug for this
| |
731 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | |
732 | |
733 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-crash.pdf")); | |
734 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | |
735 ASSERT_TRUE(guest_contents); | |
736 | |
737 WaitForAccessibilityTreeToContainNodeWithName(guest_contents, "Page 1"); | |
738 } | |
739 | |
730 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkCtrlLeftClick) { | 740 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkCtrlLeftClick) { |
731 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 741 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
732 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-link.pdf")); | 742 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-link.pdf")); |
733 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | 743 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); |
734 ASSERT_TRUE(guest_contents); | 744 ASSERT_TRUE(guest_contents); |
735 | 745 |
736 // The link position of the test-link.pdf in page coordinates is (110, 110). | 746 // 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. | 747 // Convert the link position from page coordinates to screen coordinates. |
738 gfx::Point link_position(110, 110); | 748 gfx::Point link_position(110, 110); |
739 ConvertPageCoordToScreenCoord(guest_contents, &link_position); | 749 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); | 1000 ASSERT_EQ(web_contents, active_web_contents); |
991 | 1001 |
992 content::WebContents* new_web_contents = | 1002 content::WebContents* new_web_contents = |
993 browser()->tab_strip_model()->GetWebContentsAt(1); | 1003 browser()->tab_strip_model()->GetWebContentsAt(1); |
994 ASSERT_TRUE(new_web_contents); | 1004 ASSERT_TRUE(new_web_contents); |
995 ASSERT_NE(web_contents, new_web_contents); | 1005 ASSERT_NE(web_contents, new_web_contents); |
996 | 1006 |
997 const GURL& url = new_web_contents->GetURL(); | 1007 const GURL& url = new_web_contents->GetURL(); |
998 ASSERT_EQ(GURL("http://www.example.com"), url); | 1008 ASSERT_EQ(GURL("http://www.example.com"), url); |
999 } | 1009 } |
OLD | NEW |