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 <map> |
7 #include <vector> | 8 #include <vector> |
8 | 9 |
9 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
10 #include "base/files/file_enumerator.h" | 11 #include "base/files/file_enumerator.h" |
11 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
12 #include "base/hash.h" | 13 #include "base/hash.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 watcher.Wait(); | 591 watcher.Wait(); |
591 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 592 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
592 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble()); | 593 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble()); |
593 #endif | 594 #endif |
594 } | 595 } |
595 | 596 |
596 static std::string DumpPdfAccessibilityTree(const ui::AXTreeUpdate& ax_tree) { | 597 static std::string DumpPdfAccessibilityTree(const ui::AXTreeUpdate& ax_tree) { |
597 // Create a string representation of the tree starting with the embedded | 598 // Create a string representation of the tree starting with the embedded |
598 // object. | 599 // object. |
599 std::string ax_tree_dump; | 600 std::string ax_tree_dump; |
600 base::hash_map<int32_t, int> id_to_indentation; | 601 std::map<int32_t, int> id_to_indentation; |
601 bool found_embedded_object = false; | 602 bool found_embedded_object = false; |
602 for (auto& node : ax_tree.nodes) { | 603 for (auto& node : ax_tree.nodes) { |
603 if (node.role == ui::AX_ROLE_EMBEDDED_OBJECT) | 604 if (node.role == ui::AX_ROLE_EMBEDDED_OBJECT) |
604 found_embedded_object = true; | 605 found_embedded_object = true; |
605 if (!found_embedded_object) | 606 if (!found_embedded_object) |
606 continue; | 607 continue; |
607 | 608 |
608 int indent = id_to_indentation[node.id]; | 609 int indent = id_to_indentation[node.id]; |
609 ax_tree_dump += std::string(2 * indent, ' '); | 610 ax_tree_dump += std::string(2 * indent, ' '); |
610 ax_tree_dump += ui::ToString(node.role); | 611 ax_tree_dump += ui::ToString(node.role); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, OpenFromFTP) { | 1022 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, OpenFromFTP) { |
1022 net::SpawnedTestServer ftp_server( | 1023 net::SpawnedTestServer ftp_server( |
1023 net::SpawnedTestServer::TYPE_FTP, net::SpawnedTestServer::kLocalhost, | 1024 net::SpawnedTestServer::TYPE_FTP, net::SpawnedTestServer::kLocalhost, |
1024 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/pdf"))); | 1025 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/pdf"))); |
1025 ASSERT_TRUE(ftp_server.Start()); | 1026 ASSERT_TRUE(ftp_server.Start()); |
1026 | 1027 |
1027 GURL url(ftp_server.GetURL("/test.pdf")); | 1028 GURL url(ftp_server.GetURL("/test.pdf")); |
1028 ASSERT_TRUE(LoadPdf(url)); | 1029 ASSERT_TRUE(LoadPdf(url)); |
1029 EXPECT_EQ(base::ASCIIToUTF16("test.pdf"), GetActiveWebContents()->GetTitle()); | 1030 EXPECT_EQ(base::ASCIIToUTF16("test.pdf"), GetActiveWebContents()->GetTitle()); |
1030 } | 1031 } |
OLD | NEW |