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

Side by Side Diff: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp

Issue 1371323003: Escape "--" in the page URL at page serialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-09-30T19:11:33 Follow review comments Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 registerURL("namespace_element.html", "text/html"); 490 registerURL("namespace_element.html", "text/html");
491 491
492 serialize("namespace_element.html"); 492 serialize("namespace_element.html");
493 493
494 EXPECT_EQ(1U, getResources().size()); 494 EXPECT_EQ(1U, getResources().size());
495 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); 495 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html"));
496 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(), 0U); 496 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(), 0U);
497 } 497 }
498 498
499 TEST_F(PageSerializerTest, markOfTheWebDeclaration)
500 {
501 EXPECT_EQ("saved from url=(0015)http://foo.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://foo.com")));
502 EXPECT_EQ("saved from url=(0015)http://f-o.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://f-o.com")));
503 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", PageSerializer::markOf TheWebDeclaration(KURL(ParsedURLString, "http://foo.com--")));
504 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", PageSerializer::m arkOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->")));
505 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--")));
506 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--")));
507 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", PageSerializer: :markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz")));
508 }
509
499 } // namespace blink 510 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPageSerializer.cpp ('k') | third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698