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

Unified Diff: components/favicon_base/large_icon_url_parser_unittest.cc

Issue 2917733002: Remove unused chrome://large-icon (Closed)
Patch Set: Created 3 years, 7 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 | « components/favicon_base/large_icon_url_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon_base/large_icon_url_parser_unittest.cc
diff --git a/components/favicon_base/large_icon_url_parser_unittest.cc b/components/favicon_base/large_icon_url_parser_unittest.cc
deleted file mode 100644
index d58ca3ff854499dfb56bfcbcf064030e3a9fb726..0000000000000000000000000000000000000000
--- a/components/favicon_base/large_icon_url_parser_unittest.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2015 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 "components/favicon_base/large_icon_url_parser.h"
-
-#include <stddef.h>
-
-#include "base/macros.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace {
-
-const char kTestUrlStr[] = "https://www.google.ca/imghp?hl=en&tab=wi";
-
-} // namespace
-
-TEST(LargeIconUrlParserTest, ParseLargeIconPathSuccess) {
- // Everything populated.
- {
- LargeIconUrlParser parser;
- EXPECT_TRUE(parser.Parse(std::string("48/") + kTestUrlStr));
- EXPECT_EQ(48, parser.size_in_pixels());
- EXPECT_EQ(GURL(kTestUrlStr), GURL(parser.url_string()));
- EXPECT_EQ(3U, parser.path_index());
- }
-
- // Empty URL.
- {
- LargeIconUrlParser parser;
- EXPECT_TRUE(parser.Parse("48/"));
- EXPECT_EQ(48, parser.size_in_pixels());
- EXPECT_EQ(GURL(), GURL(parser.url_string()));
- EXPECT_EQ(3U, parser.path_index());
- }
-
- // Tolerate invalid URL.
- {
- LargeIconUrlParser parser;
- EXPECT_TRUE(parser.Parse("48/NOT A VALID URL"));
- EXPECT_EQ(48, parser.size_in_pixels());
- EXPECT_EQ("NOT A VALID URL", parser.url_string());
- EXPECT_EQ(3U, parser.path_index());
- }
-}
-
-TEST(LargeIconUrlParserTest, ParseLargeIconPathFailure) {
- const char* const test_cases[] = {
- "",
- "/",
- "//",
- "48", // Missing '/'.
- "/http://www.google.com/", // Missing size.
- "not_a_number/http://www.google.com/", // Bad size.
- "0/http://www.google.com/", // Non-positive size.
- "-1/http://www.google.com/", // Non-positive size.
- };
- for (size_t i = 0; i < arraysize(test_cases); ++i) {
- LargeIconUrlParser parser;
- EXPECT_FALSE(parser.Parse(test_cases[i])) << "test_cases[" << i << "]";
- }
-}
« no previous file with comments | « components/favicon_base/large_icon_url_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698