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

Unified Diff: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp

Issue 1436683002: Making PageSerializer operate on single frames only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-removing-unused-code
Patch Set: Rebasing... Created 5 years, 1 month 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 | « third_party/WebKit/Source/web/tests/MHTMLTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
index 242012de980914d073cfcbbee6bad7a60f87f123..d367080470dbf5a475f100fd0fb848fc177bffdf 100644
--- a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
@@ -48,6 +48,7 @@
#include "web/WebLocalFrameImpl.h"
#include "web/WebViewImpl.h"
#include "web/tests/FrameTestHelpers.h"
+#include "wtf/Assertions.h"
#include "wtf/Vector.h"
using blink::URLTestHelpers::toKURL;
@@ -123,7 +124,12 @@ protected:
for (const auto& rewriteURL: m_rewriteURLs)
serializer.registerRewriteURL(rewriteURL.key, rewriteURL.value);
- serializer.serialize(m_helper.webViewImpl()->mainFrameImpl()->frame()->page());
+ Frame* frame = m_helper.webViewImpl()->mainFrameImpl()->frame();
+ for (; frame; frame = frame->tree().traverseNext()) {
+ // This is safe, because tests do not do cross-site navigation
+ // (and therefore don't have remote frames).
+ serializer.serializeFrame(*toLocalFrame(frame));
+ }
}
Vector<SerializedResource>& getResources()
@@ -131,7 +137,6 @@ protected:
return m_resources;
}
-
const SerializedResource* getResource(const char* url, const char* mimeType)
{
KURL kURL = KURL(m_baseUrl, url);
« no previous file with comments | « third_party/WebKit/Source/web/tests/MHTMLTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698