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

Side by Side Diff: chrome/browser/download/download_util_unittest.cc

Issue 3058052: Fix DownloadUtilTest on Mac. Not sure what causes the difference. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #if defined(OS_POSIX) && !defined(OS_MACOSX) 5 #if defined(OS_POSIX) && !defined(OS_MACOSX)
6 #include <locale.h> 6 #include <locale.h>
7 #endif 7 #endif
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/download/download_util.h" 10 #include "chrome/browser/download/download_util.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 551
552 { FILE_PATH_LITERAL("/bar.html"), 552 { FILE_PATH_LITERAL("/bar.html"),
553 "image/png", 553 "image/png",
554 FILE_PATH_LITERAL("/bar.html.png") }, 554 FILE_PATH_LITERAL("/bar.html.png") },
555 { FILE_PATH_LITERAL("/bar"), 555 { FILE_PATH_LITERAL("/bar"),
556 "image/png", 556 "image/png",
557 FILE_PATH_LITERAL("/bar.png") }, 557 FILE_PATH_LITERAL("/bar.png") },
558 558
559 { FILE_PATH_LITERAL("/foo/bar.exe"), 559 { FILE_PATH_LITERAL("/foo/bar.exe"),
560 "text/html", 560 "text/html",
561 #if defined(OS_MACOSX)
562 FILE_PATH_LITERAL("/foo/bar.exe.html") },
563 #else
561 FILE_PATH_LITERAL("/foo/bar.html") }, 564 FILE_PATH_LITERAL("/foo/bar.html") },
565 #endif
562 { FILE_PATH_LITERAL("/foo/bar.exe"), 566 { FILE_PATH_LITERAL("/foo/bar.exe"),
563 "image/gif", 567 "image/gif",
568 #if defined(OS_MACOSX)
569 FILE_PATH_LITERAL("/foo/bar.exe.gif") },
570 #else
564 FILE_PATH_LITERAL("/foo/bar.gif") }, 571 FILE_PATH_LITERAL("/foo/bar.gif") },
572 #endif
565 573
566 { FILE_PATH_LITERAL("/foo/google.com"), 574 { FILE_PATH_LITERAL("/foo/google.com"),
567 "text/html", 575 "text/html",
568 FILE_PATH_LITERAL("/foo/google.com.html") }, 576 FILE_PATH_LITERAL("/foo/google.com.html") },
569 577
570 { FILE_PATH_LITERAL("/foo/con.htm"), 578 { FILE_PATH_LITERAL("/foo/con.htm"),
571 "text/html", 579 "text/html",
572 FILE_PATH_LITERAL("/foo/con.htm") }, 580 FILE_PATH_LITERAL("/foo/con.htm") },
573 { FILE_PATH_LITERAL("/foo/con"), 581 { FILE_PATH_LITERAL("/foo/con"),
574 "text/html", 582 "text/html",
575 FILE_PATH_LITERAL("/foo/con.html") }, 583 FILE_PATH_LITERAL("/foo/con.html") },
576 #endif // OS_WIN 584 #endif // OS_WIN
577 }; 585 };
578 586
579 TEST(DownloadUtilTest, GenerateSafeFileName) { 587 TEST(DownloadUtilTest, GenerateSafeFileName) {
580 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSafeFilenameCases); ++i) { 588 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSafeFilenameCases); ++i) {
581 FilePath path(kSafeFilenameCases[i].path); 589 FilePath path(kSafeFilenameCases[i].path);
582 download_util::GenerateSafeFileName(kSafeFilenameCases[i].mime_type, &path); 590 download_util::GenerateSafeFileName(kSafeFilenameCases[i].mime_type, &path);
583 EXPECT_EQ(kSafeFilenameCases[i].expected_path, path.value()); 591 EXPECT_EQ(kSafeFilenameCases[i].expected_path, path.value());
584 } 592 }
585 } 593 }
586 594
587 } // namespace 595 } // namespace
588 596
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698