summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations_unittest.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 06:03:44 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 06:03:44 +0000
commit38789d8b022117628f26ddf3d4abe9c47c98d574 (patch)
treebfd1d1446a3e8c7409d687597db0db3831c19e5e /webkit/glue/dom_operations_unittest.cc
parentd978840b3799a139f284c413ffe79b03944afa5e (diff)
downloadchromium_src-38789d8b022117628f26ddf3d4abe9c47c98d574.zip
chromium_src-38789d8b022117628f26ddf3d4abe9c47c98d574.tar.gz
chromium_src-38789d8b022117628f26ddf3d4abe9c47c98d574.tar.bz2
Revert "Revert "Implement web app definition parsing.""
This reverts commit 8d410ce0aae7acbbcd816425ba49e79d8d7b9a1d. TBR=aa@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations_unittest.cc')
-rw-r--r--webkit/glue/dom_operations_unittest.cc54
1 files changed, 0 insertions, 54 deletions
diff --git a/webkit/glue/dom_operations_unittest.cc b/webkit/glue/dom_operations_unittest.cc
index c57e943..fac49c6 100644
--- a/webkit/glue/dom_operations_unittest.cc
+++ b/webkit/glue/dom_operations_unittest.cc
@@ -128,58 +128,4 @@ TEST_F(DomOperationsTests, GetSavableResourceLinksWithPageHasInvalidLinks) {
GetSavableResourceLinksForPage(page_file_path, expected_resources_set);
}
-// Tests ParseIconSizes with various input.
-TEST_F(DomOperationsTests, ParseIconSizes) {
- struct TestData {
- const char* input;
- const bool expected_result;
- const bool is_any;
- const size_t expected_size_count;
- const int width1;
- const int height1;
- const int width2;
- const int height2;
- } data[] = {
- // Bogus input cases.
- { "10", false, false, 0, 0, 0, 0, 0 },
- { "10 10", false, false, 0, 0, 0, 0, 0 },
- { "010", false, false, 0, 0, 0, 0, 0 },
- { " 010 ", false, false, 0, 0, 0, 0, 0 },
- { " 10x ", false, false, 0, 0, 0, 0, 0 },
- { " x10 ", false, false, 0, 0, 0, 0, 0 },
- { "any 10x10", false, false, 0, 0, 0, 0, 0 },
- { "", false, false, 0, 0, 0, 0, 0 },
- { "10ax11", false, false, 0, 0, 0, 0, 0 },
-
- // Any.
- { "any", true, true, 0, 0, 0, 0, 0 },
- { " any", true, true, 0, 0, 0, 0, 0 },
- { " any ", true, true, 0, 0, 0, 0, 0 },
-
- // Sizes.
- { "10x11", true, false, 1, 10, 11, 0, 0 },
- { " 10x11 ", true, false, 1, 10, 11, 0, 0 },
- { " 10x11 1x2", true, false, 2, 10, 11, 1, 2 },
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- bool is_any;
- std::vector<gfx::Size> sizes;
- bool result = webkit_glue::ParseIconSizes(
- ASCIIToUTF16(data[i].input), &sizes, &is_any);
- ASSERT_EQ(result, data[i].expected_result);
- if (result) {
- ASSERT_EQ(data[i].is_any, is_any);
- ASSERT_EQ(data[i].expected_size_count, sizes.size());
- if (sizes.size() > 0) {
- ASSERT_EQ(data[i].width1, sizes[0].width());
- ASSERT_EQ(data[i].height1, sizes[0].height());
- }
- if (sizes.size() > 1) {
- ASSERT_EQ(data[i].width2, sizes[1].width());
- ASSERT_EQ(data[i].height2, sizes[1].height());
- }
- }
- }
-}
-
} // namespace