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

Unified Diff: chrome/browser/download/save_package_unittest.cc

Issue 155095: Make default extension for downloading html "html" rather than "htm" on non-w... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/download/save_page_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_package_unittest.cc
===================================================================
--- chrome/browser/download/save_package_unittest.cc (revision 19956)
+++ chrome/browser/download/save_package_unittest.cc (working copy)
@@ -11,6 +11,11 @@
#include "testing/gtest/include/gtest/gtest.h"
#define FPL FILE_PATH_LITERAL
+#if defined(OS_WIN)
+#define HTML_EXTENSION ".htm"
+#else
+#define HTML_EXTENSION ".html"
+#endif
namespace {
@@ -52,7 +57,7 @@
PathService::Get(base::DIR_TEMP, &test_dir);
save_package_success_ = new SavePackage(
- test_dir.AppendASCII("testfile.htm"),
+ test_dir.AppendASCII("testfile" HTML_EXTENSION),
test_dir.AppendASCII("testfile_files"));
// We need to construct a path that is *almost* kMaxFilePathLength long
@@ -62,7 +67,7 @@
long_file_name.resize(kMaxFilePathLength - 9 - test_dir.value().length());
save_package_fail_ = new SavePackage(
- test_dir.AppendASCII(long_file_name + ".htm"),
+ test_dir.AppendASCII(long_file_name + HTML_EXTENSION),
test_dir.AppendASCII(long_file_name + "_files"));
}
@@ -103,7 +108,8 @@
// name from disposition and url has been tested in DownloadManagerTest.
// No useful information in disposition or URL, use default.
- {"1.html", "http://www.savepage.com/", FPL("saved_resource.htm"), true},
+ {"1.html", "http://www.savepage.com/", FPL("saved_resource") HTML_EXTENSION,
+ true},
// No duplicate occurs.
{"filename=1.css", "http://www.savepage.com", FPL("1.css"), false},
@@ -187,12 +193,12 @@
{FPL("filename.HTML"), FPL("filename.HTML")},
{FPL("filename.htm"), FPL("filename.htm")},
// ".htm" is added if the extension is improper for HTML.
- {FPL("hello.world"), FPL("hello.world.htm")},
- {FPL("hello.txt"), FPL("hello.txt.htm")},
- {FPL("is.html.good"), FPL("is.html.good.htm")},
+ {FPL("hello.world"), FPL("hello.world") FPL(HTML_EXTENSION)},
+ {FPL("hello.txt"), FPL("hello.txt") FPL(HTML_EXTENSION)},
+ {FPL("is.html.good"), FPL("is.html.good") FPL(HTML_EXTENSION)},
// ".htm" is added if the name doesn't have an extension.
- {FPL("helloworld"), FPL("helloworld.htm")},
- {FPL("helloworld."), FPL("helloworld..htm")},
+ {FPL("helloworld"), FPL("helloworld") FPL(HTML_EXTENSION)},
+ {FPL("helloworld."), FPL("helloworld.") FPL(HTML_EXTENSION)},
};
TEST_F(SavePackageTest, TestEnsureHtmlExtension) {
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/download/save_page_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698