Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 2829163004: Remove uses of base::hash_map from //chrome (Closed)
Patch Set: Downloads back Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 watcher.Wait(); 601 watcher.Wait();
601 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) 602 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
602 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble()); 603 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble());
603 #endif 604 #endif
604 } 605 }
605 606
606 static std::string DumpPdfAccessibilityTree(const ui::AXTreeUpdate& ax_tree) { 607 static std::string DumpPdfAccessibilityTree(const ui::AXTreeUpdate& ax_tree) {
607 // Create a string representation of the tree starting with the embedded 608 // Create a string representation of the tree starting with the embedded
608 // object. 609 // object.
609 std::string ax_tree_dump; 610 std::string ax_tree_dump;
610 base::hash_map<int32_t, int> id_to_indentation; 611 std::map<int32_t, int> id_to_indentation;
611 bool found_embedded_object = false; 612 bool found_embedded_object = false;
612 for (auto& node : ax_tree.nodes) { 613 for (auto& node : ax_tree.nodes) {
613 if (node.role == ui::AX_ROLE_EMBEDDED_OBJECT) 614 if (node.role == ui::AX_ROLE_EMBEDDED_OBJECT)
614 found_embedded_object = true; 615 found_embedded_object = true;
615 if (!found_embedded_object) 616 if (!found_embedded_object)
616 continue; 617 continue;
617 618
618 int indent = id_to_indentation[node.id]; 619 int indent = id_to_indentation[node.id];
619 ax_tree_dump += std::string(2 * indent, ' '); 620 ax_tree_dump += std::string(2 * indent, ' ');
620 ax_tree_dump += ui::ToString(node.role); 621 ax_tree_dump += ui::ToString(node.role);
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, OpenFromFTP) { 1032 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, OpenFromFTP) {
1032 net::SpawnedTestServer ftp_server( 1033 net::SpawnedTestServer ftp_server(
1033 net::SpawnedTestServer::TYPE_FTP, net::SpawnedTestServer::kLocalhost, 1034 net::SpawnedTestServer::TYPE_FTP, net::SpawnedTestServer::kLocalhost,
1034 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/pdf"))); 1035 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/pdf")));
1035 ASSERT_TRUE(ftp_server.Start()); 1036 ASSERT_TRUE(ftp_server.Start());
1036 1037
1037 GURL url(ftp_server.GetURL("/test.pdf")); 1038 GURL url(ftp_server.GetURL("/test.pdf"));
1038 ASSERT_TRUE(LoadPdf(url)); 1039 ASSERT_TRUE(LoadPdf(url));
1039 EXPECT_EQ(base::ASCIIToUTF16("test.pdf"), GetActiveWebContents()->GetTitle()); 1040 EXPECT_EQ(base::ASCIIToUTF16("test.pdf"), GetActiveWebContents()->GetTitle());
1040 } 1041 }
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor_browsertest.cc ('k') | chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698