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

Unified Diff: net/base/net_util_icu_unittest.cc

Issue 1548503002: net: extract GetDirectoryListingXXX functions into directory_listing.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: net/base/net_util_icu_unittest.cc
diff --git a/net/base/net_util_icu_unittest.cc b/net/base/net_util_icu_unittest.cc
deleted file mode 100644
index cac922f58feff4c8130bc420c884e084572b07bf..0000000000000000000000000000000000000000
--- a/net/base/net_util_icu_unittest.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/base/net_util.h"
-
-#include <stdint.h>
-
-#include <string>
-
-#include "base/strings/utf_string_conversions.h"
-#include "base/time/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace net {
-
-namespace {
-
-struct GetDirectoryListingEntryCase {
- const wchar_t* name;
- const char* const raw_bytes;
- bool is_dir;
- int64_t filesize;
- base::Time time;
- const char* const expected;
-};
-
-TEST(NetUtilTest, GetDirectoryListingEntry) {
- const GetDirectoryListingEntryCase test_cases[] = {
- {L"Foo",
- "",
- false,
- 10000,
- base::Time(),
- "<script>addRow(\"Foo\",\"Foo\",0,\"9.8 kB\",\"\");</script>\n"},
- {L"quo\"tes",
- "",
- false,
- 10000,
- base::Time(),
- "<script>addRow(\"quo\\\"tes\",\"quo%22tes\",0,\"9.8 kB\",\"\");</script>"
- "\n"},
- {L"quo\"tes",
- "quo\"tes",
- false,
- 10000,
- base::Time(),
- "<script>addRow(\"quo\\\"tes\",\"quo%22tes\",0,\"9.8 kB\",\"\");</script>"
- "\n"},
- // U+D55C0 U+AE00. raw_bytes is empty (either a local file with
- // UTF-8/UTF-16 encoding or a remote file on an ftp server using UTF-8
- {L"\xD55C\xAE00.txt",
- "",
- false,
- 10000,
- base::Time(),
- "<script>addRow(\"\xED\x95\x9C\xEA\xB8\x80.txt\","
- "\"%ED%95%9C%EA%B8%80.txt\",0,\"9.8 kB\",\"\");</script>\n"},
- // U+D55C0 U+AE00. raw_bytes is the corresponding EUC-KR sequence:
- // a local or remote file in EUC-KR.
- {L"\xD55C\xAE00.txt",
- "\xC7\xD1\xB1\xDB.txt",
- false,
- 10000,
- base::Time(),
- "<script>addRow(\"\xED\x95\x9C\xEA\xB8\x80.txt\",\"%C7%D1%B1%DB.txt\""
- ",0,\"9.8 kB\",\"\");</script>\n"},
- };
-
- for (size_t i = 0; i < arraysize(test_cases); ++i) {
- const std::string results = GetDirectoryListingEntry(
- base::WideToUTF16(test_cases[i].name), test_cases[i].raw_bytes,
- test_cases[i].is_dir, test_cases[i].filesize, test_cases[i].time);
- EXPECT_EQ(test_cases[i].expected, results);
- }
-}
-
-} // namespace
-
-} // namespace net

Powered by Google App Engine
This is Rietveld 408576698