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

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

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 void registerRewriteURL(const char* fromURL, const char* toURL) 114 void registerRewriteURL(const char* fromURL, const char* toURL)
115 { 115 {
116 m_rewriteURLs.add(fromURL, toURL); 116 m_rewriteURLs.add(fromURL, toURL);
117 } 117 }
118 118
119 void serialize(const char* url) 119 void serialize(const char* url)
120 { 120 {
121 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), KURL(m_base Url, url).getString().utf8().data()); 121 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), KURL(m_base Url, url).getString().utf8().data());
122 FrameSerializer serializer(m_resources, *this); 122 FrameSerializer serializer(m_resources, *this);
123 Frame* frame = m_helper.webViewImpl()->mainFrameImpl()->frame(); 123 Frame* frame = m_helper.webView()->mainFrameImpl()->frame();
124 for (; frame; frame = frame->tree().traverseNext()) { 124 for (; frame; frame = frame->tree().traverseNext()) {
125 // This is safe, because tests do not do cross-site navigation 125 // This is safe, because tests do not do cross-site navigation
126 // (and therefore don't have remote frames). 126 // (and therefore don't have remote frames).
127 serializer.serializeFrame(*toLocalFrame(frame)); 127 serializer.serializeFrame(*toLocalFrame(frame));
128 } 128 }
129 } 129 }
130 130
131 Vector<SerializedResource>& getResources() 131 Vector<SerializedResource>& getResources()
132 { 132 {
133 return m_resources; 133 return m_resources;
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 EXPECT_EQ("saved from url=(0015)http://foo.com/", FrameSerializer::markOfThe WebDeclaration(KURL(ParsedURLString, "http://foo.com"))); 525 EXPECT_EQ("saved from url=(0015)http://foo.com/", FrameSerializer::markOfThe WebDeclaration(KURL(ParsedURLString, "http://foo.com")));
526 EXPECT_EQ("saved from url=(0015)http://f-o.com/", FrameSerializer::markOfThe WebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); 526 EXPECT_EQ("saved from url=(0015)http://f-o.com/", FrameSerializer::markOfThe WebDeclaration(KURL(ParsedURLString, "http://f-o.com")));
527 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", FrameSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); 527 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", FrameSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com--")));
528 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", FrameSerializer:: markOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); 528 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", FrameSerializer:: markOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->")));
529 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", FrameSerializer::mark OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); 529 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", FrameSerializer::mark OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--")));
530 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", FrameSerializer::mark OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); 530 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", FrameSerializer::mark OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--")));
531 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", FrameSerializer ::markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); 531 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", FrameSerializer ::markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz")));
532 } 532 }
533 533
534 } // namespace blink 534 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698