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

Unified Diff: net/base/net_util_unittest.cc

Issue 11507: Port directory lister. Don't break mac build. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 | « net/base/net_util.cc ('k') | net/net.xcodeproj/project.pbxproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util_unittest.cc
===================================================================
--- net/base/net_util_unittest.cc (revision 5730)
+++ net/base/net_util_unittest.cc (working copy)
@@ -5,6 +5,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -704,9 +705,9 @@
struct GetDirectoryListingEntryCase {
const char* name;
- DWORD file_attrib;
+ bool is_dir;
int64 filesize;
- FILETIME* modified;
+ base::Time time;
const char* expected;
};
@@ -714,21 +715,23 @@
TEST(NetUtilTest, GetDirectoryListingEntry) {
const GetDirectoryListingEntryCase test_cases[] = {
{"Foo",
- 0,
+ false,
10000,
- NULL,
+ base::Time(),
"<script>addRow(\"Foo\",\"Foo\",0,\"9.8 kB\",\"\");</script>\n"},
{"quo\"tes",
- 0,
+ false,
10000,
- NULL,
+ base::Time(),
"<script>addRow(\"quo\\\"tes\",\"quo%22tes\",0,\"9.8 kB\",\"\");</script>\n"},
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
const std::string results = net::GetDirectoryListingEntry(
- test_cases[i].name, test_cases[i].file_attrib,
- test_cases[i].filesize, test_cases[i].modified);
+ test_cases[i].name,
+ test_cases[i].is_dir,
+ test_cases[i].filesize,
+ test_cases[i].time);
EXPECT_EQ(test_cases[i].expected, results);
}
}
« no previous file with comments | « net/base/net_util.cc ('k') | net/net.xcodeproj/project.pbxproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698